Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

Minigames !scout


Splizes
 Share

Recommended Posts

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

Link to comment
Share on other sites

#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 by Cr(+)sshair
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share