SA-MP Forums Archive
error 001: expected token: ";", but found ")" - 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: error 001: expected token: ";", but found ")" (/showthread.php?tid=615661)



error 001: expected token: ";", but found ")" - Izaki - 25.08.2016

PHP код:
CMD:ban(playeridparams[])
{
    new 
idreason[128];
     if(
IsPlayerAdmin(playerid) || pInfo[playerid][pAdminLevel] >= 3)
    {
        new 
string[256];
        if(
sscanf(params"us[128]"id,reason)) return SendClientMessage(playeridCOLOR_WHITE,"Usage: /ban [playerid] [reason/codes]");
        else if(
id == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_WHITE"Invalid ID");
        else
        
TogglePlayerControllable(id0);
        
format(stringsizeof(string), "** Server: {F81414}%s is banned from serve by administator %s! Reason: %s!", ,PlayerName(id), ,PlayerName(playerid), reason);
        
SendClientMessageToAll(COLOR_WHITEstring);
         
ClearChatForPlayer(id);
        
format(stringsizeof(string), "Name: ~w~%s"PlayerName(id));
        
TextDrawSetString(BanNamestring);
        
format(stringsizeof(string), "Administrator: ~w~%s"PlayerName(playerid));
        
TextDrawSetString(BanAdministratorstring);
        
format(stringsizeof(string), "Reason: ~w~%s"reason);
        
TextDrawSetString(BanReasonstring);
        
TextDrawShowForPlayer(idBanBox);
        
TextDrawShowForPlayer(idBanName);
        
TextDrawShowForPlayer(idBanAdministrator);
        
TextDrawShowForPlayer(idBanReason);
        
CustomBan(idplayeridreason);
    }
    else 
SendClientMessage(playeridCOLOR_RED"* You are not authorized to use this command!");
    return 
1;




Re: error 001: expected token: ";", but found ")" - DarkSkull - 25.08.2016

PHP код:
format(stringsizeof(string), "** Server: {F81414}%s is banned from serve by administator %s! Reason: %s!"PlayerName(id), PlayerName(playerid), reason); 
You had extra commas


Re: error 001: expected token: ";", but found ")" - EgyptForLife - 25.08.2016

Fix this line.
PHP код:
format(stringsizeof(string), "** Server: {F81414}%s is banned from serve by administator %s! Reason: %s!", ,PlayerName(id), ,PlayerName(playerid), reason); 
Replace it with:
PHP код:
format(stringsizeof(string), "** Server: {F81414}%s is banned from serve by administator %s! Reason: %s!"PlayerName(id), PlayerName(playerid), reason);