SA-MP Forums Archive
[HELP] Only one player can enter? - 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] Only one player can enter? (/showthread.php?tid=635217)



[HELP] Only one player can enter? - Charly123 - 03.06.2017

How to make that only one player or 10 players can enter interior.. For example if one player types /enter, for other players that try to enter the same location will send message: Someone already entered that interior!


Re: [HELP] Only one player can enter? - Fairuz - 03.06.2017

https://sampwiki.blast.hk/wiki/OnPlayerInteriorChange


Re: [HELP] Only one player can enter? - Whatname - 03.06.2017

PHP код:

new bool:in;
CMD:enter(playeridparams[])
{
     if(
in) return SendClientMessage(playerid, -1"Someone in.");
     else
     {
          
in true;
          
//code for interior
     
}
     return 
1;
}
CMD:exit(playeridparams[])
{
     
in false;
     
//code for exit
     
return 1;




Re: [HELP] Only one player can enter? - Abagail - 03.06.2017

Quote:
Originally Posted by Whatname
Посмотреть сообщение
PHP код:

new bool:in;
CMD:enter(playeridparams[])
{
     if(
in) return SendClientMessage(playerid, -1"Someone in.");
     else
     {
          
in true;
          
//code for interior
     
}
     return 
1;
}
CMD:exit(playeridparams[])
{
          
in false;
          
//code for exit
     
}
     return 
1;

This approach I guarantee will bug, it's not something you should use. Are you trying to make this for a static entrance point or as a dynamic system? There's different approaches for both.


Re: [HELP] Only one player can enter? - Whatname - 03.06.2017

i know that will bug if player exit from the interior door i just gave an example