IsPlayerConnected check - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IsPlayerConnected check (
/showthread.php?tid=96596)
IsPlayerConnected check -
Coicatak - 09.09.2009
Question 1:
You can see this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/randomcommand", true))
{
if(IsPlayerConnected(playerid))
{
//Code
}
return 1;
}
return 0;
}
in the most of gamemodes, but isn't it useless as a player who is not connected can't write a command?
Edit: Answer is yes, it is useless.
Question 2:
Which native functions include IsPlayerConnected check? I know Kick and Ban does but which others?
Re: IsPlayerConnected check under OnPlayerCommandText -
woot - 09.09.2009
Indeed, it's most likely used by Godfather, or people who just copypaste godfather commands.
You clearly can leave away.
Re: IsPlayerConnected check under OnPlayerCommandText -
Coicatak - 09.09.2009
Ok thanks, I just wanted to be sure. Godfather is really bad to learn scripting...
Re: IsPlayerConnected check under OnPlayerCommandText -
Coicatak - 09.09.2009
Ok thanks. One more question, do you know which native functions include IsPlayerConnected check? I know Kick and Ban does but which others?
Re: IsPlayerConnected check -
Coicatak - 09.09.2009
Ok thanks. I've already read your code optimisation topic and I use it.