SA-MP Forums Archive
DM zone help??? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: DM zone help??? (/showthread.php?tid=257365)



DM zone help??? - eleosreman - 25.05.2011

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;
}


Re: DM zone help??? - Ernests - 25.05.2011

Код:
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.


Re: DM zone help??? - eleosreman - 25.05.2011

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


Re: DM zone help??? - marinov - 26.05.2011

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


Re: DM zone help??? - eleosreman - 26.05.2011

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


Re: DM zone help??? - susanexpress1 - 26.05.2011

so wonderful information.


Re: DM zone help??? - Lorenc_ - 26.05.2011

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;
}



Re: DM zone help??? - eleosreman - 26.05.2011

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