Command problem.
#1

We have the command:

pawn Код:
if(strcmp(cmd, "/exam", true) == 0)
{
   
    if(PlayerToPoint(2.0,playerid,2045.9504,-1913.1392,13.5469))
    {
        if(PlayerInfo[playerid][pDrivingLicense] == 1)
        {
        SendClientMessage(playerid, 0xFFFFFFFFFF, "{CC0066}[DMV]: {FFFFFF}You already have a driving license!");
        }
        else
        {
        SendClientMessage(playerid, 0xFFFFFFFFFF, "{CC0066}[DMV]: {FFFFFF}Get in a car and follow the checkpoints!");
        CP[playerid] = DMV;
        }
    }
    else
    {
    SendClientMessage(playerid, 0xFFFFFFFFFF, "{CC0066}[DMV]: {FFFFFF}You are not at DMV. I have placed a checkpoint to DMV, go there to get your driving license.");
    SetPlayerCheckpoint(playerid, 2045.9504,-1913.1392,13.5469, 2.0);
    CP[playerid] = 1;
    }  
    return 1;
}
and the errors:

Код:
(325) : error 010: invalid function or declaration
(328) : error 010: invalid function or declaration
(330) : error 010: invalid function or declaration
(334) : error 010: invalid function or declaration
(340) : error 010: invalid function or declaration
(346) : error 010: invalid function or declaration
and the lines:

pawn Код:
325: if(strcmp(cmd, "/exam", true) == 0)
328: if(PlayerToPoint(2.0,playerid,2045.9504,-1913.1392,13.5469))
330: if(PlayerInfo[playerid][pDrivingLicense] == 1)
334: else
340: else
346: return 1;

Sorry for my bad english, thank you.
Reply
#2

Is this CMD inside OnPlayerCommandText ?
Reply
#3

"cmd" needs to be "cmdtext"
Reply
#4

Show us your OnPlayerCommandText,
it might be a Bracket problem
Reply
#5

Big hint, if you're writing a script, don't use string compare, use zcmd.

Also...
pawn Код:
if(PlayerToPoint(2.0,playerid,2045.9504,-1913.1392,13.5469))
Maybe you've defined it elsewhere, but it should look like
pawn Код:
if(IsPlayerInRangeOfPoint(2.0, playerid, 2045.9504, -1913.1392, 13.5469))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)