[HELP] 2 Error That Waist My All Time
#1

Hello friends ; i get this freaking error :

The lines are
PHP код:
  public OnPlayerCommandText(playeridcmdtext[])
{
    if((
P_DATAplayerid ][ P_InDM ] == )return SendErrorplayerid"[ERROR]: Cant use any commands while dming ..!!"));
    if((
P_DATAplayerid ][ P_Away ] == )return SendErrorplayerid"[ERROR]: use /back"));
    return 
1;

and the error is
Код:
F:\gamemodes\TE.pwn(5417) : error 001: expected token: ")", but found "return"
F:\\gamemodes\BE.pwn(5417) : error 001: expected token: ";", but found ")"
F:\\gamemodes\BE.pwn(5417) : error 029: invalid expression, assumed zero
F:\\gamemodes\BE.pwn(5417) : fatal error 107: too many error messages on one line
Please help me +1
Reply
#2

Код:
public OnPlayerCommandText(playerid, cmdtext[]) 
{ 
    if(P_DATA[ playerid ][ P_InDM ] == 0 )return SendError( playerid, "[ERROR]: Cant use any commands while dming ..!!"); 
    if(P_DATA[ playerid ][ P_Away ] == 0 )return SendError( playerid, "[ERROR]: use /back"); 
    return 1; 
} 

CMD:afk( playerid, params[] ) 
{ 
    if((P_DATA[ playerid ][ P_Away ] = !P_DATA[ playerid ][ P_Away ])) 
    SendClientMessage(playerid, COLOR_YELLOW, "You are now AFK, type /back to move again!"); 
    TogglePlayerControllable(playerid,0); 
    label[playerid] = Create3DTextLabel("AFK",yellow,30.0,40.0,50.0,40.0,0); 
    Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7); 

    new string3[164]; 
    new name[MAX_PLAYER_NAME]; 
    GetPlayerName(playerid, name, sizeof(name)); 
    format(string3, sizeof(string3), "{FF0000}[AFK INFO]: {FFFFFF}%s is now Away from the keyboard.{FF0000}(/afk)", name); 
    SendClientMessageToAll(COLOR_YELLOW, string3); 
    return 1;  

}
Reply
#3

What change did you make ? giving me again the same code with same error ?
Reply
#4

PHP код:
public OnPlayerCommandText(playeridcmdtext[]) 

    if(
PlayerInfoplayerid ][ P_InDM ] == )return SendErrorplayerid"[ERROR]: Cant use any commands while dming ..!!"); 
    if(
PlayerInfoplayerid ][ P_Away ] == )return SendErrorplayerid"[ERROR]: use /back"); 
    return 
1

CMD:afkplayeridparams[] ) 

    if((
PlayerInfoplayerid ][ P_Away ] = !P_DATAplayerid ][ P_Away ])) 
    
SendClientMessage(playeridCOLOR_YELLOW"You are now AFK, type /back to move again!"); 
    
TogglePlayerControllable(playerid,0); 
    
label[playerid] = Create3DTextLabel("AFK",yellow,30.0,40.0,50.0,40.0,0); 
    
Attach3DTextLabelToPlayer(label[playerid], playerid0.00.00.7); 
    new 
string3[164]; 
    new 
name[MAX_PLAYER_NAME]; 
    
GetPlayerName(playeridnamesizeof(name)); 
    
format(string3sizeof(string3), "{FF0000}[AFK INFO]: {FFFFFF}%s is now Away from the keyboard.{FF0000}(/afk)"name); 
    
SendClientMessageToAll(COLOR_YELLOWstring3); 
    return 
1;  

Reply
#5

This Error :
Код:
F:\\gamemodes\BE.pwn(5417) : error 017: undefined symbol "PlayerInfo"
F:\\gamemodes\BE.pwn(5417) : error 029: invalid expression, assumed zero
F:\\TE.pwn(5417) : error 029: invalid expression, assumed zero
F:\\gamemodes\BE.pwn(5417) : fatal error 107: too many error messages on one line
Reply
#6

Make sure that you define the symbol. For example:
Код:
new P_Away
Reply
#7

Now the lines are
PHP код:
    if((P_DATAplayerid ][ P_InDM ] == )return SendErrorplayerid"[ERROR]: Cant use any commands while dming ..!!")); 
and the error is
Код:
F:\Universal Stunting 0.3e (FinaL)\gamemodes\TE.pwn(5417) : error 001: expected token: ")", but found "return"
F:\\gamemodes\BE.pwn(5417) : error 001: expected token: ";", but found ")"
F:\\gamemodes\BE.pwn(5417) : error 029: invalid expression, assumed zero
F:\\gamemodes\BE.pwn(5417) : fatal error 107: too many error messages on one line
Reply
#8

Add this at top
PHP код:
enum pInfo
{
  
P_DATA,
  
P_Away,
};
new 
PlayerInfo[MAX_PLAYERS][pInfo]; 
It says undefined symbol, which means that you haven't created those variables/functions.
Reply
#9

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
Add this at top
PHP код:
enum pInfo
{
  
P_DATA,
  
P_Away,
};
new 
PlayerInfo[MAX_PLAYERS][pInfo]; 
It says undefined symbol, which means that you haven't created those variables/functions.
I am using this command on my game mode so it is already done it words for other not this one so please answer this
Quote:
Originally Posted by мυ∂υℓ_вacнα
Посмотреть сообщение
Now the lines are
PHP код:
    if((P_DATAplayerid ][ P_InDM ] == )return SendErrorplayerid"[ERROR]: Cant use any commands while dming ..!!")); 
and the error is
Код:
F:\Universal Stunting 0.3e (FinaL)\gamemodes\TE.pwn(5417) : error 001: expected token: ")", but found "return"
F:\\gamemodes\BE.pwn(5417) : error 001: expected token: ";", but found ")"
F:\\gamemodes\BE.pwn(5417) : error 029: invalid expression, assumed zero
F:\\gamemodes\BE.pwn(5417) : fatal error 107: too many error messages on one line
Reply
#10

so stop fake commenting
answer was easy ...
PHP код:
 if((P_DATAplayerid ][ P_InDM ] == )return SendErrorplayerid"[ERROR]: Cant use any commands while dming ..!!")); 
see there its very poorly braced up
so it should be
Код:
 if( P_DATA[ playerid ][ P_InDM ] == 0 ) return SendError( playerid, "[ERROR]: Cant use any commands while dming ..!!");
it will work now
u added an extra open ( and an extra ) closing brace over there ...,
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)