SA-MP Forums Archive
Whats wrong? - 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: Whats wrong? (/showthread.php?tid=193341)



Whats wrong? - Tutrix - 25.11.2010

Hey, i am scripting a gm, and when i did this command, i get alot of errors.

pawn Код:
if(strcmp(cmd, "/enterpg" true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerToPoint(3.0, playerid, 142.1577,1875.4176,17.8434))
            {
                if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
                {
                    SetPlayerPos(playerid, 246.783996,63.900199,1003.640625);
                    SetPlayerInterior(playerid, 6);
                    SendClientMessage(playerid, COLOR_GREEN, " Welcome to Prison Guards HQ! ");
                }
                else if (PlayerInfo[playerid][pMember] == 0 || PlayerInfo[playerid][pLeader] == 0)
                {
                    SetPlayerPos(playerid, 142.1577,1875.4176,17.8434);
                    SendClientMessage(playerid, COLOR_RED, "ERROR: You are not authorized to enter this building");
                    return 1;
                    }
                }
Thanks, alex


Re: Whats wrong? - Haydz - 25.11.2010

i think there should be a ! before strcmp, not sure havn't used strcmp is awhile.
pawn Код:
if(!strcmp(cmd, "/enterpg" true) == 0)
and you have 5 open brackets, and 3 closed brackets so you will need to close 2 of them.


Re: Whats wrong? - Tutrix - 25.11.2010

Well the brackets worked, but now i get this errors:

Код:
C:\Users\Jesus\Downloads\samp03bsvr_R2_win32\gamemodes\gf.pwn(16202) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Jesus\Downloads\samp03bsvr_R2_win32\gamemodes\gf.pwn(16202) : warning 215: expression has no effect
C:\Users\Jesus\Downloads\samp03bsvr_R2_win32\gamemodes\gf.pwn(16202) : error 001: expected token: ";", but found ")"
C:\Users\Jesus\Downloads\samp03bsvr_R2_win32\gamemodes\gf.pwn(16202) : error 029: invalid expression, assumed zero
C:\Users\Jesus\Downloads\samp03bsvr_R2_win32\gamemodes\gf.pwn(16202) : fatal error 107: too many error messages on one line
on
pawn Код:
if(!strcmp(cmd, "/enterpg" true) == 0)



Re: Whats wrong? - Fj0rtizFredde - 25.11.2010

You dont need the ! if you still want it then it should look like:
pawn Код:
if(!strcmp(cmdtext, "/enterpg", true))
{
    //Catfood here!
}



Re: Whats wrong? - Haydz - 25.11.2010

edit: you posted the line lol

and yeh, move try removing ! then.


Re: Whats wrong? - Tutrix - 25.11.2010

Worked perfectly, thanks :P

if(!strcmp(cmdtext, "/enterpg", true))
{
//Catfood here!
}

lol kattmatt :P