Is it possible to...
#3

Quote:
Originally Posted by mastermax7777
Посмотреть сообщение
yes
pawn Код:
new playersdm=0;

command:dm ( playerid, params[])
{
    playersdm++;
   if(playersdm>9) SetPlayerVirtualWorld(playerid, 69);
   //do other stuff here(teleport/etc..)
   return 1;
}
command: exitdm() {
playersdm--;
SetPlayerVirtualWorld(playerid, 0);
}
Whats wrong with this is that what if the player doesnt type /exitdm, what if he just disconnects, the server will think that there is still a player in the DM stadium.

Also your just setting the world to 69, what if he has around 30 players online, all do /dm. the first 9 will get to world 0 but the rest 21 will go to world 69.



pawn Код:
new playersdm=0;
new DM[MAX_PLAYERS];
command:dm ( playerid, params[])
{
    playersdm++;
    DM[playerid] = 1;
   if(playersdm>9) SetPlayerVirtualWorld(playerid, 69); DM[playerid] = 1;
   //do other stuff here(teleport/etc..)
   return 1;
}
command: exitdm() {
playersdm--;
DM[playerid] = 0;
SetPlayerVirtualWorld(playerid, 0);
}
OnPlayerDisconnect
{
   if(DM[playerid] == 1) playersdm--;
}
OnPlayerDeath
{
    if(DM[playerid] == 1) playersdm--;
}
Reply


Messages In This Thread
Is it possible to... - by Rufio - 17.03.2013, 23:07
Re: Is it possible to... - by mastermax7777 - 17.03.2013, 23:21
Re: Is it possible to... - by kamzaf - 17.03.2013, 23:23
Re: Is it possible to... - by Rufio - 17.03.2013, 23:27
Re: Is it possible to... - by mastermax7777 - 18.03.2013, 03:22

Forum Jump:


Users browsing this thread: 3 Guest(s)