SA-MP Forums Archive
some question - 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: some question (/showthread.php?tid=635335)



some question - asri - 05.06.2017

1. if player has god mode.player cant die when other player shoot but admin can shoot the player in god mode. it imposible?

2.if admin log in.the admin name mesaage show when he type exp .asri admin: jello all people..

3.how to make limit player in room exp.the room has 5 player limit and the 6 player cannot enter because full.


Re: some question - Toroi - 05.06.2017

1. It is possible.

2. You'll need to save the admin message with the saving system you're using.

3. Have a global variable and modify it as people joins/leaves the room.


Re: some question - saffierr - 05.06.2017

Check if the shooter is an admin or not and decrease its health if true.


Re: some question - asri - 07.06.2017

can you teach me about limit player in room


Re: some question - saffierr - 07.06.2017

Check the virtualworld + interior of the room and create a new variable.
Whenever someone enters the room increase the variable by 1, and decrease when someone leaves the room.
If the variable counts 5 ppl put a limit.
Try to script that.


Re: some question - coool - 07.06.2017

Quote:
Originally Posted by asri
Посмотреть сообщение
can you teach me about limit player in room
PHP код:
new totalplayers//This will hold the amount of players in room.
CMD:enterroom(playeridparams[]) //Or whatever command is.
{
    if(
totalplayers == 5//Check if the var "totalplayers" has a value of 5.
        
return scm(playerid, -1"limit reached"); //if yes return and send a msg.
    
totalplayers++; //increase the variable.
    
return 1;
}
CMD:exitroom(playeridparams[])
{
    
totalplayers--; //decrease the variable that holds amount of players in room.
    
return 1;




Re: some question - asri - 07.06.2017

the variables must in command or in onplayerspawn


Re: some question - saffierr - 07.06.2017

Somewhere outside any callback, preferred to be at the top of the script.


Re: some question - asri - 07.06.2017

no i mean this script

PHP код:
if(totalplayers == 5
must in command or in onplayerspawn


Re: some question - saffierr - 07.06.2017

Depends on how the player enters the room