I hate this stupid problem !!!
#1

Hello guys.
So I have this stupid problem

I got the line(ondialogresponse)
PHP код:
    if (dialogid == 5)
    {
    new 
name[MAX_PLAYER_NAME], file[256];
    
GetPlayerName(playeridnamesizeof(name));
    
format(filesizeof(file), SERVER_USER_FILEname);
    if(!
response) return Kick(playerid);
    if(
response 15 && response 76)
      {
         
dini_IntSet(file,"Age",response);
    }
    if(
response 16 || response 75) return SendClientMessage(playerid,COLOR_RED,"[URP] : You have to be at least 16 years old And not oled then 75 old")&& ShowPlayerDialog(playerid5DIALOG_STYLE_INPUT"Please choose your age""Please enter your age below""Choose""Cancel");
     } 
So things that GOES RIGHT :
The dialog shows up with all the options I wanted.
and
it supouse to check if the player enters integer less then 16 or more then 75 it returns SendClientMessage and showdialog again.
It works.
It supouse to check if the player enters integer between 16 and 75 then it will dini_IntSet of the response .
but even when I do number that is between those two it still shows me the dialog again and SendClientMessage
What should I do ?
Thanks alot .
Reply
#2

Suppossing your using dialogs with inputtext, 'response' should be inputtext[0], this is probably the right code.

pawn Код:
if (dialogid == 5)
    {
    new name[MAX_PLAYER_NAME], file[256];

    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if(!response) return Kick(playerid);
    if(inputtext[0] > 15 && inputtext[0] < 76)
      {
         dini_IntSet(file,"Age",response);
    }
    if(inputtext[0] < 16 || inputtext[0] > 75) return SendClientMessage(playerid,COLOR_RED,"[URP] : You have to be at least 16 years old And not oled then 75 old"), ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Please choose your age", "Please enter your age below", "Choose", "Cancel");
     }
Ain't I right?
Reply
#3

pawn Код:
if (dialogid == 5)
    {
        if(!response) return Kick(playerid);
        new name[MAX_PLAYER_NAME], file[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);
        new value = strval(inputtext);
        if(value < 16 || value > 75)
        {
            SendClientMessage(playerid,COLOR_RED,"[URP] : You have to be at least 16 years old And not oled then 75 old");
            return ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Please choose your age", "Please enter your age below", "Choose", "Cancel");
        }
        dini_IntSet(file,"Age",value);
    }
Reply
#4

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
pawn Код:
if (dialogid == 5)
    {
        if(!response) return Kick(playerid);
        new name[MAX_PLAYER_NAME], file[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);
        new value = strval(inputtext);
        if(value < 16 || value > 75)
        {
            SendClientMessage(playerid,COLOR_RED,"[URP] : You have to be at least 16 years old And not oled then 75 old");
            return ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Please choose your age", "Please enter your age below", "Choose", "Cancel");
        }
        dini_IntSet(file,"Age",value);
    }
This is the right code, I apologize.
Reply
#5

NVM GUYS ... FIXED IT . Thanks alot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)