Gui menu problem.
#1

I have this code:
pawn Код:
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;
}
}
}
It's a bank dialog system, when someone types /withdraw will appear this, but I have this errors, too:

pawn Код:
error 033: array must be indexed (variable "inputtext") x2
error 035: argument type mismatch (argument 2)
Reply
#2

bump
Reply
#3

Never had this problem.

Код:
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;
}
Not tested.
Reply
#4

on which line the bug is and show me your "ShowPlayerDialog"
Reply
#5

Works, but I don't receive the money.
Reply
#6

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;
}
Forums ruin the indentation, sorry

GivePlayerCash is not the SA-MP Native way to give the player cash, try GivePlayerMoney?

If you're using the server-sided money from other scripts, make sure that the script works, but you could try GivePlayerMoney, if that works, then try GivePlayerCash, if that doesn't work, then it's the GivePlayerCash function, if GivePlayerMoney doesn't work, tell me.
Reply
#7

Quote:
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;
}
Forums ruin the indentation, sorry

GivePlayerCash is not the SA-MP Native way to give the player cash, try GivePlayerMoney?
No, GivePlayerCash it's from the antihack, and it works fine..it's same
I have another dialog(login & register),and if I click cancel it Kick's me.
Here's my whole OnDialogResponse:
http://pastebin.com/hcUpAd7g
Reply
#8

Hmmm, then I'm not sure..

Let me go test this on my server.
Reply
#9

Fixed, with one problem...
Reply
#10

Lol ok, hope I helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)