1 error - 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)
+--- Thread: 1 error (
/showthread.php?tid=508492)
1 error -
Tuntun - 22.04.2014
Код:
CMD:annc(playerid, params[])
{
if (PInfo[playerid][LoggedIn] == true)
{
if (PInfo[playerid][PlayerLevel] < 1)
{
new msg[200];
if (sscanf(params, "s[200]", msg)) return SendClientMessage(playerid, -1, "Usage: /annc [message/announce]");
if (IsPlayerConnected(playerid))
{
GameTextForAll(msg, 5000, 0);
}
}
else return SendClientMessage(playerid, -1, "{FF0000}ERROR: you need to be atleast admin level 3 to use this command");
return 1;
}
errors:
Код:
E:\WOT\gamemodes\555.pwn(21642) : warning 217: loose indentation
E:\WOT\gamemodes\555.pwn(21651) : error 030: compound statement not closed at the end of file (started at line 21636)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
but there is no line : 21651
Re: 1 error -
Tadas - 22.04.2014
pawn Код:
CMD:annc(playerid, params[])
{
if (PInfo[playerid][LoggedIn] == true)
{
if (PInfo[playerid][PlayerLevel] < 1)
{
new msg[200];
if (sscanf(params, "s[200]", msg)) return SendClientMessage(playerid, -1, "Usage: /annc [message/announce]");
if (IsPlayerConnected(playerid))
{
GameTextForAll(msg, 5000, 0);
}
}
else
{
return SendClientMessage(playerid, -1, "{FF0000}ERROR: you need to be atleast admin level 3 to use this command");
}
}
return 1;
}
+Rep me if I help you
Re: 1 error -
Conradus - 22.04.2014
Your indentation is wrong and you forgot to close one if statement:
pawn Код:
CMD:annc(playerid, params[])
{
if (PInfo[playerid][LoggedIn] == true)
{
if (PInfo[playerid][PlayerLevel] < 1)
{
new msg[200];
if (sscanf(params, "s[200]", msg)) return SendClientMessage(playerid, -1, "Usage: /annc [message/announce]");
if (IsPlayerConnected(playerid))
{
GameTextForAll(msg, 5000, 0);
}
}
else return SendClientMessage(playerid, -1, "{FF0000}ERROR: you need to be atleast admin level 3 to use this command");
}
return 1;
}