12.06.2014, 14:05
Hello i found this script that i liked By ''Inn0cent''
and i want to make it only available at some weapon ammunation interior or other places
Код:
//Weapons shop. #include <a_samp> #define DIALOG_WEAPONS 1337 #define GREY "{6c6c6c}" #define RED "{FF0000}" public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/weapon", cmdtext, true, 10) == 0) { new string[368]; strcat(string,"Explosives [$500]"); strcat(string,"Hand Guns [$1,000]\n"); strcat(string,"Shotguns [$5,000]\n"); strcat(string,"Assault Weapons [$8,000]\n"); strcat(string,"Rifles [$12,000]\n"); ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons:",string,"Select","Back"); return 1; } return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_WEAPONS) { if(response) { if(listitem == 0) { new string[128]; strcat(string,"Gernade\n"); strcat(string,"Molotov Cocktail\n"); ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "$500",string,"Buy","Back"); } if(listitem == 1)//HAND GUNS { new string[128]; strcat(string,"9mm\n"); strcat(string,"Silence 9mm\n"); strcat(string,"Desert Eagle\n"); strcat(string,"Chainsaw\n"); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST,"$1,000",string,"Buy","Back"); } if(listitem == 2)//Shotguns { new string[128]; strcat(string,"Shotgun\n"); strcat(string,"Sawnoff Shotgun\n"); strcat(string,"Combat Shotgun\n"); ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST,"$5,000",string,"Buy","Back"); } if(listitem == 3)//Assault Weapons { new string[128]; strcat(string,"Micro SMG/Uzi\n"); strcat(string,"MP5\n"); strcat(string,"AK-47\n"); strcat(string,"M4\n"); strcat(string,"Tec-9\n"); ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "$8,000",string,"Buy","Back"); } if(listitem == 4) { new string[128]; strcat(string,"Country Rifle\n"); strcat(string,"Sniper Rifle\n"); ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "$12,000",string,"Buy","Back"); } } } if(dialogid == 1)//HAND GUNS { if(response) { if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid,-1,""RED"You dont have enough cash to buy this item."); if(listitem == 0) { GivePlayerWeapon(playerid, 22, 1000); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 1) { GivePlayerWeapon(playerid, 23, 1000); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 2) { GivePlayerWeapon(playerid, 24, 1000); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 3) { GivePlayerWeapon(playerid, 9, 1000); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } } } if(dialogid == 2)//SHOT GUNS { if(response) { if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid,-1,""RED"You dont have enough cash to buy this item."); if(listitem == 0) { GivePlayerWeapon(playerid, 25, 1000); GivePlayerMoney(playerid,-5000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 1) { GivePlayerWeapon(playerid, 26, 1000); GivePlayerMoney(playerid,-5000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 2) { GivePlayerWeapon(playerid, 27, 1000); GivePlayerMoney(playerid,-5000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } } } if(dialogid == 3)//Assault weapons { if(response) { if(GetPlayerMoney(playerid) < 8000) return SendClientMessage(playerid,-1,""RED"You dont have enough cash to buy this item."); if(listitem == 0) { GivePlayerWeapon(playerid,28,1000); GivePlayerMoney(playerid,-8000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 1) { GivePlayerWeapon(playerid,29,1000); GivePlayerMoney(playerid,-8000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 2) { GivePlayerWeapon(playerid,30,1000); GivePlayerMoney(playerid,-8000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 3) { GivePlayerWeapon(playerid,31,1000); GivePlayerMoney(playerid,-8000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 4) { GivePlayerWeapon(playerid,32,1000); GivePlayerMoney(playerid,-8000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } } } if(dialogid == 4)//Rifles { if(response) { if(GetPlayerMoney(playerid) < 12000) return SendClientMessage(playerid,-1,""RED"You dont have enough cash to buy this item."); if(listitem == 0) { GivePlayerWeapon(playerid,33,1000); GivePlayerMoney(playerid,-12000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 1) { GivePlayerWeapon(playerid,34,1000); GivePlayerMoney(playerid,-12000); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } } } if(dialogid == 5)//Explosives { if(GetPlayerMoney(playerid) < 12000) return SendClientMessage(playerid,-1,""RED"You dont have enough cash to buy this item."); if(listitem == 0) { GivePlayerWeapon(playerid,16,1000); GivePlayerMoney(playerid,-500); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } if(listitem == 1) { GivePlayerWeapon(playerid,18,1000); GivePlayerMoney(playerid,-500); SendClientMessage(playerid,-1,""GREY"Weapon has been purchased"); } } return 1; }