error 001: expected token: ";", but found "if"
#1

am getting a error

Код:
error 001: expected token: ";", but found "if"
Код:
public OnPlayerText(playerid, text[])
{
    SpamTimer[playerid] = SetTimerEx("DecreaseSpam",MAX_DECREASECOUNT*1000,1,"d",playerid)
    if(PlayerSpam[playerid] < MAX_SPAM)
    {
    PlayerSpam[playerid] ++;
    }
    else if(PlayerSpam[playerid] >= MAX_SPAM)//If the player spam is bigger than or equal to the max spam allowed!
    {
    new TalkString[120],string[120];
    //WE FORMAT THE STRING
    format(string,sizeof(string),"[ANTI-CHEAT] Player: %s ID: %d Has been Kicked Reason: SPAM",GetName(playerid),playerid);
    //THEN WE SEND IT TO EVERYONE!
    SendClientMessageToAll(-1,string);
    format(TalkString,sizeof(TalkString),"You Have Been Kicked By Anti Cheat!\nReason:SPAM");
    //we are going to show the dialog to the player
    ShowPlayerDialog(playerid,DIALOG_ANTI,DIALOG_STYLE_MSGBOX,"Anti Cheat!",TalkString,"Okay","");
    //we set the playerspam to 0 so it wont mix with other players when they connect!
    PlayerSpam[playerid] = 0;
    //we kill the timer!
    KillTimer(SpamTimer[playerid]);
    //Then we kick the player!
    Kick(playerid);
    }
	return 1;
}
Код:
 line 270 if(PlayerSpam[playerid] < MAX_SPAM)
Reply
#2

line 270 if(PlayerSpam[playerid] < MAX_SPAM);

You forgot to add a ;

rep if worked
Reply
#3

Код:
G:\Pawno\gamemodes\cod.pwn(293) : loose indentation
G:\Pawno\gamemodes\cod.pwn(472) : error 001: expected token: ";", but found "if"
G:\Pawno\gamemodes\cod.pwn(472) : error 036: empty statement
G:\Pawno\gamemodes\cod.pwn(476) : error 029: invalid expression, assumed zero
G:\Pawno\gamemodes\cod.pwn(476) : warning 215: expression has no effect
G:\Pawno\gamemodes\cod.pwn(476) : error 001: expected token: ";", but found "if"
G:\Pawno\gamemodes\cod.pwn(568) : loose indentation
G:\Pawno\gamemodes\cod.pwn(639) : loose indentation
G:\Pawno\gamemodes\cod.pwn(686) : warning 209: function "OnPlayerUpdate" should return a value
G:\Pawno\gamemodes\cod.pwn(151) : symbol is never used: "PlayerStatsTimer"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2016, ITB CompuPhase


4 Errors.
Reply
#4

You have forgot a ';' in the upper line
Код:
SpamTimer[playerid] = SetTimerEx("DecreaseSpam",MAX_DECREASECOUNT*1000,1,"d",playerid);
added a `;` in last. The semi-colon; indicates an statement's end.



Quote:
Originally Posted by Wreeper
Посмотреть сообщение
rep if worked
His posts are below 50 his rep power is 0.
Reply
#5

thanks cool
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)