SA-MP Forums Archive
How To Stay In OnPlayerConnect? - 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: How To Stay In OnPlayerConnect? (/showthread.php?tid=575820)



How To Stay In OnPlayerConnect? - amirab - 30.05.2015

title says everything
i need to stay in OnPlayerConnect
because i have some textdraws which are selectable and i want player to not go on OnPlayerRequestClass
untill he /she selects
any idea ?


Re: How To Stay In OnPlayerConnect? - J0sh... - 30.05.2015

Just add them OnPlayerRequestClass and return 0.


Re: How To Stay In OnPlayerConnect? - amirab - 30.05.2015

um actually i need to keep them in OnPlayerConnect
i know other ways


Re: How To Stay In OnPlayerConnect? - J0sh... - 30.05.2015

Well once they connect OnPlayerConnect will only be called once.


Re: How To Stay In OnPlayerConnect? - amirab - 30.05.2015

but there IS a way because i saw in some servers
anyone help ?


Re: How To Stay In OnPlayerConnect? - mohsen9010 - 28.06.2015

PHP код:
public OnPlayerConnect(playerid)
{
  while (
1)
  {
     
//conditional code
     //don't forgot break it when your are done
  
}


http://www.tutorialspoint.com/cprogr...while_loop.htm


Re: How To Stay In OnPlayerConnect? - Sergei - 28.06.2015

Quote:
Originally Posted by mohsen9010
Посмотреть сообщение
PHP код:
public OnPlayerConnect(playerid)
{
  while (
1)
  {
     
//conditional code
     //don't forgot break it when your are done
  
}


http://www.tutorialspoint.com/cprogr...while_loop.htm
This will hang up your server until the loop is broken.


Re: How To Stay In OnPlayerConnect? - mohsen9010 - 28.06.2015

Quote:
Originally Posted by Sergei
Посмотреть сообщение
This will hang up your server until the loop is broken.
Interested !
So he can use this one :




Re: How To Stay In OnPlayerConnect? - Evocator - 28.06.2015

You're good at paint people.

Anyway, they dont keep you under OnPlayerConnect. They toggle your spectate mode so you don't even relize that you called OnPlayerRequestClass but in fact you did.
Here is a little trick (thanks to Emmet_): https://sampforum.blast.hk/showthread.php?tid=574072


Re: How To Stay In OnPlayerConnect? - kyriakos587 - 29.06.2015

if you want to stay to OnPlayerConnect you have to add TogglePlayerSpectating(playerid, true);

ex public OnPlayerConnect(playerid)
{
TogglePlayerSpectating(playerid, true);
return 1;
}

after you finish with the textdraw go to the line the you add TextDrawHideForPlayer... and add under TogglePlayerSpectating(playerid, false);