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



Errors - Anzhelov - 07.01.2011

Код:
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.



Re: Errors - Doom8890 - 07.01.2011

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;



Re: Errors - Anzhelov - 07.01.2011

Код:
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.



Re: Errors - John_F - 07.01.2011

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.


Re: Errors - Anzhelov - 07.01.2011

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.


Re: Errors - John_F - 07.01.2011

What errors? I got none.


Re: Errors - Anzhelov - 07.01.2011

Код:
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.



Re: Errors - John_F - 07.01.2011

What is line 614, line 620 and line 621?


Re: Errors - Anzhelov - 07.01.2011

Код:
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;
}



Re: Errors - John_F - 07.01.2011

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