Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- new InDMArena[MAX_PLAYERS];
- public OnPlayerConnect(playerid)
- {
- InDMArena[playerid] = 0;
- return 1;
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Deathmatch Arena-By bensmart469");
- print("--------------------------------------\n");
- CreatePickup(1210,1, 2695.3411,-1704.1940,11.8438, -1);
- Create3DTextLabel("DM Arena\n/dmarena to enter!", 0x00FF00FF, 2695.3411,-1704.1940,11.8438, 30, -1);
- return 1;
- }
- CMD:dmarena(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,2,2695.3411,-1704.1940,11.8438)) return SendClientMessage(playerid,0xFF0000FF,"You are not near the DM arena location!");
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"DM Arenas","Minigun DM\nDildo DM","Choose","Cancel");
- return 1;
- }
- CMD:leavedm(playerid,params[])
- {
- if(!InDMArena[playerid]) return SendClientMessage(playerid,0xFF0000FF,"You are not in a DM Arena!");
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,2695.3411,-1704.1940,11.8438);
- if(InDMArena[playerid] == 1)
- {
- ResetPlayerWeaponsEx(playerid,38);
- }
- if(InDMArena[playerid] == 2)
- {
- ResetPlayerWeaponsEx(playerid,10);
- }
- InDMArena[playerid] = 0;
- SendClientMessage(playerid,0xFFFFFFFF,"You left the arena, come back soon!");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- new rand = random(4);
- SetPlayerInterior(playerid,1);
- if(rand == 0)
- {
- SetPlayerPos(playerid,936.2902,2120.2339,1011.0234);
- }
- else if(rand == 1)
- {
- SetPlayerPos(playerid,956.7552,2109.2249,1011.0234);
- }
- else if(rand == 2)
- {
- SetPlayerPos(playerid,948.3972,2173.8577,1011.0303);
- }
- else if(rand == 3)
- {
- SetPlayerPos(playerid,962.9377,2173.5430,1011.0234);
- }
- InDMArena[playerid] = 1;
- GivePlayerWeapon(playerid,38,10000);
- }
- case 1:
- {
- new rand = random(3);
- SetPlayerInterior(playerid,2);
- if(rand == 0)
- {
- SetPlayerPos(playerid,1205.4014,10.7419,1000.9219);
- }
- else if(rand == 1)
- {
- SetPlayerPos(playerid,1221.3037,8.2171,1001.3356);
- }
- else if(rand == 2)
- {
- SetPlayerPos(playerid,1221.2495,-14.0743,1000.9219);
- }
- InDMArena[playerid] = 2;
- GivePlayerWeapon(playerid,10,10000);
- }
- }
- }
- }
- return 0;
- }
- stock ResetPlayerWeaponsEx(playerid,...) // Credits to Kyoshiro :)
- {
- new W[] =
- {
- 0,0,1,1,1,1,1,1,1,1,10,10,10,10,10,10,8,8,
- 8,0,0,0,2,2,2,3,3,3,4,4,5,5,4,6,6,7,7,7,7,
- 8,12,9,9,9,11,11,11,11
- };
- new
- idx = 0,
- tmp = 0,
- weapons,
- args = numargs() - 1,
- bool:Reset[13] = {true,...};
- if(IsPlayerConnected(playerid))
- {
- if(args > 0)
- {
- if(args <= 46)
- {
- while(args > idx++)
- {
- new wep = getarg(idx);
- if(0 <= wep <= 46)
- {
- GetPlayerWeaponData(playerid,W[wep],weapons,tmp);
- if(weapons == wep)
- {
- Reset[W[wep]] = false;
- }
- }
- else
- {
- printf("ResetPlayerWeaponEx warning: invalid argument (argument: #%d)! \"%d\" is not a valid weapon!", idx+1,wep);
- }
- }
- for(new a = 0; a < 13; a ++)
- {
- if(Reset[a])
- {
- GetPlayerWeaponData(playerid,a,weapons,tmp);
- if(weapons)
- {
- SetPlayerAmmo(playerid,weapons,0);
- weapons = -1;
- }
- }
- else
- {
- Reset[a] = true;
- }
- }
- return 1;
- }
- print("ResetPlayerWeaponsEx Error: You have specified over 46 weapons! Check for duplicate weapons");
- return 1;
- }
- ResetPlayerWeapons(playerid);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment