Hi guys,
Need help on solving this puzzle, have this code:
Code:
public void Event_OnPlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if(!client)
return;
if(botClientId == client && IsClientInGame(client) && IsPlayerAlive(client) && IsFakeClient(client) && GetClientTeam(client) >= CS_TEAM_T)
{
Client_RemoveAllWeapons(client);//works
TeleportEnity(.....); //works
EquipPlayerWeapon(client, CSWeapon_AK47);//exception Client X is not in game.
}
}
Getting exception on EquipPlayerWeapon(client, CSWeapon_AK47) or SetEntityProp(client,..).. Exception reported: Client X is not in game.
While Client_RemoveAllWeapons(client) works, TeleportEntity works, setting client model works, have no idea...