brackets error...
#1

pawn Код:
if (strcmp("/enter", cmdtext, true, 10) == 0)
    if(IsPlayerInRangeOfPoint(playerid, 7.0, -207.19999695,1119.19995117,20.10000038)
    {
    SetPlayerPos(playerid, -2158.80004883,642.90002441,1052.00000000);
    SetPlayerInterior(playerid, 1);
    GameTextForPlayer(playerid,"~b~DMV ~w~Office", 3000, 4);
    return 1;
    }
    if (strcmp("/exit", cmdtext, true, 10) == 0)
    if(IsPlayerInRangeOfPoint(playerid, 7.0, -2158.80004883,642.90002441,1052.00000000)
    {
    SetPlayerPos(playerid, -207.19999695,1119.19995117,20.10000038);
    SetPlayerInterior(playerid, 0);
    return 1;
    }
    return 0;
}
Quote:

C:\Users\Luca\Desktop\BaseNorton V2\gamemodes\license.pwn(85) : error 001: expected token: ")", but found "{"
C:\Users\Luca\Desktop\BaseNorton V2\gamemodes\license.pwn(93) : error 001: expected token: ")", but found "{"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

How to fix please?
Reply
#2

first line :
pawn Код:
if (strcmp("/enter", cmdtext, true, 10) == 0) {
Second line:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, -207.19999695,1119.19995117,20.10000038) )
Swap these for yours.

EDIT: I just noticed your other range check is missing a closing bracket ')' too.

EDIT2: There's more wrong ill edit your code now.
Reply
#3

thanks!
Reply
#4

Proper indentation will help avoid these errors.

pawn Код:
if (strcmp("/enter", cmdtext, true, 10) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0, -207.19999695,1119.19995117,20.10000038) )
    {
        SetPlayerPos(playerid, -2158.80004883,642.90002441,1052.00000000);
        SetPlayerInterior(playerid, 1);
        GameTextForPlayer(playerid,"~b~DMV ~w~Office", 3000, 4);
        return 1;
    }
   
}
else if (strcmp("/exit", cmdtext, true, 10) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 7.0, -2158.80004883,642.90002441,1052.00000000) )
    {
        SetPlayerPos(playerid, -207.19999695,1119.19995117,20.10000038);
        SetPlayerInterior(playerid, 0);
        return 1;
    }
}
That should be inside OnPlayerCommandText. In your version the "/exit" command will never be executed since its inside the "/enter" command.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)