Hey Guys and Girls,
Im trying to hook a CSGO event ("weapon_fire"), to slap or kill a person with a unique steamID instantly on shooting any gun.
PHP Code:
public OnPluginStart()
{
HookEvent("weapon_fire", Event_AidenWillDie);
}
public void Event_AidenWillDie(Handle:event, const String:name[],bool:dontBroadcast)
{
new String:aidenSteamID[64];
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
GetClientAuthId(victim, AuthId_Steam2, aidenSteamID, sizeof(aidenSteamID));
if (aidenSteamID[victim] == "STEAM_1:1:165530312")
{
SlapPlayer(victim, 99, true);
}
}
Just wondering where i am going wrong with it,
Im getting error 033: Array must be indexed (variable "-unknown-") - (If(aidenSteamID) Line
error 035: argument type mismatched (argument 1) - (SlapPlayer line)
PS: This is for educational purposes only!
Kind Regards
SkinnyBruv
EDIT:
Hi Guys fixed
please see below
PHP Code:
public void Event_AidenWillDie(Handle:event, const String:name[],bool:dontBroadcast)
{
new String:aidenSteamID[64];
new victim = GetClientOfUserId(GetEventInt(event, "userid"));
GetClientAuthId(victim, AuthId_Steam2, aidenSteamID, sizeof(aidenSteamID));
if (StrEqual (aidenSteamID, "STEAM_1:1:165530312"))
{
SlapPlayer(victim, 100, true);
}
}
__________________