Hy all.
I need your help to solve my problem. First excuse my english syntax, I'm french.
I have a bug, I use for{ in my script 3 or 4 times, and after the for(...){...} nothing appens. I tryed a search but I found nothing.
This is a code example :
PHP Code:
public Event_Player_Spawn(Handle:event, const String:name[], bool:dontBroadcast){
new client = GetClientOfUserId(GetEventInt(event, "userid"));
n_CountPlayer();
//PrintToChat do not appen
PrintToChat(client, "Nombre de joueurs : %i", n_playerCount);
}
PHP Code:
n_PlayerCount(){
n_playerCount = 0;
for(new i = 1; i <= n_playerMax; i++)
{
if(IsClientConnected(i) && IsClientInGame(i) && !IsFakeClient(i))
{
n_playerCount++;
}
}
}
n_CountPlayer works perfect, and I must count them at player spawn, if I want execute code after the counting in a round_start event ! :/
Thx for your help !