29.06.2012, 10:26
Well basically my problem is that , if you but lets say some tec-9ґs , with 600 ammo (the default one) , and then you buy a different weapon but like same style/category , lets say some Uzis , the ammo gets summed up , it doesnt go to the default uzi ammo.
Lets say you have 600 tec-9 , you buy uzi , and instead of getting 600 uzi , it will go up to 1200 uzi. It sums them up :S
Here are a few pics so you understand me:
And here is the dialog pawno.Is there anything I should define or smthin?
Lets say you have 600 tec-9 , you buy uzi , and instead of getting 600 uzi , it will go up to 1200 uzi. It sums them up :S
Here are a few pics so you understand me:
And here is the dialog pawno.Is there anything I should define or smthin?
pawn Код:
CMD:ws(playerid, params[])
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Weapons","Desert Eagle ($5000)\nChainsaw ($10000)\nSawnoff Shotgun ($10000)\nMicro SMG/Uzi ($15000)\nTec-9 ($15000)\nMP5 ($17000)\nAK-47 ($17000)\nM4($17000)\nSniper Rifle($18000)\nFull Health($1000)\nFull Armour ($1000)", "Purchase", "Cancel");
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 1:// Our dialog!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// Desert Eagle
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 24, 150);
}
case 1: // Chainsaw
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -10000);
GivePlayerWeapon(playerid, 9, 500);
}
case 2: // Sawns
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -10000);
GivePlayerWeapon(playerid, 26, 300);
}
case 3: // Uzi
{
if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -15000);
GivePlayerWeapon(playerid, 28, 750);
}
case 4: // Tec 9
{
if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -15000);
GivePlayerWeapon(playerid, 32, 600);
}
case 5: // MP5
{
if(GetPlayerMoney(playerid) < 17000 ) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -17000);
GivePlayerWeapon(playerid, 29, 400);
}
case 6: // ak47
{
if(GetPlayerMoney(playerid) < 17000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -17000);
GivePlayerWeapon(playerid, 30, 400);
}
case 7: // m4
{
if(GetPlayerMoney(playerid) < 17000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -17000);
GivePlayerWeapon(playerid, 31, 400);
}
case 8: // Sniper
{
if(GetPlayerMoney(playerid) < 18000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -18000);
GivePlayerWeapon(playerid, 34, 150);
}
case 9: // Health
{
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -1000);
SetPlayerHealth(playerid, 100);
}
case 10: // Armour
{
if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -3);
SetPlayerArmour(playerid, 100);
}
}
}
}
}
return 1;
}