a Error that i need help to clear. - 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: a Error that i need help to clear. (
/showthread.php?tid=257828)
a Error that i need help to clear. -
Captain Price - 27.05.2011
Script:
Код:
if(!strcmp("/fc", cmdtext, true, 3))
{
for(new i=0; i < MAX_PLAYERS; i++)
new str[128], name[MAX_PLAYER_NAME];
if(faction[playerid] == 0)return SendClientMessage(playerid, Error, "аъд ма бчбецд");
if(!cmdtext[3])return SendClientMessage(playerid, Error, "*** /fc [text] ***");
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "Faction Chat|{FFFF00}%s: %s", name, str);
if(faction[i] == faction[playerid]) SendClientMessage(i, Blue, str);
return 1;
}
Errors:
Код:
C:\Users\Yuvalino\Desktop\Server\gamemodes\UltraDM.pwn(230) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Yuvalino\Desktop\Server\gamemodes\UltraDM.pwn(230) : error 017: undefined symbol "str"
C:\Users\Yuvalino\Desktop\Server\gamemodes\UltraDM.pwn(230) : warning 215: expression has no effect
C:\Users\Yuvalino\Desktop\Server\gamemodes\UltraDM.pwn(230) : error 001: expected token: ";", but found "]"
C:\Users\Yuvalino\Desktop\Server\gamemodes\UltraDM.pwn(230) : fatal error 107: too many error messages on one line
Re: a Error that i need help to clear. -
Snipa - 28.05.2011
You forgot to add a {right after the loop.
Respuesta: a Error that i need help to clear. -
Lunnatiicz - 28.05.2011
pawn Код:
if(!strcmp("/fc", cmdtext, true, 3))
{
for(new i=0; i < MAX_PLAYERS; i++)
{
new str[128], name[MAX_PLAYER_NAME];
if(faction[playerid] == 0)return SendClientMessage(playerid, Error, "аъд ма бчбецд");
if(!cmdtext[3])return SendClientMessage(playerid, Error, "*** /fc [text] ***");
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "Faction Chat|{FFFF00}%s: %s", name, str);
if(faction[i] == faction[playerid]) SendClientMessage(i, Blue, str);
}
return 1;
}