EventScripts Forums
Mattie's EventScripts and Source Forums
Script Categories
16000 (15) abilities (15) addon (72) addons (18) admin (355) admins (24) advert (30) adverts (32) afk (18) alerts (12) ammo (25) anti (21) armor (11) auth (16) automatic (15) awp (29) ban (25) bank (11) ba_jail (35) bhop (46) block (27) bomb (48) bonus (25) boost (22) bot (36) bot-management (20) bots (24) bullet (13) bunnyhop (19) Buy (27) buymenu (13) c4 (12) cash (77) Change (14) chat (77) cheat (15) clan (17) classes (24) color (30) colors (21) command (23) commands (21) config (28) configurable (11) connect (58) counter (12) Counter-Strike-Source (20) CS:S (20) css (3404) custom (13) Damage (49) database (14) dead (19) Deagle (11) death (20) deathmatch (79) deathrun (17) deutsch (15) dice (12) disconnect (26) Dissolve (12) dm (24) dod:s (11) dods (502) download (13) easy (26) effect (14) effects (126) English (20) entity (24) est (12) es_tools (14) Eventscript (12) exploit (11) flashbang (27) français (104) french (36) fun (312) funny (18) Gabeee (11) game (12) gamemode (13) gameplay (175) German (11) give (22) gravity (16) grenade (28) grenades (32) gun (16) GunGame (31) GunGame5 (11) guns (20) Hack (16) headshot (37) health (72) hegrenade (15) help (11) hit (13) hl2dm (444) HP (26) hudhint (13) hun (18) hungarian (26) info (53) information (19) invisible (11) IP (13) jail (82) jailbreak (14) join (47) jump (19) kick (25) kill (51) kills (24) knife (66) leveling (38) LnD (14) lol (11) magyar (49) management (14) manager (11) mani (16) map (32) map-management (26) maps (17) match (25) Memphis-84 (13) menu (144) message (34) messaging (52) minecraft (12) mod (121) model (18) models (33) modye (16) money (50) motd (13) music (33) mute (20) nades (20) name (15) new (13) noblock (54) orangebox (23) player (49) player-management (31) player-tracking (28) popup (72) prop (13) propmenu (14) props (34) protect (12) protection (32) punish (11) punishment (51) python (80) quake (33) QuakeSounds (12) race (13) races (20) radio (31) random (47) rank (42) rates (15) rcon (12) realism (22) Regeln (23) respawn (69) restrict (41) round (26) rpg (32) rules (63) say (17) score (16) scout (29) Script (25) script-helper (25) scriptpack (33) sdk (171) server (63) server-tools (42) shop (12) showdamage (20) silly (31) simple (33) skin (17) skins (35) slay (13) soccer (14) sound (68) sounds (109) source (14) spanish (20) spawn (82) speed (26) statistics (14) stats (57) status (15) Steam (11) STEAMID (30) Superhero (15) surf (41) Team (30) team-balance (14) teleport (17) text (19) TF2 (142) time (23) timer (15) tools (15) tracers (19) triggers (11) uedi (17) uses_auth (18) vip (24) vote (40) voting (22) war (25) Warcraft (12) warcraft-source (20) wc3 (14) wcs (47) wcs:Python (32) weapon (88) weapons (120) web (16) welcome (14) wuerfeln (11) zm (26) zombie (100) zombiemod (55) zombies (12)
Script Authors
*XYZ*SaYnt (12) .:MiB:. (20) .:modye:. (14) .eMko* (6) 101satoon101 (12) 3R10N (24) 4u571n91 (5) 7355608 (9) Absolute (9) Ace Rimmer (40) adminc (5) adyshor37 (5) Adz (8) AgathaKnuppelkuh (8) aidden (8) ajax (5) ak_47 (6) Al3c Tr3v3lyan (6) allstareng (5) ashbash1987 (9) ATAMAH (7) Ayuto (5) aznone (5) B00M (5) BackRaw (41) BFH_RedBull (8) bigfabi (8) Bioko (10) blackshoxx (9) Blade (10) bladesback (13) bobdole (11) bodzsar1 (8) bonbon (36) Brainsucker (32) cagemonkey (8) capo azzlack (7) captain master (6) carbon-14 (10) CaskioUTF (5) cbirou (15) CbRRR (16) ChaCaLz2psy4 (5) CharlesT (5) Chris1888 (5) Chrisber (5) chrismrulz (10) Chun (6) cladiron (10) clipz934 (8) Colster (21) Cookieman8 (7) CrAzD (6) craziest (11) dani12356 (12) DanielB (19) Darkness123 (8) Dave (9) dbozan99 (7) dead man walker (12) deathx9 (5) Deathyy (16) dhack (17) Di[M]aN (12) DJ Fire-Black prod (8) DoCky (31) Don (15) dordtcore (9) DragonFreddo (8) Drassil (5) dretax14 (11) Einlanzers (47) EmbouT (10) emilplov (7) Errant (10) Eun (6) Fantole (10) FMIS (5) Franc1sco (17) freddukes (18) Frequency (6) Fridge (5) Fugi91 (6) Fulmine (5) G4ME (5) GAMEREN2 (8) german9114 (13) GODJonez (40) GoodfellaDeal (5) Hansi (6) Hisoka (6) HitThePipe (7) HOLLDIDAY (24) Icetouch (6) ichthys (25) Im the new guy (14) iNexus (13) infamous1 (9) isivisi (13) ispaine (7) Jackmaster (9) Jeff91 (45) JoeyT2006 (30) Juba_PornBorn (12) jxl180 (11) KDBFame (6) L'In20Cible (11) L.P.H (8) Largo Usagi (10) LnD (14) Lobe (11) loKkdoKk (8) lolo-le-haricot (7) LosNir (5) Lumpi@Work (9) M4rc3L-XCN (7) macshot (7) magyar-oneill (9) Matth (7) Mattie (21) mave1993 (5) MBchrono (15) McFly (20) Medda (5) Memphis-84 (15) Messiah93 (20) Mickyy (5) micmacx (6) minimal42O (5) Mitchell (5) Mixer57 (5) modye (6) Monster_Bitch1 (9) Mordavolt (7) motomoto (23) MrScriptaz (6) mryoung (6) MyTechZone.de (9) NicolasConfigz (9) Nicolous (23) ojii (31) oliVier (10) Omega68 (6) Omega_K2 (11) Owned|Myself (8) P3N (7) pand3mic (6) parsimba (5) Pascal257 (9) PatPeter (7) PDrop (10) Phaedrus (18) PhantOm Fury (7) phoenix131 (9) pinkyyy -.- (5) pitbull0993 (7) PixelGamer (7) qwern (5) randomknifer (9) Raptor150 (31) Ratzee (6) ReaCtioN2oo9 (6) RedCliff (5) Rennnyyy (17) revolutionfighters (8) RideGuy (12) Rio (9) Roeliekt (6) roof (16) runamagic (13) Ryezin (5) sandking220 (6) Sarcasm_Poisoning (10) saRs| Johnny-5 (13) Schubaal (10) sea212 (5) sega74rus (15) sgt.angel (6) Shad0w (11) ShoTaXx# (7) sicilia (7) sicman_adrian (22) skillz92 (7) sn4k3 (18) Snake12 (7) snake38 (10) sonicsight (7) SpeedFreak (9) spoonman184 (12) stabby (22) stas (27) Stirni (6) stonedegg (8) Strontium Dog (30) SumGuy14 (25) SuperDave (49) surfteam (5) TaCo (5) TanaToS (17) Tealk (6) teowow (16) TheCheeTaH (27) TheDonFather (5) theresthatguy (6) Tiny Tod (7) tooshkan4uk (8) Totyahun (9) uedi (38) ultimatebuster (6) Undead (25) usernamesaretaken (15) wanted241 (9) Warren (13) westham (6) WhiteAvenger (7) Wonder (14) Wundermaxe (5) X-Mania (5) XE_ManUp (14) xfalcon61 (5) zSweetXz (5) ZZMatty (6) [Cs]Lord_Inferno2 (11) [DAP]Kickbutt (5) [NATO]Hunter (28) ||Wolf|| (10)
Search

