Whats wrong?
#1

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
Reply
#2

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.
Reply
#3

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)
Reply
#4

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

edit: you posted the line lol

and yeh, move try removing ! then.
Reply
#6

Worked perfectly, thanks :P

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

lol kattmatt :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)