26.07.2012, 13:23
Can any oone help me with dialoge when I buy something I dont get any thing nor my money reduces
REP + if you fix it.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buyaccessories", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5.0,58.6817,-168.0704,990.0303))
ShowPlayerDialog(playerid,3300,DIALOG_STYLE_LIST,"What do you want buy?","Motorcycle Helmet green($50)\nMotorcycle Helmet black($50)\nMotorcycle Helmet blue($50)\nMotorcycle Helmet purple($50)\nTopHat green($50)\nTopHat black($50)\nTopHat purple($50)\nTopHat yellow($50)","Purchase","Cancel");
return 1;
}
return 0;
}
pawn Код:
{
if(dialogid == 3300)//our dialog!
{
if(response)// They pressed the first button.
{
switch(listitem)
{
case 0:// The first item listed
{
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -50);
SetPlayerAttachedObject(playerid, 3, 18976, 2, 0.101, -0.0, 0.0, 2.0, 90.60, 83.7, 1.05, 1.2, 1, 0xFF00FF00);
}
case 1: // The second item listed
{
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -50);
SetPlayerAttachedObject(playerid, 3, 18976, 2, 0.101, -0.0, 0.0, 2.0, 90.60, 83.7, 1.05, 1.2, 1, 0x000000);
}
case 2: // The third item listed
{
if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -3);
SetPlayerAttachedObject(playerid, 3, 18976, 2, 0.101, -0.0, 0.0, 2.0, 90.60, 83.7, 1.05, 1.2, 1, 0x0039F5);
}
case 3: // The forth item listed
{
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -50);
SetPlayerAttachedObject(playerid, 3, 18976, 2, 0.101, -0.0, 0.0, 2.0, 90.60, 83.7, 1.05, 1.2, 1, 0xF500ED);
}
case 4: // The forth item listed
{
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -50);SetPlayerAttachedObject(playerid, 3, 18976, 2, 0.101, -0.0, 0.0, 2.0, 90.60, 83.7, 1.05, 1.2, 1, 0xF500ED);
SetPlayerAttachedObject(playerid, 3, 19487, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1, 0xFF00FF00);
}
case 5: // The forth item listed
{
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -50);
SetPlayerAttachedObject(playerid, 3, 19487, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1, 0x000000);
}
case 6: // The forth item listed
{
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -50);
SetPlayerAttachedObject(playerid, 3, 19487, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1, 0xE105FA);
}
case 7: // The forth item listed
{
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -50);
SetPlayerAttachedObject(playerid, 3, 19487, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1, 0xFAFA05);
}
}
}
}
return 1;
}