Post new topic Reply to topic
Author Message
User avatar
Experienced
Profile

Posts: 379
Location:
Germany
 
New postPosted: 2010-09-04, 8:46 pm 
   Post subject: MySQL Advertisements [V 1.02.000] [21st October 2010]

MySQL Advertisements - Version 1.02.000
Posted by: Omega_K2 on 21st October 2010.

Requirements:

Description:
    MySQL Advertisements - Version 1.02.000

    What is MySQL Advertisements?:

    It allows you to share ingame advertisements accross many game servers. It can be configured in a very flexible way (settings for each message and server) and supports translations for multilingual servers.
    However, due to the nature of this script, I recommend it for advanced users only, since error checking and enduser interface is kept to a minimum.

    Does it support variables inbetween the messages?:

    Yes! The current possible variables are currentmap, time, date and any cvar. The variables can be set in the messages itself, allowing different positioning according to language. If you feel some variables are missing, let me know and I can add them (as long it's possible).

    For details, see the Configuration section below.

    What kind of broadcasting does it support?:

    Currently MySQL Advertisements supports advertisements in the text, popup, center and hint area.
    These modes can be used at once or seperatly.

    How is the advertisement order defined?:

    The advertisement order is determined as the ads are fetched from the database. However, a special order value can be assigned to the advertisement, allowing you to specify your own order.
    In addition, MySQL Advertisements supports randomizing the messages.

    Live Examples:

    Either connect to one of these servers:


Installation:

This only covers the very basic installation of mysqlads. You have to proceed with the configuration afterwards.

    Database:

    1. Create a new database user (make sure to renember username and password, I recommend restricting access to your server ip (or localhost if the server is on the same machine), don't give this user any global permissions)
    2. Create a new database
    3. Give the user you've created full access to the database.

    Server:

    1. Install pymysql or MySQLdb (make sure it loads!)
    2. Install pubcvarlib
    3. Install mysqlads
    4. Open addons/eventscripts/mysqlads/config.ini
    5. Replace the defaults with the data you used upon creation of the database (username, password, database)
    6. Set the host properly. It accepts a hostname or ip address - for a local server use localhost (or try 127.0.0.1 if that doesn't work)
    7. Set a table prefix if you want or leave it empty (this is useful if you only have one database available and other scripts/programms use it aswell)
    8. Load the script once - tables will be created (and the script unloaded)

    Now proceed with the Configuration Section below.

Update:

If you are upgrading from an older version, please follow these steps:

  1. Upload all files from the package except config.ini
  2. Type the following in console: es_load mysqlads/updater
  3. Run this command: mysqlads_update
  4. Reload mysqlads: es_reload mysqlads
  5. Incase new features have been added, proceed with the Configuration section (and reload script once you're done)

Configuration:

    I recommend using a GUI tool like phpmyadmin, howver, you can do this with queries directly aswell.

    Adding Server(s)

    • Set the fields port and ip according to the public server ip and port. Make sure this info is correct, it will be used to identify your server by the script
    • Set the field interval to how often you want the advertisements to appear on the server per seconds. If left empty, it will use 30 seconds
    • Set the fields dateformat and timeformat to the format you want to use respectivitly. If left empty, it will use %d.%m.%Y and %H:%M:%S. Refer to the python documention for valid values.
    • Set the field random to either true or false depending on whether you want to have ads randomized on that serve. If left empty it defaults to False.
    • DO NOT set a value for sid, it will automatically determined!

    Advertisements

    Step 1: Adding Advertisements

    • Set the field display to any value from 0 to 15. Each display mode adds up, valid display modes are:
      1 - Text Area
      2 - Popup Area
      4 - Hint Area
      8 - Center Area
      If you leave this empty, it will default to 1.
    • Set the field servers to a comma-sperated list of ServerIDs you wish the advertisement to be displayed on. You can specify -1, if you want the advertisements on all servers. You must have a comma on the end (for example 1,2,3,).
      As of version 1.01.000 you can also start the entry with an exclamation mark (!). This means all following ServerIDs will be excluded (!1,2, would exclude server 1 and 2, but still show the advertisement on all other servers)
    • Set the field order to any value from 0 to 255 depending on when you want the advertisement to be displayed. If left empty, it will use 128.
    • DO NOT set a value for aid, it will automatically determined!

    Step 2: Adding Advertisement Translations

    • Set the field aid to the advertisement id
    • Set the field language to the 2 char language identifier (for example en or de). (You can look up the language identifiers used by eventscripts in addons/eventscripts/_libs/python/deflangs.ini
      If you leave this empty, it will default to en.
    • Set the field text to the string you want to show up ingame.
      You may use special variables inside of that string that will be replaced on run time:
      {CURRENTMAP} - Current map
      {TIME} - Time as set for your server
      {DATE} - Data as set for your server
      {CVAR:my_cvar} - current value of my_cvar (any cvar may be used)
      Additionally, for text area messages you can use #green #lightgreen and #default to change the colour of the messages. These tags will not show up in future messages
    • DO NOT create double entries for the same language and aid!

    Event Messages (added in 1.02.000)

    Step 1: Adding Events

    • Do not set the fieldid. It will be automatically determined
    • Set the field eid to the id of event. This will be used later to determine which events the messages are displayed on. You can have double entries here, but this only makes sense if you run several different game servers (eg. TF2 and CS:S) and want to set one eventid for roundend in both (the actual game events are different of course)
    • Set the field event to the name of event as defined in the resource files (<gamedir>/resource/modevents.res or hl2/resource/serverevents.res). Make sure the event exists.
    • Set the field game to the foldername of your current gamemod or set it to NULL if you want the event available in all games. For example, CS:S would use cstrike, Team Fortress 2 would use tf.
    • Set the field delay to any value you wish the messages for that certain event to be delayed for (in seconds). This delay will be added to the delay of the individual messages.

    Step 2: Adding Event Messages

    • Do not set a value for the field id, it will automatically determined!
    • Set the field display to any value from 0 to 15. Each display mode adds up, valid display modes are:
      1 - Text Area
      2 - Popup Area
      4 - Hint Area
      8 - Center Area
      If you leave this empty, it will default to 1.
    • Set the field servers to a comma-sperated list of ServerIDs you wish the advertisement to be displayed on. You can specify -1, if you want the advertisements on all servers. You must have a comma on the end (for example 1,2,3,).
      You can also start the entry with an exclamation mark (!). This means all following ServerIDs will be excluded (!1,2, would exclude server 1 and 2, but still show the advertisement on all other servers)
    • Set the field order to any value from 0 to 255 depending on when you want the event message to be displayed. If left empty, it will use 128.
    • Set the field delay to any value you wish the messages for that certain event to be delayed for (in seconds). This delay will be added to the delay of the event.
    • Set the field type to a integer value according to the eventids. You need to add the 2 ^ eventid to this field to have the message displayed for this event.
      For example, if you have player_connect with eventid 1, player_activate with eventid 2 and player_death with eventid 3 and you want the message to be shown on player_connect and player_death events, you need to add 2^1 + 2^3 = 2 + 8 = 10 here.

    Step 3: Adding Advertisement Translations

    • Do not set the field id, it will be automatically determined
    • Set the field emid to the id of the event message
    • Set the field language to the 2 char language identifier (for example en or de). (You can look up the language identifiers used by eventscripts in addons/eventscripts/_libs/python/deflangs.ini
      If you leave this empty, it will default to en.
    • Set the field text to the string you want to show up ingame.
      You may use special variables inside of that string that will be replaced on run time:
      {CURRENTMAP} - Current map
      {TIME} - Time as set for your server
      {DATE} - Data as set for your server
      {CVAR:my_cvar} - current value of my_cvar (any cvar may be used)
      Additionally, for text area messages you can use #green #lightgreen and #default to change the colour of the messages. These tags will not show up in future messages
    • DO NOT create double entries for the same language and aid!

    Webshortcuts (added in 1.02.000)

    • Leave the field id empty. It will be automatically determined
    • Set the field command to the command to be used for the webshortcut; it can also be a comma-sperated list of commands
    • Set the field title to the title of the webpage (will be displayed ontop of the ingame browser)
    • Set the field url to the string you want to show up ingame.
      You may use special variables inside of that string that will be replaced on run time:
      {NAME} - Name of the user opening the webshortcut
      {STEAMID} - Complete Steamid of the user opening the webshortcut
      {USERID} - Current Userid of the user opening the webshortcut
      {IP} - Current IP-Address of the user opening the webshortcut
      {SERVER_IP} - Server IP Adress (as defined in the db or automatically retrieved)
      {SERVER_PORT} - Server Port (as defined in the db or automatically retrieved)
      {LANG} - Language of the user opening the webshortcut
    • Set the field servers to a comma-sperated list of ServerIDs you wish the webshortcut to be available on. You can specify -1, if you want the webshortcut on all servers. You must have a comma on the end (for example 1,2,3,).
      You can also start the entry with an exclamation mark (!). This means all following ServerIDs will be excluded (!1,2, would exclude server 1 and 2, but still show the advertisement on all other servers)

    Proceed these steps as often as necessary. Once you're done, load the script on the server again with es_load mysqlads.
    If you wish to determine the server by sid instead of ip and port, edit config.ini and set the sid accordinly (and reload the script).

Troubleshooting:

    Plugin throws up an ImportError upon trying to load it (Failed to import MySQLdb or pymysql):
    There are 2 possible reasons for this error:

    1. You don't have MySQLdb or pymysql installed (properply)
      Please reinstall the the plugin. The files have to be in the eventscripts/_engines/python/Lib/site-packages/ folder to be loaded properly.
      As for MySQLdb, simply downloading from the website will not be suffient for an installation. You need to compile the c code included within the download yourself first.
      [WINDOWS] To solve this, you can install python 2.5 (32bit) on your computer, download MySQL-python-1.2.2.win32-py2.5.exe, install it on your python installation and copy the files over from site-packages in the python directory.

    2. MySQLdb or pymysql doesn't load properly
      To further verifiy this issue, you can create a simple script in eventscripts/test/test.py. Add into the file import MySQLdb or import pymysql

    Plugin unloads itself (Server not found in database. Unloading.)
    This can have possible reasons aswell.

    1. Server IP and Port is set incorrectly (with autodection enabled - sid = -1)
      Doublecheck the settings in your database. The IP and port must exactly match the Port and IP on your Server - make sure that no whitespaces are included.

    2. Server IP is failing to be determined (with autodection enabled - sid = -1)
      This can be an issue within the script itself (since it fetches the IP from a website). This may be temporary, but if it persists, disable the autodection feature and set the sid manually

    3. Server Port is not the same like specified on launch parameters (with autodection enabled - sid = -1)
      This can happen easily if the server crashes a lot. Source sometimes tries it to run it on the next port if you have other servers running in that port range. To solve this, either set the sid manually, or make sure there is at least 5 port difference between your server ports.

    Plugin unloads itself (No advertisements found for this server. Unloading.)
    There are only few possible reasons for this issue:

    1. You forgot the trailing comma ( , ) in the sid colomn of the advertisements table
      The comma must be included or the servers (/ the last one) won't be fetched properly from the database. Doublecheck whether you are missing any trailing commas

    2. You don't have any advertisements defined for this server
      Make sure that there is an advertisement defined for this server (either explecitly, or though -1, for example.


Download:


Version Notes:

    1.02.000:
    • Option to automatically reconnect to MySQL Server incase it crashes added
    • Updater (Sub-)Script added
    • Support for MySQL Webshortcuts added
    • Support for MySQL Event based messages/advertisements added
    • Some additonal quotes upon table creation
    • Internal db structure sightly changed (Each entry has an unique id now)

    1.01.002:
    • Enforced UTF8 Connection to the MySQL Server

    1.01.001:
    • Added error incase no advertisements were loaded from the database
    • Made errors more accurate incase no matching server was found in the database

    1.01.000:
    • Support for pymysql added (untested)
    • Changed tables to be created with utf8 charset
    • Support for server exclusion (entries starting with !) added

    1.00.000:
    • Public Release

Credits:

    The following people are honoured to receive special thanks:
    • Some in #eventscripts channel (freddukes? I think) for pointing out that a certain bin() function was rather useless :P


Attachments:
File comment: MySQLdb-1.2.2-python2.5 for Windows and Linux
(MySQLdb made by adustman and kylev
MySQL by Sun)

MySQLdb-1.2.2-python2.5.zip [1.48 MiB]
Downloaded 169 times

_________________
For Users:
Any: MySQL Advertisements | Pretty Status List | Sourcemod Authentification | Health, Armor & Team Display
CS:S: Ultimate Buyscript

For Coders:
Any: Sourcemod Authentification | pubcvarlib
Empires: Empires API

If you encountered a bug with any of my addons, please contact me in the #eventscripts irc channel on irc.gamesurge.net :)
(Otherwise, it may take a while until I notice your request in the respective addon thread.)

All my scripts are maintenace only - only bugfix updates at most. I'll be switching to source-python and ports of my scripts will be available in SP

German Slaughterhouse Board


Last edited by Omega_K2 on 2010-12-04, 5:53 am, edited 21 times in total.



User avatar
Experienced
Profile

Posts: 379
Location:
Germany
 
New postPosted: 2010-09-10, 12:58 pm 

Small update released!

1.01.000:
  • Support for pymysql added (untested)
  • Changed tables to be created with utf8 charset
  • Support for server exclusion (entries starting with !) added

_________________
For Users:
Any: MySQL Advertisements | Pretty Status List | Sourcemod Authentification | Health, Armor & Team Display
CS:S: Ultimate Buyscript

For Coders:
Any: Sourcemod Authentification | pubcvarlib
Empires: Empires API

If you encountered a bug with any of my addons, please contact me in the #eventscripts irc channel on irc.gamesurge.net :)
(Otherwise, it may take a while until I notice your request in the respective addon thread.)

All my scripts are maintenace only - only bugfix updates at most. I'll be switching to source-python and ports of my scripts will be available in SP

German Slaughterhouse Board


User avatar
Experienced
Profile

Posts: 408
Location:
Portugal \O.

Steam Friends Name: snakex99
 
New postPosted: 2010-09-10, 8:25 pm 

Very nice addon, i will use it for sure =)

+w00t

_________________
Image

Image


User avatar
Experienced
Profile

Posts: 379
Location:
Germany
 
New postPosted: 2010-09-14, 3:56 pm 

Thanks for the woot :)

I've added an example database (a mysql dump actually) from my own servers, incase that makes the configuration more clear :)

_________________
For Users:
Any: MySQL Advertisements | Pretty Status List | Sourcemod Authentification | Health, Armor & Team Display
CS:S: Ultimate Buyscript

For Coders:
Any: Sourcemod Authentification | pubcvarlib
Empires: Empires API

If you encountered a bug with any of my addons, please contact me in the #eventscripts irc channel on irc.gamesurge.net :)
(Otherwise, it may take a while until I notice your request in the respective addon thread.)

All my scripts are maintenace only - only bugfix updates at most. I'll be switching to source-python and ports of my scripts will be available in SP

German Slaughterhouse Board


User avatar
Experienced
Profile

Posts: 408
Location:
Portugal \O.

Steam Friends Name: snakex99
 
New postPosted: 2010-09-14, 5:50 pm 

Thanks, i've not installed this yet, but i will in the next few days...

_________________
Image

Image


User avatar
Experienced
Profile

Posts: 408
Location:
Portugal \O.

Steam Friends Name: snakex99
 
New postPosted: 2010-09-23, 9:05 pm 

Hi dude, i need help installing MySQLdb, i extract it to the orangebox/cstrike/addons/eventscripts/_libs/python folder?

_________________
Image

Image


User avatar
Experienced
Profile

Posts: 379
Location:
Germany
 
New postPosted: 2010-09-24, 6:54 am 
   Post subject: Re:

Glazz wrote:
Hi dude, i need help installing MySQLdb, i extract it to the orangebox/cstrike/addons/eventscripts/_libs/python folder?


You need to put it into orangebox/cstrike/addons/eventscripts/_engines/python/Lib/site-packages/

I can provide the files for windows and linux if required (for mysqldb) (In case you run into some errors).

[some people prefer pymysql, since it's easier to install (doesn't need to specifically be compiled against the mysql/python version)]

_________________
For Users:
Any: MySQL Advertisements | Pretty Status List | Sourcemod Authentification | Health, Armor & Team Display
CS:S: Ultimate Buyscript

For Coders:
Any: Sourcemod Authentification | pubcvarlib
Empires: Empires API

If you encountered a bug with any of my addons, please contact me in the #eventscripts irc channel on irc.gamesurge.net :)
(Otherwise, it may take a while until I notice your request in the respective addon thread.)

All my scripts are maintenace only - only bugfix updates at most. I'll be switching to source-python and ports of my scripts will be available in SP

German Slaughterhouse Board


User avatar
Experienced
Profile

Posts: 408
Location:
Portugal \O.

Steam Friends Name: snakex99
 
New postPosted: 2010-09-24, 9:53 am 

But do i extract the files to that folder, or i extract the folder in that folder?

Files to Folder:
orangebox/cstrike/addons/eventscripts/_engines/python/Lib/site-packages/

Folder to Folder:
orangebox/cstrike/addons/eventscripts/_engines/python/Lib/site-packages/MySQLblahblah/

_________________
Image

Image


User avatar
Experienced
Profile

Posts: 379
Location:
Germany
 
New postPosted: 2010-09-24, 10:57 am 

To make this simpler, just download the attachment and place it in the root of your server dir. (MySQLdb)

(If you want to completly install it yourself, you need to compile it first manually with GCC/Visual C++, then install it on a python 2.5 dir and copy the files over to your server.)


Attachments:
MySQLdb-1.2.2-python2.5.zip [1.48 MiB]
Downloaded 141 times

_________________
For Users:
Any: MySQL Advertisements | Pretty Status List | Sourcemod Authentification | Health, Armor & Team Display
CS:S: Ultimate Buyscript

For Coders:
Any: Sourcemod Authentification | pubcvarlib
Empires: Empires API

If you encountered a bug with any of my addons, please contact me in the #eventscripts irc channel on irc.gamesurge.net :)
(Otherwise, it may take a while until I notice your request in the respective addon thread.)

All my scripts are maintenace only - only bugfix updates at most. I'll be switching to source-python and ports of my scripts will be available in SP

German Slaughterhouse Board
User avatar
Experienced
Profile

Posts: 408
Location:
Portugal \O.

Steam Friends Name: snakex99
 
New postPosted: 2010-09-24, 11:17 am 

Ok thank you :)

_________________
Image

Image


User avatar
Experienced
Profile

Posts: 408
Location:
Portugal \O.

Steam Friends Name: snakex99
 
New postPosted: 2010-09-24, 12:19 pm 
   Post subject: Re: MySQL Advertisements [V 1.01.000] [10th September 2010]

Hi again, i installed pubcvarlib and MySQLdb, configured the mysql data in the config file, i have this db schema:

advertisements:
Code:
aid  |  display  | servers  | order
1 | 1 | -1 | 10
2 | 1 | -1 | 20
3 | 1 | -1 | 30


servers:
Code:
sid | ip | port | interval   | dateformat | timeformat | random
1 | 82.102.12.113 | 27025 | 30 | %d.%m.%Y | %H:%M:%S |0


translations:
Code:
aid | lang | text
1 | en |#greenGeração Tuga #default- #lightgreenMultigaming Community
1 | pt | #greenGeração Tuga #default- #lightgreenComunidade Multigaming
2 | en | #greenCurrent Map #default- #lightgreen{CURRENTMAP}
2 | pt | #greenMapa Actual #default- #lightgreen{CURRENTMAP}
3 | en | #greenGeração Tuga #default- #lightgreenVisit us on #greenhttp...
3 | pt | #greenGeração Tuga #default- #lightgreenVisita-nos em #greenhttp...


But the ads are not showing up on the server... i have excepthook installed but it is not throwing any errors, i am sure that my db settings are correct, because i use the same for SourceBans, and it works.


Edit:
Maybe create an admin panel to add ads? I can help you with this if you want.

_________________
Image

Image


User avatar
Experienced
Profile

Posts: 379
Location:
Germany
 
New postPosted: 2010-09-24, 1:33 pm 

Have you reloaded the script?
(Is MySQLdb actually working? Not throwing up any errors?
You could try this in a seperate file,
just create test/test.py and put import MySQLdb in there, then es_load test :P)

I quickly checked gametracker and it seems the plugin is not loaded on your server (IP: 82.102.12.113:27025 - it shows pubcvarlib though).

EDIT: If you want some instant feedback join irc.gamesurge.net #gsclan.org or #eventscripts

_________________
For Users:
Any: MySQL Advertisements | Pretty Status List | Sourcemod Authentification | Health, Armor & Team Display
CS:S: Ultimate Buyscript

For Coders:
Any: Sourcemod Authentification | pubcvarlib
Empires: Empires API

If you encountered a bug with any of my addons, please contact me in the #eventscripts irc channel on irc.gamesurge.net :)
(Otherwise, it may take a while until I notice your request in the respective addon thread.)

All my scripts are maintenace only - only bugfix updates at most. I'll be switching to source-python and ports of my scripts will be available in SP

German Slaughterhouse Board


User avatar
Experienced
Profile

Posts: 408
Location:
Portugal \O.

Steam Friends Name: snakex99
 
New postPosted: 2010-09-24, 8:20 pm 

Hmm thats weird because i have it to load in autoexec.cfg

look:
es_load excepthook
es_load bfg_deathmatch
es_load ipchatfilter
es_load disconnect
//es_load country-blocker
es_load mysqlads

see? =)


I have done that test file, and it was loaded with sucess.

_________________
Image

Image


User avatar
Experienced
Profile

Posts: 408
Location:
Portugal \O.

Steam Friends Name: snakex99
 
New postPosted: 2010-09-24, 8:42 pm 

Tryed manually load the addon and this came up:



mysqlads.py: Starting database syncronisation!
mysqlads.py: Server not found in database. Unloading.
Unloading mysqlads...
[EventScripts] Loaded mysqlads
[EventScripts] Unloading mysqlads...
[EventScripts] mysqlads has been unloaded

_________________
Image

Image


User avatar
Experienced
Profile

Posts: 379
Location:
Germany
 
New postPosted: 2010-09-25, 5:04 am 
   Post subject: Re:

Glazz wrote:
Tryed manually load the addon and this came up:



mysqlads.py: Starting database syncronisation!
mysqlads.py: Server not found in database. Unloading.
Unloading mysqlads...
[EventScripts] Loaded mysqlads
[EventScripts] Unloading mysqlads...
[EventScripts] mysqlads has been unloaded


Set sid to 1 in the config file and try to load again.
(Or is it working now? It seems as if it's loaded on your server :P)

_________________
For Users:
Any: MySQL Advertisements | Pretty Status List | Sourcemod Authentification | Health, Armor & Team Display
CS:S: Ultimate Buyscript

For Coders:
Any: Sourcemod Authentification | pubcvarlib
Empires: Empires API

If you encountered a bug with any of my addons, please contact me in the #eventscripts irc channel on irc.gamesurge.net :)
(Otherwise, it may take a while until I notice your request in the respective addon thread.)

All my scripts are maintenace only - only bugfix updates at most. I'll be switching to source-python and ports of my scripts will be available in SP

German Slaughterhouse Board


User avatar
Experienced
Profile

Posts: 408
Location:
Portugal \O.

Steam Friends Name: snakex99
 
New postPosted: 2010-09-25, 9:32 am 
   Post subject: Re: MySQL Advertisements [V 1.01.000] [10th September 2010]

I set it to 1 though, but when i checked it wasn't loaded, i don't know if it is loaded now lol but i noticed this error:
PYTHON:
    Traceback (most recent call last):
      File "d:\userfiles\inverse\gameservers\tc10375428603446223262800\orangebox\cstrike\addons\eventscripts\es.py", line 276, in tick
        x()
      File "d:\userfiles\inverse\gameservers\tc10375428603446223262800\orangebox\cstrike\addons\eventscripts\_libs\python\gamethread.py", line 173, in tick
        _executenode(first)
      File "d:\userfiles\inverse\gameservers\tc10375428603446223262800\orangebox\cstrike\addons\eventscripts\_libs\python\gamethread.py", line 155, in _executenode
        function(*a, **kw)
      File "d:\userfiles\inverse\gameservers\tc10375428603446223262800\orangebox\cstrike\addons\eventscripts\mysqlads\mysqlads.py", line 229, in AdLoop
        aid = db.data['advertisements']['list'][index]
    IndexError: list index out of range
    09/25/10 02:41:51

_________________
Image

Image


User avatar
Experienced
Profile

Posts: 379
Location:
Germany
 
New postPosted: 2010-09-25, 9:38 am 

Ah I oversaw an error:
Code:
aid  |  display  | servers  | order
1 | 1 | -1 | 10
2 | 1 | -1 | 20
3 | 1 | -1 | 30

has to be
Code:
aid  |  display  | servers  | order
1 | 1 | -1, | 10
2 | 1 | -1, | 20
3 | 1 | -1, | 30


It wasn't fetching the advertisements due to that issue, that's why it later on gave that error. The trailing comma is required in any case (always set it)

_________________
For Users:
Any: MySQL Advertisements | Pretty Status List | Sourcemod Authentification | Health, Armor & Team Display
CS:S: Ultimate Buyscript

For Coders:
Any: Sourcemod Authentification | pubcvarlib
Empires: Empires API

If you encountered a bug with any of my addons, please contact me in the #eventscripts irc channel on irc.gamesurge.net :)
(Otherwise, it may take a while until I notice your request in the respective addon thread.)

All my scripts are maintenace only - only bugfix updates at most. I'll be switching to source-python and ports of my scripts will be available in SP

German Slaughterhouse Board


User avatar
Experienced
Profile

Posts: 408
Location:
Portugal \O.

Steam Friends Name: snakex99
 
New postPosted: 2010-09-25, 9:43 am 

OMG so simple xD

Edit:
It is working now yayy lool, i just have a little problem, don't know if we can solve it, i have problems with letters like 'ç ã á ó' etc...

_________________
Image

Image


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group