SA-MP Forums Archive
How to fix this? - 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: How to fix this? (/showthread.php?tid=278530)



How to fix this? - Tigerbeast11 - 22.08.2011

pawn Code:
dcmd_say(playerid,params[]) {
    if(IsPlayerCommandLevel(playerid,"say")) {
        if(!strlen(params)) return SendClientMessage(playerid,red,"Syntax Error: /say [text].");
        new string[256]; format(string,256,"%s"params);//Line 353
        return SendClientMessageToAll(grey,string);
    } else return SendLevelErrorMessage(playerid,"say");
}
Code:
XAdmin.pwn(353) : error 001: expected token: "-string end-", but found "-identifier-"
XAdmin.pwn(353) : warning 215: expression has no effect
XAdmin.pwn(353) : error 001: expected token: ";", but found ")"
XAdmin.pwn(353) : error 029: invalid expression, assumed zero
XAdmin.pwn(353) : fatal error 107: too many error messages on one line



Re: How to fix this? - RyDeR` - 22.08.2011

You forgot to add a ',', but you don't need format at all:
pawn Code:
dcmd_say(playerid,params[])
{
    if(IsPlayerCommandLevel(playerid, "say"))
    {
        if(!strlen(params))
            return SendClientMessage(playerid, red, "Syntax Error: /say [text].");
       
        return SendClientMessageToAll(grey, params);
    }
    return SendLevelErrorMessage(playerid, "say");
}



Re: How to fix this? - Tigerbeast11 - 22.08.2011

Thanks!