SA-MP Forums Archive
[HELP] 2 Error That Waist My All Time - 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: [HELP] 2 Error That Waist My All Time (/showthread.php?tid=384807)



[HELP] 2 Error That Waist My All Time - M3mPHi$_S3 - 13.10.2012

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


Re : [HELP] 2 Error That Waist My All Time - yusei - 13.10.2012

Код:
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;  

}



Re: [HELP] 2 Error That Waist My All Time - M3mPHi$_S3 - 13.10.2012

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


Re: [HELP] 2 Error That Waist My All Time - Ghost_Boii - 13.10.2012

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;  




Re: [HELP] 2 Error That Waist My All Time - M3mPHi$_S3 - 13.10.2012

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



Re: [HELP] 2 Error That Waist My All Time - Joshman543 - 13.10.2012

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



Re: [HELP] 2 Error That Waist My All Time - M3mPHi$_S3 - 13.10.2012

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



Re: [HELP] 2 Error That Waist My All Time - Lordzy - 13.10.2012

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.


Re: [HELP] 2 Error That Waist My All Time - M3mPHi$_S3 - 13.10.2012

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



Re: [HELP] 2 Error That Waist My All Time - Niko_boy - 13.10.2012

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 ...,