Szerző Téma: Dm zóna belépésnél nem veszi el a régi fegyvereket.  (Megtekintve 541 alkalommal)

Dm zóna belépésnél nem veszi el a régi fegyvereket.
« Dátum: 2014. szeptember 21. - 05:24:05 »
0 Show voters
Sziasztok!Olyan problémám van hogy: dm-be való belépéskor a már meglévõ fegyvereket nem veszi el.És /exitdm parancs után nem rak vissza az eredeti helyemre.
Illetve kérdeznék még valamit:Próbáltam hozzáírni még 1 dmzónát tesztdm-néven,de sajnos nem mûködik. (fogalmam nincs miért)
Ezekhez kérnék tõletek segítséget,sajnos kezdõ vagyok,így ha lehet részletes segítséget kérnék.Elõre is köszönöm.
 
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#pragma tabsize 0
static FREEDM[MAX_PLAYERS]={ -1, ... };
#define COLOR_TENGER 0x00a6ffAA
#define COLOR_SÁRGA 0xfff700AA
#define COLOR_PIROS 0xff0000AA
//Dialog Define
#define DIALOG_DMEK 2013
//Sawndm RANDOM
new Float:RandomDM[6][3] =
{
{1305.2129,2191.8435,11.0234},
{1390.3733,2107.3083,11.0156},
{1390.5880,2192.2305,11.0234},
{1305.4147,2107.0833,11.0156},
{1356.1439,2196.3647,11.0234},
{1350.9719,2105.7046,11.0156}
};
//M4DM RANDOM
new Float:RandomDM2[9][3] =
{
{-32.1949,48.3527,3.1172},
{-34.2015,51.4968,3.1094},
{-39.6453,53.1995,6.4844},
{-92.7494,-23.9238,3.1172},
{-60.0644,52.9396,6.4766},
{-58.9392,-32.4063,3.1172},
{-62.3151,-43.0170,3.1172},
{-121.2243,-101.2563,3.1181},
{-74.4122,-103.9932,3.1181}
};
//SniperDM
new Float:RandomDM3[6][3] =
{
{2705.4529,2716.8281,12.8222},
{2605.1272,2687.8218,10.8203},
{2671.2771,2749.1133,10.8203},
{2613.0930,2734.4707,36.5386},
{2630.9536,2725.3049,23.8222},
{2647.3257,2767.6680,10.8203}
};
//tesztDM
new Float:RandomDM4[6][3] =
{
{2705.4529,2716.8281,12.8222},
{2605.1272,2687.8218,10.8203},
{2671.2771,2749.1133,10.8203},
{2613.0930,2734.4707,36.5386},
{2630.9536,2725.3049,23.8222},
{2647.3257,2767.6680,10.8203}
};
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
        print(\"\\n--------------------------------------\");
        print(\"DM System BY: ]FreePlay[ Verzió 1.0\");
        print(\"--------------------------------------\\n\");
        return 1;
}
public OnFilterScriptExit()
{
        return 1;
}
#else
main()
{
        print(\"\\n----------------------------------\");
        print(\" DM System BY: ]FreePlay[ Verzió 1.0\");
        print(\"----------------------------------\\n\");
}
#endif
 
public OnPlayerConnect(playerid)
{
    FREEDM[playerid] = -1;
        SendClientMessage(playerid,COLOR_TENGER,\"A szerveren rengeteg király DM-Rendszer üzemel\");
        SendClientMessage(playerid,COLOR_TENGER,\"DM Zónákért : /dms\");
        return 1;
}
public OnPlayerSpawn(playerid)
{
   switch(FREEDM[playerid])
   {
       case 0:
       {
         new rand = random(sizeof(RandomDM));
         SetPlayerPos(playerid, RandomDM[rand][0], RandomDM[rand][1],RandomDM[rand][2]);
         ResetPlayerWeapons(playerid);
         GivePlayerWeapon(playerid,26,1);
         SetPlayerHealth(playerid,100);
         SetPlayerArmour(playerid,100);
         SetPlayerVirtualWorld(playerid,2);
         }
        case 1:
         {
         new rand = random(sizeof(RandomDM2));
         SetPlayerPos(playerid, RandomDM2[rand][0], RandomDM2[rand][1],RandomDM2[rand][2]);
         ResetPlayerWeapons(playerid);
         SetPlayerHealth(playerid,25);
         GivePlayerWeapon(playerid,31,100);
         SetPlayerVirtualWorld(playerid,3);
         }
         case 2:
         {
         ResetPlayerWeapons(playerid);
         new rand = random(sizeof(RandomDM3));
                 SetPlayerPos(playerid, RandomDM3[rand][0], RandomDM3[rand][1],RandomDM3[rand][2]);
         SetPlayerPos(playerid,1379.3,-28.2,30.0);
         GivePlayerWeapon(playerid,20,100);
             SetPlayerHealth(playerid,5);
         SetPlayerVirtualWorld(playerid,4);
         }
         case 3:
         {
         ResetPlayerWeapons(playerid);
         new rand = random(sizeof(RandomDM4));
                 SetPlayerPos(playerid, RandomDM4[rand][0], RandomDM4[rand][1],RandomDM4[rand][2]);
         SetPlayerPos(playerid,1379.3,-28.2,30.0);
         GivePlayerWeapon(playerid,20,100);
             SetPlayerHealth(playerid,5);
         SetPlayerVirtualWorld(playerid,4);
      }
   }
   return 1;
}
//SawnDM
CMD:sawndm(playerid,params[])
{
      if(FREEDM[playerid] == 0) return SendClientMessage(playerid,COLOR_PIROS,\"Te már DM-zónában vagy : /exitdm\");
      new rand = random(sizeof(RandomDM));
      SetPlayerPos(playerid, RandomDM[rand][0], RandomDM[rand][1],RandomDM[rand][2]);
      FREEDM[playerid] = 0;
      new pName[30], string[128];
      GetPlayerName(playerid, pName, 30);
      format(string, 256, \"%s csatlakozot a Sawn DM-hez belépés: (/sawndm)\", pName);
      SendClientMessageToAll(COLOR_SÁRGA,string);
      SetPlayerVirtualWorld(playerid,2);
      GivePlayerWeapon(playerid,26,6789);
      SendClientMessage(playerid,COLOR_TENGER,\"Csatlakoztál a Sawn DM-hez\");
      return 1;
}
//M4DM
CMD:m4dm(playerid,params[])
{
      if(FREEDM[playerid] == 0) return SendClientMessage(playerid,COLOR_PIROS,\"Te már DM-zónában vagy : /exitdm\");
      new rand = random(sizeof(RandomDM2));
      SetPlayerPos(playerid, RandomDM2[rand][0], RandomDM2[rand][1],RandomDM2[rand][2]);
      FREEDM[playerid] = 1;
      new pName[30], string[128];
      SetPlayerHealth(playerid,25);
      GetPlayerName(playerid, pName, 30);
      format(string, 256, \"%s csatlakozot az M4DM-hez belépés: (/m4dm)\", pName);
      SendClientMessageToAll(COLOR_SÁRGA,string);
      SetPlayerVirtualWorld(playerid,3);
      GivePlayerWeapon(playerid,31,9990);
      SendClientMessage(playerid,COLOR_TENGER,\"Csatlakoztál az M4DM -hez\");
      return 1;
}
//Sniperdm
CMD:sniperdm(playerid,params[])
{
      if(FREEDM[playerid] == 0) return SendClientMessage(playerid,COLOR_PIROS,\"Te már DM-zónában vagy : /exitdm\");
      new rand = random(sizeof(RandomDM3));
      SetPlayerPos(playerid, RandomDM3[rand][0], RandomDM3[rand][1],RandomDM3[rand][2]);
      FREEDM[playerid] = 2;
      ShowPlayerMarkers(true);
      SetPlayerHealth(playerid,5);
      SetPlayerVirtualWorld(playerid,4);
      new pName[30], string[128];
      GetPlayerName(playerid, pName, 30);
      format(string, 256, \"%s csatlakozot a Sniper DM-hez belépés: (/sniperdm)\", pName);
      SendClientMessageToAll(COLOR_SÁRGA,string);
      GivePlayerWeapon(playerid,34,100);
      SendClientMessage(playerid,COLOR_TENGER,\"Csatlakoztál a SniperDM -hez\");
      return 1;
}
//Tesztdm
CMD:tesztdm(playerid,params[])
{
      if(FREEDM[playerid] == 0) return SendClientMessage(playerid,COLOR_PIROS,\"Te már DM-zónában vagy : /exitdm\");
      new rand = random(sizeof(RandomDM4));
      SetPlayerPos(playerid, RandomDM4[rand][0], RandomDM4[rand][1],RandomDM4[rand][2]);
      FREEDM[playerid] = 3;
      ShowPlayerMarkers(true);
      SetPlayerHealth(playerid,5);
      SetPlayerVirtualWorld(playerid,5);
      new pName[30], string[128];
      GetPlayerName(playerid, pName, 30);
      format(string, 256, \"%s csatlakozot a Sniper DM-hez belépés: (/tesztdm)\", pName);
      SendClientMessageToAll(COLOR_SÁRGA,string);
      GivePlayerWeapon(playerid,34,100);
      SendClientMessage(playerid,COLOR_TENGER,\"Csatlakoztál a tesztDM -hez\");
      return 1;
}
//Kilépés Parancs
CMD:exitdm(playerid,params[])
   {
   if(FREEDM[playerid] == -1) return SendClientMessage(playerid,COLOR_PIROS, \"Nem tartózkodsz DM-zónában\");
   SetPlayerVirtualWorld(playerid,0);
   FREEDM[playerid] = -1;
   ShowPlayerMarkers(false);
   return SendClientMessage(playerid,COLOR_SÁRGA,\"Kiléptél a DeathMatch zónából.\");
}
 
CMD:dms(playerid,params[])
{
if(FREEDM[playerid] == 0) return SendClientMessage(playerid,COLOR_PIROS,\"Te már DM-zónában vagy : /exitdm\");
ShowPlayerDialog(playerid, DIALOG_DMEK, DIALOG_STYLE_LIST, \"DM-Zónák\", \"Sawn DM\\nM4DM\\nSniperDM\", \"Csatlakozás\", \"Mégsem\");
return 1;
}
 
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_DMEK)
    {
        if(response)
        {
            if(listitem == 0) //Sawn DM
            {
             new rand = random(sizeof(RandomDM));
             SetPlayerPos(playerid, RandomDM[rand][0], RandomDM[rand][1],RandomDM[rand][2]);
             FREEDM[playerid] = 0;
             new pName[30], string[128];
             GetPlayerName(playerid, pName, 30);
             format(string, 256, \"%s csatlakozot a Sawn DM-hez belépés: (/sawndm)\", pName);
             SendClientMessageToAll(COLOR_SÁRGA,string);
             SetPlayerVirtualWorld(playerid,2);
             GivePlayerWeapon(playerid,26,6789);
             SendClientMessage(playerid,COLOR_TENGER,\"Csatlakoztál a Sawn DM-hez\");
            }
            if(listitem == 1) //M4DM
            {
              new rand = random(sizeof(RandomDM2));
              SetPlayerPos(playerid, RandomDM2[rand][0], RandomDM2[rand][1],RandomDM2[rand][2]);
              FREEDM[playerid] = 1;
              new pName[30], string[128];
              GetPlayerName(playerid, pName, 30);
              format(string, 256, \"%s csatlakozot az M4DM-hez belépés: (/m4dm)\", pName);
              SendClientMessageToAll(COLOR_SÁRGA,string);
              SetPlayerVirtualWorld(playerid,3);
              GivePlayerWeapon(playerid,31,9990);
              SendClientMessage(playerid,COLOR_TENGER,\"Csatlakoztál az M4DM -hez\");
            }
            if(listitem == 2) //SniperDM
            {
             new rand = random(sizeof(RandomDM));
             SetPlayerPos(playerid, RandomDM[rand][0], RandomDM[rand][1],RandomDM[rand][2]);
             FREEDM[playerid] = 2;
             SetPlayerVirtualWorld(playerid,4);
             new pName[30], string[128];
             GetPlayerName(playerid, pName, 30);
             format(string, 256, \"%s csatlakozot a KDM-hez belépés: (/kdm)\", pName);
             SendClientMessageToAll(COLOR_SÁRGA,string);
             GivePlayerWeapon(playerid,34,100);
             ShowPlayerMarkers(false);
             SendClientMessage(playerid,COLOR_TENGER,\"Csatlakoztál a Kartantén DM -hez\");
                         }
            if(listitem == 3) //tesztDM
            {
             new rand = random(sizeof(RandomDM4));
             SetPlayerPos(playerid, RandomDM[rand][0], RandomDM[rand][1],RandomDM[rand][2]);
             FREEDM[playerid] = 3;
             SetPlayerVirtualWorld(playerid,5);
             new pName[30], string[128];
             GetPlayerName(playerid, pName, 30);
             format(string, 256, \"%s csatlakozot a tesztdm-hez belépés: (/tesztdm)\", pName);
             SendClientMessageToAll(COLOR_SÁRGA,string);
             GivePlayerWeapon(playerid,34,100);
             ShowPlayerMarkers(false);
             SendClientMessage(playerid,COLOR_TENGER,\"Csatlakoztál a teszt DM -hez\");
            }
        }
        return 1;
}
   return 0;
}
« Utoljára szerkesztve: 2014. szeptember 22. - 00:21:39 írta Dfoglalo »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal