02.05.2013, 23:51
pawn Код:
if(dialogid == 40)
{
if(!response)
{
} else {
switch(listitem)
{
case 0:
{
new string[128];
if(server_GetCash(playerid) >= 5)
{
SendClientMessage(playerid, COLOR_WHITE, "You've purchased a sprunk!");
server_GiveCash(playerid, -5);
PlayerInfo[playerid][pSprunk]= PlayerInfo[playerid][pSprunk]+1;
GameTextForPlayer(playerid, "~r~$-5", 1000,1);
format(string, sizeof(string), "* %s has bought a sprunk for $5.", GetName(playerid));
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Not enough money!");
}
}
}
EDIT: Make sure to fix the identation
EDIT:
pawn Код:
if(dialogid == 40)
{
if(!response)
{
return 0;
}
switch(listitem)
{
case 0:
{
new string[128];
if(server_GetCash(playerid) >= 5)
{
SendClientMessage(playerid, COLOR_WHITE, "You've purchased a sprunk!");
server_GiveCash(playerid, -5);
PlayerInfo[playerid][pSprunk]= PlayerInfo[playerid][pSprunk]+1;
GameTextForPlayer(playerid, "~r~$-5", 1000,1);
format(string, sizeof(string), "* %s has bought a sprunk for $5.", GetName(playerid));
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Not enough money!");
}
}