Some errors[Giving REP]
#1

Hello,

Can you help me fixing this command:

pawn Код:
CMD:tc(playerid,params[])
{
     new str[128],message[100],Nam[MAX_PLAYER_NAME];
     if(sscanf(params,"%s[100]",message)) return SendClientMessage(playerid,-1,"USAGE: /teamchat [text]");
     GetPlayerName(playerid,Nam,sizeof(Nam));
     format(str,sizeof(str),"[TEAM CHAT] %s: %s",Nam,message);
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
     if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT);
     {
        SendClientMessage(i, COLOR_BLUE, str);
     }
     else if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT2);
     {
        SendClientMessage(i, COLOR_BLUE, str);
     }
     else if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT3);
     {
        SendClientMessage(i, COLOR_BLUE, str);
     }
     else if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT4);
     {
        SendClientMessage(i, COLOR_BLUE, str);
     }
     else if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT5);
     {
        SendClientMessage(i, COLOR_BLUE, str);
     }
     }
     return 1;
}
Here are the warnings:

pawn Код:
C:\Documents and Settings\Administrator\My Documents\Downloads\3hab\gamemodes\DriftGM1.pwn(2313) : error 036: empty statement
C:\Documents and Settings\Administrator\My Documents\Downloads\3hab\gamemodes\DriftGM1.pwn(2317) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\My Documents\Downloads\3hab\gamemodes\DriftGM1.pwn(2317) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\My Documents\Downloads\3hab\gamemodes\DriftGM1.pwn(2317) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\Administrator\My Documents\Downloads\3hab\gamemodes\DriftGM1.pwn(2317) : error 036: empty statement
C:\Documents and Settings\Administrator\My Documents\Downloads\3hab\gamemodes\DriftGM1.pwn(2317) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Reply
#2

Bump.
Reply
#3

Wich line is it?
Reply
#4

pawn Код:
else if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT2);
That, Hm I appreciate if you reformat the whole command for me :3.
Reply
#5

You have ";" symbol on each line of "if" or "else if", delete that symbol.
pawn Код:
CMD:tc(playerid,params[])
{
     new str[128],message[100],Nam[MAX_PLAYER_NAME];
     if(sscanf(params,"%s[100]",message)) return SendClientMessage(playerid,-1,"USAGE: /teamchat [text]");
     GetPlayerName(playerid,Nam,sizeof(Nam));
     format(str,sizeof(str),"[TEAM CHAT] %s: %s",Nam,message);
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
     if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT); // DELETE that SYMBOL ;
     {
        SendClientMessage(i, COLOR_BLUE, str);
     }
     else if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT2); // DELETE that SYMBOL ;
     {
        SendClientMessage(i, COLOR_BLUE, str);
     }
     else if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT3); // DELETE that SYMBOL ;
     {
        SendClientMessage(i, COLOR_BLUE, str);
     }
     else if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT4); // DELETE that SYMBOL ;
     {
        SendClientMessage(i, COLOR_BLUE, str);
     }
     else if(PlayerInfo[playerid][pTeam] == TEAM_DRIFT5); // DELETE that SYMBOL ;
     {
        SendClientMessage(i, COLOR_BLUE, str);
     }
     }
     return 1;
}
EDIT: Your code is written wrong, in case you want me to fix it, let me know.
Reply
#6

You Kept ; Symbol After Every 'If' and 'else if' Remove the Symbol
Reply
#7

@Toreno, Thanks a lot man! bad me ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)