21.08.2011, 16:26
Bug Fixed ! thank you all for your repplys and your assistance !
i do that :
i put in my GM under public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) that :
and under public OnPlayerCommandText(playerid, cmdtext[])(in my GM) i put this :
It is Working 100% without Warnings(thanx a lot of you all for your assistances )
i do that :
i put in my GM under public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) that :
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response) { switch(dialogid) { case 1: { switch(listitem) { case 0: { if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !"); GivePlayerMoney(playerid, -3000); GivePlayerWeapon(playerid, 31,100); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}M4 !"); } case 1: { if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !"); GivePlayerMoney(playerid, -1500); GivePlayerWeapon(playerid, 30,100); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}AK47 !"); } case 2: { if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !"); GivePlayerMoney(playerid, -10000); GivePlayerWeapon(playerid, 35,10); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Bazooka !"); } case 3: { if(GetPlayerMoney(playerid) < 4) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !"); GivePlayerMoney(playerid, -7000); GivePlayerWeapon(playerid, 34,50); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Sniper Rifle !"); } case 4: { if(GetPlayerMoney(playerid) < 5) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !"); GivePlayerMoney(playerid, -8000); GivePlayerWeapon(playerid, 16,10); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Grenades !"); } case 5: { if(GetPlayerMoney(playerid) < 6) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !"); GivePlayerMoney(playerid, -300); GivePlayerWeapon(playerid, 18,10); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Molotov !"); } case 6: { if(GetPlayerMoney(playerid) < 7) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !"); GivePlayerMoney(playerid, -500); GivePlayerWeapon(playerid, 22,100); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Colt !"); } case 7: { if(GetPlayerMoney(playerid) < 8) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !"); GivePlayerMoney(playerid, -6000); GivePlayerWeapon(playerid, 27,100); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}Combat Shotgun !"); } case 8: { if(GetPlayerMoney(playerid) < 9) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !"); GivePlayerMoney(playerid, -900); GivePlayerWeapon(playerid, 28,100); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}UZI !"); } case 9: { if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough money !"); GivePlayerMoney(playerid, -1000); GivePlayerWeapon(playerid, 29,100); PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); SendClientMessage(playerid, 0x9EC73DAA, "Bought {F81414}MP5 !"); } } } } } return 1; }
Код:
if (strcmp("/shop", cmdtext, true, 10) == 0) //i changed: COMMAND:shop(playerid, params[]) { if(gTeam[playerid] == TEAM_ZOMBIE) { SendClientMessage(playerid, 0x9EC73DAA,"Zombies can't buy Guns !"); } else { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose a gun to buy", "M4 \ {F81414}$3000(100ammo) \nAK-47 {F81414}$1500(100ammo) \nBazooka {F81414}$10000(10Ammo) \n\ Sniper Rifle {F81414}$7000(50ammo) \nGrenades {F81414}$8000(10ammo) \nMolotov {F81414}$400(10ammo)\ \nColt {F81414}$500(100ammo) \nCombat Shotgun {F81414}$6000(100ammo) \nUZI {F81414}$900(100ammo) \ \nMP5 {F81414}$1000(100ammo) \n ", "Buy", "Cancel"); // You can change the dialog ID to your own } return 1; }