a Error that i need help to clear.
#1

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
Reply
#2

You forgot to add a {right after the loop.
Reply
#3

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;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)