Dialog Response getting error (Invalid expression assumed 0)
#1

Code:
if(dialogid == 22 && response)
	{
		new cashdeposit = strval(inputtext[]);
		new droppername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, droppername, sizeof(droppername));

		if(cashdeposit <= 0)
		{
			return 1;
		}
		
		if(cashdeposit > PlayerInfo[playerid][pPot])
		{
			ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "House Safes by:Qeux", "You Don't have that much Pot with you", "Done", "Close");
			return 1;
		}
		PlayerInfo[playerid][pPot] -= cashdeposit;
		PlayerInfo[playerid][pSafePot] += cashdeposit;
		format(string, sizeof(string), "%s places some drugs in a safe.", droppername);
		ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "House Safes by:Qeux", string, "Done", "Close");
		ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		printf("%s", string);
		return 1;
	}
this is basically for someone placing drugs into their safe... i'm getting an error on this part
Code:
new cashdeposit = strval(inputtext[]);
do you see why this would be an invalid expression.. i'm guessing because i don't fully understand inputtext[]... basically they are entering a multiple digit number and i want that number toe be equal to cashdeposit so i can withdraw and deposit stuff...
Reply
#2

Code:
new cashdeposit = strval(inputtext);
Reply
#3

fucking genius... and within 4 minutes also
Reply
#4

pawn Code:
new cashdeposit = strval(inputtext[]); //For a text
new cashdeposit = strval(inputtext); //For a value
And, I think he's not a fucking genius, just a genius xD
Reply
#5

Quote:
Originally Posted by Qeux
fucking genius... and within 4 minutes also
Quote:
Originally Posted by Jakku
pawn Code:
new cashdeposit = strval(inputtext[]); //For a text
new cashdeposit = strval(inputtext); //For a value
And, I think he's not a fucking genius, just a genius xD
Lol glad to help.

Btw, inputtext is itself a string isn't it? If you want to use the string, you don't use strval at all.
Reply
#6

Inputtext[] is a string. It will output the thing you write to the dialog and press OK- button.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)