OnPlayerSpawn callback
#2

._. do a variable check that checks true onplayerspawn and false onplayerdisconnect? ex:
PHP код:
new bool:OneMessage[MAX_PLAYERS];
public 
OnPlayerSpawn(playerid)
{
    if(!
OneMessage[playerid])//checking if it was never set before
    
{
        
SendClientMessage(playerid, -1"Hi one message here");//sending the message
        
OneMessage[playerid] = true;//checking true to make it get called once
        
}
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
OneMessage[playerid] = false;// resetting it for the next player connecting with that id.
    
return 1;

Reply


Messages In This Thread
OnPlayerSpawn callback - by wallen - 27.01.2018, 14:11
Re: OnPlayerSpawn callback - by RogueDrifter - 27.01.2018, 14:14
Re: OnPlayerSpawn callback - by Inn0cent - 27.01.2018, 14:15

Forum Jump:


Users browsing this thread: 1 Guest(s)