DM zone help???
#1

Hello
I made this map /minigun when people go there it gives them a minigun,but when they go to another teleport e.x /lva
they still got the minigun how can I make the minigunavailable only on /minigun please respond!!!

I use zcmd and thats my teleport command


COMMAND:lol(playerid, params[])
{
SetPlayerPos(playerid, 1457.7526,-1062.9589,213.382;
SendClientMessage(playerid, COLOR_RED , "gamhthite!");


GivePlayerWeapon(playerid, 10, 9999);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerInterior(playerid, 0);
S
SendClientMessage(playerid, COLOR_PURPLE, "phges sto -lol-");

return 1;
}
Reply
#2

Код:
new indm;

indm = 0;



if(strcmp(cmdtext, "/minigun", true)==0)
{
  if(indm == 0)
  {
    indm = 1;
    give guns 'n shit
    SendClientMessage(playerid, 0xFF0000AA, "you entered to minigun");
  }
  else
  {
    SendClientMessage(playerid, 0xFF0000AA, "you already are in minigun");
  }
  return 1;
}

if(strcmp(cmdtext, "/exit", true)==0)
{
  if(indm == 1)
  {
    indm = 0;
    ResetPlayerWeapons(playerid);
    SendClientMessage(playerid, 0xFF0000AA, "you left from minigun");
    SpawnPlayer(playerid);
  }
  else
  {
    SendClientMessage(playerid, 0xFF0000AA, "you are not in minigun");
  }
  return 1;
}

and all teleports

if(strcmp(cmdtext, "/lva", true)==0)
{
  if(indm == 0)
  {
    setplayerpos
  }
  else
  {
    SendClientMessage(playerid, 0xFF0000AA, "you cant teleport because you are in dm");
  }
  return 1;
}
sorry for my bad english.
Reply
#3

thank you very much but can you explain me how to place it on my mode?? cause i am a begginer!!
Reply
#4

Make a variable :
pawn Код:
new HasMinigun[MAX_PLAYERS];
when the player uses the command set the variable to 1:
pawn Код:
COMMAND:lol(playerid, params[])
{
HasMinigun[playerid] = 1;
SetPlayerPos(playerid, 1457.7526,-1062.9589,213.382;
SendClientMessage(playerid, COLOR_RED , "gamhthite!");
GivePlayerWeapon(playerid, 10, 9999);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_PURPLE, "phges sto -lol-");
return 1;
}
And on the other teleport cmds do this :
pawn Код:
if(HasMinigun[playerid] == 1)
{
ResetPlayerWeapons(playerid);
HasMinigun[playerid] = 0;
}
and under ResetPlayerWeapons add the GivePlayerWeapon as u want
Reply
#5

marinov man you rock thank you so much tha helped a lot!!!


but what it does is that it does not allow players to have any weapon when they go there .I asked if you could help me make a script when they go there they have a weapong but when they leave they do not pls help

sorry for my bad english
Reply
#6

so wonderful information.
Reply
#7

Quote:
Originally Posted by marinov
Посмотреть сообщение
Make a variable :
pawn Код:
new HasMinigun[MAX_PLAYERS];
when the player uses the command set the variable to 1:
pawn Код:
COMMAND:lol(playerid, params[])
{
HasMinigun[playerid] = 1;
SetPlayerPos(playerid, 1457.7526,-1062.9589,213.382;
SendClientMessage(playerid, COLOR_RED , "gamhthite!");
GivePlayerWeapon(playerid, 10, 9999);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_PURPLE, "phges sto -lol-");
return 1;
}
And on the other teleport cmds do this :
pawn Код:
if(HasMinigun[playerid] == 1)
{
ResetPlayerWeapons(playerid);
HasMinigun[playerid] = 0;
}
and under ResetPlayerWeapons add the GivePlayerWeapon as u want
I would suggest a boolean

pawn Код:
new bool:HasMinigun[MAX_PLAYERS];
pawn Код:
COMMAND:lol(playerid, params[])
{
    HasMinigun[playerid] = true;
    SetPlayerPos(playerid, 1457.7526,-1062.9589,213.382;
    SendClientMessage(playerid, COLOR_RED , "gamhthite!");
    GivePlayerWeapon(playerid, 10, 9999);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    SetPlayerInterior(playerid, 0);
    SendClientMessage(playerid, COLOR_PURPLE, "phges sto -lol-");
    return 1;
}
pawn Код:
if(HasMinigun[playerid] == 1)
{
    ResetPlayerWeapons(playerid);
    HasMinigun[playerid] = false;
}
Reply
#8

i placed it on my game mode but when i go to lol i get no weapon :S
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)