DM help
#1

Hello everyone, it ,how I would be able to solve it ,that if the player dm into a zone is let the exitdm be unable to use an other command apart from a command then?

Код:
CMD:exitdm(playerid, params[])
   {
      if(dmid[playerid] == -1) return SendClientMessage(playerid,COLOR_RED, "Nem hasznбlhatod ezt a parancsot ,mert nem vagy DM-ben!");
      dmid[playerid] = -1;
      SpawnPlayer(playerid);
      return SendClientMessage(playerid,COLOR_GREEN,"Kilйptйl a DM zуnбbуl!");
   }
Код:
CMD:sawndm(playerid, params[])
   {
      dmid[playerid] = 0; // Azonosнtуszбm megadбsa FONTOS
      SpawnPlayer(playerid); // Jбtйkos lespawnolбsa
      SendClientMessage(playerid,COLOR_GREEN,"Csatlakoztбl a Sawn DM-hez!");
      new pName[30], string[128];
      GetPlayerName(playerid, pName, 30);
      format(string, 256, "{00ff00}[DM-TELEPORT]:{F97C00} %s elteleportбlt a Sawn DM-be. ( /sawndm )", pName);
      SendClientMessageToAll(0xFF9933AA,string);
      return 1;
   }
Код:
public OnPlayerSpawn(playerid)
{
   switch(dmid[playerid])
   {
       case 0: // 0-бs azonosнtуszбmъ dm zуnбhoz tartozу tevйkenysйgek
       {
         SetPlayerPos(playerid,-3247.9622,30.2630,1001.6566); // Elhelyezйs a dMben. Itt akбr vйletlenszeru spawnot is нrhatunk, de az бtlбthatуsбg kedvййrt maradjunk ennйl
         SetPlayerFacingAngle(playerid,0); // Jбtйkos нrбnyba бllнtбsa; elforgatбs
         ResetPlayerWeapons(playerid); // fegyverek elvйtele <- FONTOS
         GivePlayerWeapon(playerid,26,5000); // Felfegyverzйs
         SetPlayerVirtualWorld(playerid,10); // бthelyezйs mбsi VW-be
      } .......
Reply
#2

pawn Код:
enum pInfo
{
        pSawnDM
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
CMD:sawndm(playerid, params[])
   {
      if(PlayerInfo[playerid][pSawnDM] == 1) return SendClientMessage(playerid, COLOR_RED, " You already sawn   DM!");
     {
      dmid[playerid] = 0; // Azonosнtуszбm megadбsa FONTOS
      SpawnPlayer(playerid); // Jбtйkos lespawnolбsa
      SendClientMessage(playerid,COLOR_GREEN,"Csatlakoztбl a Sawn DM-hez!");
      new pName[30], string[128];
      PlayerInfo[playerid][pSawnDM] = 1;
      GetPlayerName(playerid, pName, 30);
      format(string, 256, "{00ff00}[DM-TELEPORT]:{F97C00} %s elteleportбlt a Sawn DM-be. ( /sawndm )", pName);
      SendClientMessageToAll(0xFF9933AA,string);
     }
      return 1;
   }
pawn Код:
CMD:exitdm(playerid, params[])
   {
      if(dmid[playerid] == -1) return SendClientMessage(playerid,COLOR_RED, "Nem hasznбlhatod ezt a parancsot ,mert nem vagy DM-ben!");
      {
      dmid[playerid] = -1;
      SpawnPlayer(playerid);
      PlayerInfo[playerid][pSawnDM] = 0;
      return SendClientMessage(playerid,COLOR_GREEN,"Kilйptйl a DM zуnбbуl!");
      }
      return 1;
   }
You won't be able to use /sawndm if you didn't /exitdm.
don't forget to return after every command!
Reply
#3

I say thank you for it only with this that problem ,that this row:

Код:
if(PlayerInfo[playerid][pSawDM] == 1) return SendClientMessage(playerid, COLOR_RED, " You already saw DM!);
Under all commands it is necessary to write it in. It could not be so to solve ,that only the exitdm command let him allow it if it is respective sawn dm-be is?
Reply
#4

You won't be able to use /sawndm untill you type /exitdm.
if you want also they won't be able to use another command untill /exitdm add this line under the other command
Reply
#5

Thanks a lot. Was going the + . I have 1 problem if you would be able to help with it possibly then yet besides I would say thanks for it. (I'm sorry the much help they were not able to help the Hungarian sides very much only for a request.)
Fishy:
http://forum.sa-mp.com/showthread.ph...=Object&page=2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)