Return after OnPlayerUpdate - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Return after OnPlayerUpdate (
/showthread.php?tid=506370)
Return after OnPlayerUpdate -
audriuxxx - 12.04.2014
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; ?
Re: Return after OnPlayerUpdate -
Konstantinos - 12.04.2014
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.
Re: Return after OnPlayerUpdate -
audriuxxx - 12.04.2014
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.
Re: Return after OnPlayerUpdate -
Jefff - 13.04.2014
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;
}