SA-MP Forums Archive
[HELP] code for if player online - 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: [HELP] code for if player online (/showthread.php?tid=471857)



[HELP] code for if player online - Luca12 - 25.10.2013

I have some offcommands and when I type some of that command I want if then a player online then it print me somme message that can't check if the player online if you know what I mean. Thanks


Re: [HELP] code for if player online - PrivatioBoni - 25.10.2013

Use the IsPlayerConnected native function. Since you're looking for when they're NOT connected, it would be !IsPlayerConnected.

e.g.
pawn Код:
if(!IsPlayerConnected(playerid))
If you need more help, please reply back.


Re: [HELP] code for if player online - gotwarzone - 25.10.2013

Quote:
Originally Posted by Luca12
Посмотреть сообщение
I have some offcommands and when I type some of that command I want if then a player online then it print me somme message that can't check if the player online if you know what I mean. Thanks
Код:
new pID; //or change pID to what you are using
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, white, "Invalid PlayerID or the PlayerID is not online");