Little help. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Little help. (
/showthread.php?tid=354337)
Little help. -
Littlehelper - 26.06.2012
Hello,
I don't know what's wrong with this code.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new str[128];
switch(dialogid)
{
case 250:
{
if(response)
{
if(strval(str) < 1 || strval(str) > 60) return ShowPlayerDialog(playerid,250,DIALOG_STYLE_INPUT,"Test","{FF00EA}Test Age?\n{FF00EA}You're Age Must Be Between 1-60!","Okay","");
PutPlayerInVehicle(playerid,v_ID,3);
TogglePlayerControllable(playerid, 1);
FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10);
}
}
}
return 1;
}
Am i doing something wrong?
Thank you.
Re: Little help. -
Littlehelper - 26.06.2012
Quote:
Originally Posted by Hydra_Farrell123
if(strval(str) < 1 || strval(str) > 60) return ShowPlayerDialog(playerid,250,DIALOG_STYLE_INPUT," Test","{FF00EA}Test Age?\n{FF00EA}You're Age Must Be Between 1-60!","Okay","("));
Take the last " Out it may work then.
( I have placed a bracket around it.
|
What?
Re: Little help. -
JonnyDeadly - 26.06.2012
No that means there isn't a 2nd button. Do you receive any warnings? If so post them.
Re: Little help. -
MadeMan - 26.06.2012
What is the problem?
Re: Little help. -
Littlehelper - 26.06.2012
There are no any warnings and/or errors.
whenever i type age in my dialog (which is under 60) it says "Your Age Must Be Under 1-60"
Re: Little help. -
AdamCooper - 26.06.2012
Quote:
Originally Posted by Littlehelper[MDZ]
Hello,
I don't know what's wrong with this code.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new str[128]; switch(dialogid) { case 250: { if(response) { if(strval(str) < 1 || strval(str) > 60) return ShowPlayerDialog(playerid,250,DIALOG_STYLE_INPUT,"Test","{FF00EA}Test Age?\n{FF00EA}You're Age Must Be Between 1-60!","Okay",""); PutPlayerInVehicle(playerid,v_ID,3); TogglePlayerControllable(playerid, 1); FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10); } } } return 1; }
Am i doing something wrong?
Thank you.
|
pawn Код:
if(dialogid == 250)
{
if(response)
{
SendClientMessage(playerid, COLOR_YELLOW, "Your age? Your age must be between 1-60!");
PutPlayerInVehicle(playerid,v_ID,3);
TogglePlayerControllable(playerid, 1);
FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10);
}
return 1;
}
What is this cmd anyway?
Re: Little help. -
Roko_foko - 26.06.2012
replace every str with inputtext
Re: Little help. -
MadeMan - 26.06.2012
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new str[128];
switch(dialogid)
{
case 250:
{
if(response)
{
new value = strval(inputtext);
if(value < 1 || value > 60) return ShowPlayerDialog(playerid,250,DIALOG_STYLE_INPUT,"Test","{FF00EA}Test Age?\n{FF00EA}You're Age Must Be Between 1-60!","Okay","");
PutPlayerInVehicle(playerid,v_ID,3);
TogglePlayerControllable(playerid, 1);
FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10);
}
}
}
return 1;
}
Re: Little help. -
Littlehelper - 26.06.2012
Quote:
Originally Posted by AdamCooper
pawn Код:
if(dialogid == 250) { if(response) { SendClientMessage(playerid, COLOR_YELLOW, "Your age? Your age must be between 1-60!"); PutPlayerInVehicle(playerid,v_ID,3); TogglePlayerControllable(playerid, 1); FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10); } return 1; }
What is this cmd anyway?
|
Checkpoint.
Re: Little help. -
mkr - 26.06.2012
Edit: beaten already
Change this:
Код:
if(strval(str) < 1 || strval(str) > 60)
to this:
Код:
if(strval(inputtext) < 1 || strval(inputtext) > 60)
You're declaring str and not doing anything with it, so strval(str) is evaluating to 0.