/dm 1/ command / zone is Occupied
#1

Need some help with this. So lets say someone used /dm1 then if another person wants to use /dm1 it says to them: /dm1 is in use please use /dm 2.
Reply
#2

Without the code we cannot help you... Show us the /dm1 and /dm2 commands.
Reply
#3

well its not really /dm

here it is

Код:
CMD:degaltraining3(playerid, params[])
{
  SetPlayerVirtualWorld(playerid, 71);
  TrainingObject[playerid] =CreatePlayerObject(playerid,1211,1433.4250,1345.5702,10.8130, 0.00000, 0.00000, 90.00000);
  SendClientMessage(playerid, -1 , " {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
  SendClientMessage(playerid, -1 , " {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
  SendClientMessage(playerid, -1 , " {ff9900}V1 Aim Training System. By Beasthian.{ffffff} Enjoy the Aim Training System! The system is to have future updates, stay tuned.");
  SendClientMessage(playerid, -1 , " Please use /degaltraining or /degaltraining2 if this zone is in use!");
  ResetPlayerWeapons(playerid);
  GameTextForPlayer(playerid, "~w~ Begin~r~!", 5000, 6);
  GivePlayerWeapon(playerid, 24, 1000);
  SetPlayerPos(playerid, 1433.5638,1328.6313,10.8203);  SetPlayerFacingAngle(playerid,357.6768);
  new name[MAX_PLAYER_NAME],str[128];
  GetPlayerName(playerid,name,sizeof(name));
  format(str,sizeof(str),"{00ff00}%s {ffffff}has joined degal training area. [/degaltraining3] | Zone [3]",name);
  SendClientMessageToAll(-1,str);

  return 1;

}

CMD:degaltraining2(playerid, params[])
{
  SetPlayerVirtualWorld(playerid, 71);
  TrainingObject[playerid] =CreatePlayerObject(playerid,1211,1433.4250,1345.5702,10.8130, 0.00000, 0.00000, 90.00000);
  SendClientMessage(playerid, -1 , " {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
  SendClientMessage(playerid, -1 , " {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
  SendClientMessage(playerid, -1 , " {ff9900}V1 Aim Training System. By Beasthian.{ffffff} Enjoy the Aim Training System! The system is to have future updates, stay tuned.");
  SendClientMessage(playerid, -1 , " Please use /degaltraining or /degaltraining2 if this zone is in use!");
  ResetPlayerWeapons(playerid);
  GameTextForPlayer(playerid, "~w~ Begin~r~!", 5000, 6);
  GivePlayerWeapon(playerid, 24, 1000);
  SetPlayerPos(playerid, 1433.5638,1328.6313,10.8203);  SetPlayerFacingAngle(playerid,357.6768);
  new name[MAX_PLAYER_NAME],str[128];
  GetPlayerName(playerid,name,sizeof(name));
  format(str,sizeof(str),"{00ff00}%s {ffffff}has joined degal training area. [/degaltraining3] | Zone [3]",name);
  SendClientMessageToAll(-1,str);

  return 1;

}
Reply
#4

I don't know which variable you use but make sure you use it with [MAX_PLAYERS] so it's not a global variable.
Reply
#5

How would i put it in the script? if there is 1 player in /degaltraining it should send an error message saying " /degaltraining is in use".
Reply
#6

PHP код:
new dm1dm2dm3;
CMD:degaltraining3(playeridparams[])
{
  
SetPlayerVirtualWorld(playerid71);
  
TrainingObject[playerid] =CreatePlayerObject(playerid,1211,1433.4250,1345.5702,10.81300.000000.0000090.00000);
  
SendClientMessage(playerid, -" {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
  
SendClientMessage(playerid, -" {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
  
SendClientMessage(playerid, -" {ff9900}V1 Aim Training System. By Beasthian.{ffffff} Enjoy the Aim Training System! The system is to have future updates, stay tuned.");
  if(
dm3 == 1SendClientMessage(playerid, -" This zone is already in use, Please use /degaltraining or /degaltraining2");
  
ResetPlayerWeapons(playerid);
  
GameTextForPlayer(playerid"~w~ Begin~r~!"50006);
  
GivePlayerWeapon(playerid241000);
  
SetPlayerPos(playerid1433.5638,1328.6313,10.8203);  SetPlayerFacingAngle(playerid,357.6768);
  new 
name[MAX_PLAYER_NAME],str[128];
  
GetPlayerName(playerid,name,sizeof(name));
  
format(str,sizeof(str),"{00ff00}%s {ffffff}has joined degal training area. [/degaltraining3] | Zone [3]",name);
  
SendClientMessageToAll(-1,str);
  
dm3 1;
  return 
1;
}
CMD:degaltraining2(playeridparams[])
{
  
SetPlayerVirtualWorld(playerid71);
  
TrainingObject[playerid] =CreatePlayerObject(playerid,1211,1433.4250,1345.5702,10.81300.000000.0000090.00000);
  
SendClientMessage(playerid, -" {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
  
SendClientMessage(playerid, -" {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
  
SendClientMessage(playerid, -" {ff9900}V1 Aim Training System. By Beasthian.{ffffff} Enjoy the Aim Training System! The system is to have future updates, stay tuned.");
  if(
dm2 == 1SendClientMessage(playerid, -" This zone is already in use, Please use /degaltraining or /degaltraining3");
  
ResetPlayerWeapons(playerid);
  
GameTextForPlayer(playerid"~w~ Begin~r~!"50006);
  
GivePlayerWeapon(playerid241000);
  
SetPlayerPos(playerid1433.5638,1328.6313,10.8203);  SetPlayerFacingAngle(playerid,357.6768);
  new 
name[MAX_PLAYER_NAME],str[128];
  
GetPlayerName(playerid,name,sizeof(name));
  
format(str,sizeof(str),"{00ff00}%s {ffffff}has joined degal training area. [/degaltraining3] | Zone [3]",name);
  
SendClientMessageToAll(-1,str);
  
dm2 1;
  return 
1;

Reply
#7

umm. didn't work another player could still come to the same /degaltraining.
Reply
#8

Hi!

I think this is that what you want.
PHP код:
//global:
new bool:DM2,bool:DM3,playerArena[MAX_PLAYERS];
//when the player leave the arena:
if(playerArena[playerid] == 3)DM3 false;
else if(
playerArena[playerid] == 2)DM2 false;
CMD:degaltraining3(playeridparams[])
{
    if(
DM3 == true)return SendClientMessage(playerid,-1,"/degaltraining3 is in use.");
    
SetPlayerVirtualWorld(playerid71);
     
TrainingObject[playerid] =CreatePlayerObject(playerid,1211,1433.4250,1345.5702,10.81300.000000.0000090.00000);
     
SendClientMessage(playerid, -" {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
     
SendClientMessage(playerid, -" {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
     
SendClientMessage(playerid, -" {ff9900}V1 Aim Training System. By Beasthian.{ffffff} Enjoy the Aim Training System! The system is to have future updates, stay tuned.");
     
SendClientMessage(playerid, -" Please use /degaltraining or /degaltraining2 if this zone is in use!");
     
ResetPlayerWeapons(playerid);
     
GameTextForPlayer(playerid"~w~ Begin~r~!"50006);
     
GivePlayerWeapon(playerid241000);
     
SetPlayerPos(playerid1433.5638,1328.6313,10.8203);  SetPlayerFacingAngle(playerid,357.6768);
     new 
name[MAX_PLAYER_NAME],str[128];
     
GetPlayerName(playerid,name,sizeof(name));
     
format(str,sizeof(str),"{00ff00}%s {ffffff}has joined degal training area. [/degaltraining3] | Zone [3]",name);
     
SendClientMessageToAll(-1,str);
     
DM3 true;
    
playerArena[playerid] = 3;
     return 
1;
}
CMD:degaltraining2(playeridparams[])
{
    if(
DM2 == true)return SendClientMessage(playerid,-1,"/degaltraining2 is in use.");
    
SetPlayerVirtualWorld(playerid71);
     
TrainingObject[playerid] =CreatePlayerObject(playerid,1211,1433.4250,1345.5702,10.81300.000000.0000090.00000);
     
SendClientMessage(playerid, -" {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
     
SendClientMessage(playerid, -" {ff0000}WARNING: {ffffff}You MUST use {e60000}/leavetraining {ffffff}to exit the zone. Or els you will be bugged!");
     
SendClientMessage(playerid, -" {ff9900}V1 Aim Training System. By Beasthian.{ffffff} Enjoy the Aim Training System! The system is to have future updates, stay tuned.");
     
SendClientMessage(playerid, -" Please use /degaltraining or /degaltraining2 if this zone is in use!");
     
ResetPlayerWeapons(playerid);
      
GameTextForPlayer(playerid"~w~ Begin~r~!"50006);
      
GivePlayerWeapon(playerid241000);
      
SetPlayerPos(playerid1433.5638,1328.6313,10.8203);  SetPlayerFacingAngle(playerid,357.6768);
      new 
name[MAX_PLAYER_NAME],str[128];
      
GetPlayerName(playerid,name,sizeof(name));
      
format(str,sizeof(str),"{00ff00}%s {ffffff}has joined degal training area. [/degaltraining3] | Zone [3]",name);
      
SendClientMessageToAll(-1,str);
      
DM2 true;
      
playerArena[playerid] = 2;
      return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)