SA-MP Forums Archive
Dialog error - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog error (/showthread.php?tid=264473)



Dialog error - bartje01 - 26.06.2011

Hey guys
Why do I have this error?
pawn Код:
if(dialogid == RULES2)
    {
        if(response) {
        if(strval(inputtext) == "I agree that I will always follow the rules in any situation.")
        {
        ShowPlayerDialog(playerid,RULES2,DIALOG_STYLE_INPUT,"Rules","IC:\n- You're not allowed to rob players from level 1.\n- You're not allowed to rob more then $5.000,-\n- You're not allowed to scam more then $15.000,-\n- You're not allowed to bunnyhop to go faster.\n- You're not allowed to metagame or powergame\n- You're not allowed to quickshoot.\nTo agree to our rules type in the following sentence:\nI agree that I will always follow the rules in any situation.","Agree","Disagree");
        }
    }
        else
        {
            Kick(playerid);
        }
        return 1;
    }


    return 1;
}
Код:
C:\Users\Bart\Desktop\infinityrp\gamemodes\infinityrp.pwn(664) : error 033: array must be indexed (variable "-unknown-")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.


if(strval(inputtext) == "I agree that I will always follow the rules in any situation.")



Re: Dialog error - PrawkC - 26.06.2011

To compare strings you use strcmp, not strval.


Re: Dialog error - bartje01 - 26.06.2011

Same error


Re: Dialog error - PrawkC - 26.06.2011

Did you make it like
pawn Код:
if( !strcmp(inputtext ,  "I agree that I will always follow the rules in any situation.", true) )
That?


Re: Dialog error - bartje01 - 26.06.2011

Thanks it works