Is it possible to...
#1

Hey guys,

I started to script a all-in-one gamemode for SAMP. I am thinking of a system but couldnt decide if it's possible though. My system is:

For example, there is a command for DM 1 Area, whenever a guy types /dm1, he reaches to that DM area, i thought it would be a disaster to do a DM in too crowded place. Is it possible to make it like room ? To be more clear, when 10 person goes in DM1, the other guys who type /dm1 will be teleported too but their Virtual World will be changed to not see the other guys. Is it possible ?
Reply
#2

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);
}
Reply
#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
#4

No problem there, i have typed inDM[playerid] = 0; to onplayerconnect thanks for helping me i will try to use it ^^
Reply
#5

lol that was just a template.. im not going to script a whole perfect gm just for your approval
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)