Code:
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo =
{
name = "Zeus for Custom1",
description = "Zeus for Custom1",
author = "Ervin",
version = "1.0.0",
url = "www.magyarhns.hu"
};
public void OnPluginStart()
{
HookEvent("player_spawn", Event_PlayerSpawn, EventHookMode_Post);
}
public void Event_PlayerSpawn(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
int userid = hEvent.GetInt("userid");
if (IsClientInGame(GetClientOfUserId(userid)))
{
CreateTimer(0.3, Timer_Delay, userid, TIMER_FLAG_NO_MAPCHANGE);
}
}
public Action Timer_Delay(Handle hTimer, int userid)
{
int client = GetClientOfUserId(userid);
if(IsClientInGame(client) && CheckCommandAccess(client, "faszarc", ADMFLAG_CUSTOM1))
{
switch (GetClientTeam(client))
{
case 2:
{
GivePlayerItem(client, "weapon_taser");
}
case 3:
{
GivePlayerItem(client, "weapon_taser");
}
}
}
}