i have problem
PHP Code:
#include <sourcemod>
#include <sdktools>
public Plugin:myinfo =
{
name = "New Plugin",
author = "Unknown",
description = "<- Description ->",
version = "1.0",
url = "<- URL ->"
}
//weapons
#define Pistol "weapon_pistol"
#define Rpg "weapon_rpg"
#define Crowbar "weapon_crowbar"
#define Crossbow "weapon_crossbow"
#define Shotgun "weapon_shotgun"
#define Smg "weapon_smg"
new player[128];
new String:weapons[6][] = {Pistol, Rpg, Crowbar, Crossbow, Shotgun, Smg};
public OnPluginStart()
{
HookEvent("player_death",Event_player_death)
HookEvent("player_spawn",Event_player_spawn)
HookEvent("item_pickup",Event_item_pickup)
}
public Event_player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
new client_attacker = GetEventInt(event, "attacker");
decl String:client_attacker_weapon[60];
GetEventString(event,"weapon",client_attacker_weapon,60);
PrintToChatAll(client_attacker_weapon);
if(strcmp(client_attacker_weapon,weapons[player[client_attacker]],true)==0)
{
player[client_attacker]++;
GivePlayerItem(GetClientOfUserId(client_attacker),weapons[player[client_attacker]],0);
PrintToChatAll(player[client_attacker]);
}
}
public Event_item_pickup(Handle:event, const String:name[], bool:dontBroadcast)
{
new client= GetEventInt(event, "userid");
new String:client_weapon[60];
GetEventString(event,"item",client_weapon,60);
if(strcmp(client_weapon,weapons[player[client]],true)!=0)
{ RemovePlayerItem(GetClientOfUserId(client),FindEntityByClassname(-1,client_weapon));
}
}
public Event_player_spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client_id = GetEventInt(event, "userid");
new client=GetClientOfUserId(client_id);
GivePlayerItem(client,weapons[player[client_id]],0);
}
public bool:OnClientConnect(client, String:rejectmsg[], maxlen)
{
player[GetClientUserId(client)]=0;
}
i wrote this plugin its gungame plugin and its just wont work its compiled fine but when its used in the game it takes no effect at all