SA-MP Forums Archive
Help me pls - 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 me pls (/showthread.php?tid=606491)



Help me pls - kevi11 - 05.05.2016

Error:
PHP код:
error 010invalid function or declaration 
Script:
PHP код:
CMD:fps(playerid,params[])
{
        if(
fpsON[playerid] == 0)
        {
            
PlayerPlaySound(playerid,1054,0.0,0.0,0.0),
            
TimerFPS SetTimerEx("AggiornaFPS"500true"i",playerid);
            
fpsON[playerid] = 1;
        }
        else if(
fpsON[playerid] == 1)
        {
            
PlayerPlaySound(playerid,1054,0.0,0.0,0.0),
            
KillTimer(TimerFPS);
            
fpsON[playerid] = 0;
            
TextDrawHideForPlayer(playeridFPS[playerid]);
        }
        return 
1;
    }
    return 
0;




Re: Help me pls - oMa37 - 05.05.2016

Which line is the error?


Re: Help me pls - N0FeaR - 05.05.2016

Try this

PHP код:
CMD:fps(playerid,params[])
{
    if(
fpsON[playerid] == 0)
     {
          
PlayerPlaySound(playerid,1054,0.0,0.0,0.0),
        
TimerFPS SetTimerEx("AggiornaFPS"500true"i",playerid);
         
fpsON[playerid] = 1;
      }
    else if(
fpsON[playerid] == 1)
       {
         
PlayerPlaySound(playerid,1054,0.0,0.0,0.0),
          
KillTimer(TimerFPS);
           
fpsON[playerid] = 0;
        
TextDrawHideForPlayer(playeridFPS[playerid]);
    }
     return 
1;




Re: Help me pls - kevi11 - 05.05.2016

Ty u so much

N0FeaR


Re: Help me pls - Dayrion - 05.05.2016

Never return 0 in a command! NEVER!


Re: Help me pls - xTURBOx - 05.05.2016

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Never return 0 in a command! NEVER!
actually you can, if you want "SERVER: unknown command"

the problem with his code was that he had and extra "}"