Errors
#1

Код:
if (strcmp("/lsa", cmdtext, true, 10) == 0)
    {
    IsPlayerAdmin(playerid);
    }
    {
    SetPlayerPos(playerid, 1990.6156,-2335.7556,13.5469);
    SetPlayerFacingAngle(playerid, 82.8390);
    SendClientMessage(playerid, COLOR_GREEN, "You have been teleported.");
    }
    else SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not Administrator/Moderator");
    return 1;
    }
    return 0;
}
Код:
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(621) : error 029: invalid expression, assumed zero
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(624) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

Try this:
pawn Код:
if (strcmp("/lsa", cmdtext, true, 10) == 0)
    {
    IsPlayerAdmin(playerid);
    {
    SetPlayerPos(playerid, 1990.6156,-2335.7556,13.5469);
    SetPlayerFacingAngle(playerid, 82.8390);
    SendClientMessage(playerid, COLOR_GREEN, "You have been teleported.");
    }
    else SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not Administrator/Moderator");
    return 1;
    }
    return 0;
Reply
#3

Код:
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(620) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

pawn Код:
if (strcmp("/lsa", cmdtext, true, 10) == 0)
    {
        if(IsPlayerAdmin(playerid) == 1)
        {
        SetPlayerPos(playerid, 1990.6156,-2335.7556,13.5469);
        SetPlayerFacingAngle(playerid, 82.8390);
        SendClientMessage(playerid, COLOR_GREEN, "You have been teleported.");
        }
    else return SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not Administrator/Moderator");

    return 0;
}
You need an if statement if you want to use an else, and you need to put the statement in the form of a condition.
Reply
#5

Quote:
Originally Posted by John_F
Посмотреть сообщение
pawn Код:
if (strcmp("/lsa", cmdtext, true, 10) == 0)
    {
        if(IsPlayerAdmin(playerid) == 1)
        {
        SetPlayerPos(playerid, 1990.6156,-2335.7556,13.5469);
        SetPlayerFacingAngle(playerid, 82.8390);
        SendClientMessage(playerid, COLOR_GREEN, "You have been teleported.");
        }
    else return SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not Administrator/Moderator");

    return 0;
}
You need an if statement if you want to use an else, and you need to put the statement in the form of a condition.
I got 6 errors when I try this way.
Reply
#6

What errors? I got none.
Reply
#7

Код:
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(614) : warning 215: expression has no effect
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(614) : error 001: expected token: ";", but found ")"
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(614) : error 029: invalid expression, assumed zero
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(614) : warning 215: expression has no effect
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(620) : error 029: invalid expression, assumed zero
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(620) : warning 215: expression has no effect
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(620) : error 001: expected token: ";", but found "return"
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\SA-MP 0.3c Server\gamemodes\SmackDownTDM.pwn(621) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#8

What is line 614, line 620 and line 621?
Reply
#9

Код:
if (strcmp("/lsa", cmdtext, true, 10) == 0)
{
IsPlayerAdmin(playerid) == 1);
{
SetPlayerPos(playerid,1990.6156,-2335.7556,13.5469);
SetPlayerFacingAngle(playerid, 82.8390);
SendClientMessage(playerid, COLOR_GREEN, "You have been teleported.");
}
else return SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not Administrator/Moderator");
return 1;
}
return 0;
}
Reply
#10

-.- Specify which is line 614, line 620 and line 621, and did you copy/paste my code exactly as it is?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)