How To Stay In OnPlayerConnect?
#1

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 ?
Reply
#2

Just add them OnPlayerRequestClass and return 0.
Reply
#3

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

Well once they connect OnPlayerConnect will only be called once.
Reply
#5

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

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
Reply
#7

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.
Reply
#8

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

Reply
#9

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
Reply
#10

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)