if(response)
{
if(dialogid == 90000)
{
if(strlen(inputtext))
{
if(inputtext > PlayerInfo[playerid][pAccount])
{
SendClientMessage(playerid, COLOR_WHITE, "You don't have that money in your account!");
return 1;
}
ConsumingMoney[playerid] = 1;
GivePlayerCash(playerid,inputtext);
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-inputtext;
}
}
}
error 033: array must be indexed (variable "inputtext") x2
error 035: argument type mismatch (argument 2)
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response && dialogid == 90000) { if(strlen(inputtext)) { new v; v = strval(inputtext); if(v > PlayerInfo[playerid][pAccount]) { return SendClientMessage(playerid, color, "You don't have that money in your account"); } ConsumingMoney[playerid] = 1; GivePlayerCash(playerid, v); PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] - v; } SendClientMessage(playerid, color, "Whatever"); // If the player doesn't put anything in the box return this message } return 1; }
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response && dialogid == 90000) { if(strlen(inputtext)) { new v; v = strval(inputtext); if(v <= PlayerInfo[playerid][pAccount]) { ConsumingMoney[playerid] = 1; GivePlayerCash(playerid, v); PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] - v; return 1; } else { SendClientMessage(playerid, color, "You don't have that money in your account"); } } SendClientMessage(playerid, color, "Whatever"); // If the player doesn't put anything in the box return this message } return 1; }
Originally Posted by Joe_
If it works, then good, if not:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response && dialogid == 90000) { if(strlen(inputtext)) { new v; v = strval(inputtext); if(v <= PlayerInfo[playerid][pAccount]) { ConsumingMoney[playerid] = 1; GivePlayerCash(playerid, v); PlayerInfo[playerid][pAccount] = PlayerInfo[playerid][pAccount] - v; return 1; } else { SendClientMessage(playerid, color, "You don't have that money in your account"); } } SendClientMessage(playerid, color, "Whatever"); // If the player doesn't put anything in the box return this message } return 1; } ![]() GivePlayerCash is not the SA-MP Native way to give the player cash, try GivePlayerMoney? |