Return after OnPlayerUpdate
#1

Hi,

Код:
public OnPlayerUpdate( playerid )
{
IsPlayer(playerid);
return 1;
}
Код:
stock IsPlayer(playerid)
{
if( playerid == 0)
{
return 1;
}
return 0;
}
I mean, if playerid not will be 0, other vise stock IsPlayer will return 0, and then onplayerupdate, for him return 0; ?
Reply
#2

I find that useless but since you ask for it:
pawn Код:
public OnPlayerUpdate(playerid)
{
    return (!playerid);
}
Returns 1 if the playerid is 0 and it returns 0 if the playerid is not 0.
Reply
#3

I just give it like example.. I have more, functions in onplayerupdate, just i want to ask, when i return in stock return 0; then not data will be sending? because i know if you end onplayerupdate with return 0, then there is no sending data.
Reply
#4

You must use this stock on this way

pawn Код:
stock IsPlayer(playerid)
{
    if(playerid == 0)
    {
        return 1;
    }
    return 0;
}

public OnPlayerUpdate( playerid )
{
    if(!IsPlayer(playerid)) // playerid is not 0
    {
        // stop sending
        return 0;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)