Splizes Posted February 21, 2010 Share Posted February 21, 2010 Well today once again I noticed something bad about bobiii and other such maps that need a scout. Our server does not have "!scout", so I wrote one in hopes that it would be implemented on the server. import es, playerlib, weaponlib, gamethread info = es.AddonInfo() info['name'] = "Scout giver" info['basename'] = "!scout" info['version'] = "1.0" info['author'] = "Splizes" info['url'] = "www.Hellsgamers.com" info['description'] = "When executed on certain maps, it will give the invoking player a scout." es.ServerVar(info['basename'], info['version'], info['description']).makepublic() def load(): global maps_allowed maps_allowed = ["mg_bobiii", "mg_bob"] def player_say(ev): global maps_allowed if ev['text'] == "!scout" or ev['text'] == "/scout": if es.server_var["eventscripts_currentmap"] in maps_allowed: user = int(ev['userid']) Player = playerlib.getPlayer(user) if Player.getSecondary(): secondary = Player.getSecondary() else: secondary = 0 es.server.cmd('es_xfire %s player_weaponstrip kill' % user) es.server.cmd('es_xgive %s player_weaponstrip' % user) es.server.cmd('es_xfire %s player_weaponstrip strip' % user) if (secondary != 0): gamethread.delayed(0.1, es.server.queuecmd, 'es_xgive %s %s' %(user, secondary)) gamethread.delayed(0.1, es.server.queuecmd, 'es_xgive %s weapon_knife' % user) gamethread.delayed(0.1, es.server.queuecmd, 'es_xgive %s weapon_scout' % user) givescout.zip Quote Link to comment Share on other sites More sharing options...
Gracefail<3 Posted February 21, 2010 Share Posted February 21, 2010 What about maps like Velocity? People would exploit the command.. >_< Quote Link to comment Share on other sites More sharing options...
Splizes Posted February 21, 2010 Author Share Posted February 21, 2010 What about maps like Velocity? People would exploit the command.. >_< maps_allowed = ["mg_bobiii", "mg_bob"] Quote Link to comment Share on other sites More sharing options...
Koragan Posted February 21, 2010 Share Posted February 21, 2010 sounds good. Cool Script Bro Quote Link to comment Share on other sites More sharing options...
Apt. 2B Posted February 21, 2010 Share Posted February 21, 2010 hey wait - we dont have bob2n00b on the server :c this r travesty Quote Link to comment Share on other sites More sharing options...
I AM Your Reason Posted February 22, 2010 Share Posted February 22, 2010 maps_allowed = ["mg_bobiii", "mg_bob"] That was the first thing I looked for in the script, nice. Support. Quote Link to comment Share on other sites More sharing options...
Splizes Posted February 22, 2010 Author Share Posted February 22, 2010 I'll rewrite this in sourcemod either later tonight or tomorow (I am in the process of reformatting at the moment) Quote Link to comment Share on other sites More sharing options...
Cr(+)sshair Posted February 22, 2010 Share Posted February 22, 2010 (edited) #include <sourcemod> #include <sdktools> #define PLUGIN_VERSION "1.3.3.7" new Handle:cvarOn = INVALID_HANDLE; new Handle:cvarHowMany = INVALID_HANDLE; new scouts[MAXPLAYERS+1]; public Plugin:myinfo = { name = "Cr(+)sshair's [!scout]", author = "Cr(+)sshair", description = "Type !scout to get one!", version = PLUGIN_VERSION, url = "http://www.hellsgamers.com/" }; public OnPluginStart(){ RegConsoleCmd("say", Command_Say); cvarOn = CreateConVar("sm_scout", "0", "Turn me on baybay!", FCVAR_PLUGIN, true, 0.0, true, 1.0); cvarHowMany = CreateConVar("sm_howmany", "5", "How many scouts per map?" , FCVAR_PLUGIN, true, 0.0, true, 10.0); } public OnClientPostAdminCheck(client){ if (GetConVarInt(cvarOn)){ scouts[client] = 0; } } public Action:Command_Say(client, args){ new String:text[192]; GetCmdArgString(text, sizeof(text)); new startidx = 0; if(text[strlen(text)-1] == '"'){ text[strlen(text)-1] = '\0'; startidx = 1; } if (IsPlayerAlive(client)){ if (StrEqual(text[startidx], "!scout")) Scout(client); return Plugin_Continue; } public Action:Scout(client){ if (scouts[client] < GetConVarInt(cvarHowMany)){ GivePlayerItem(client, "weapon_scout"); scouts[client] ++; PrintToChat(client,"Bob gives you a scout!"); } else PrintToChat(client,"Bob doesn't like scouts anymore. =("); } Then put sm_scout "1" in the different map.cfg's you want it loaded on. Also limits how many scouts can be received per map! =) Edited February 22, 2010 by Cr(+)sshair Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.