SA-MP Forums Archive
[HELP]Problem syntax.. - 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: [HELP]Problem syntax.. (/showthread.php?tid=349418)



[HELP]Problem syntax.. - TheBluec0de - 08.06.2012

Error:

Код:
syntax error in the expression, or invalid function call
Line:

Код:
format(string, sizeof(string), "%s: %s", name, playerid, text);
Part of script. it's in OnPlayerText

Код:
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
            {
                format(string, sizeof(string), "%s: %s", name, playerid, text);
                SendClientMessageToAll(GetPlayerColor(playerid), string);
                return 0;
            }
            return 0;
        }
    }



Re: [HELP]Problem syntax.. - Jefff - 08.06.2012

pawn Код:
format(string, sizeof(string), "%s %d: %s", name, playerid, text);
and remove return 0; both


Re: [HELP]Problem syntax.. - TheBluec0de - 08.06.2012

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
format(string, sizeof(string), "%s %d: %s", name, playerid, text);
and remove return 0; both
thanks