SA-MP Forums Archive
Give me error - 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: Give me error (/showthread.php?tid=608808)



Give me error - Loinal - 05.06.2016

this code when i try to compile it it give me errors

Code:
PHP код:
CMD:highoff(playerid,params[])
{
  if(
pInfo[playerid][pLevel] >= 5)
  {
  new 
target;
  if(
sscanf(params,"us[100]",target)) return SendClientMessage(playerid,red,"USAGE: /highoff [playerid]");
  if(
MegaJump[target] == 1)
  {
    new 
string[134];
    
format(string,sizeof(string),"* Admin %s Has Disabled For you HighJump",GetName(playerid));
    
MegaJump[target] = 0;
    }
    else if(
MegaJump[target] == 0)
    {
        
SendClientMessage(playerid, -1"This Player Not Using /highjump Now");
    }
   return 
1;
   }
   else return 
ShowMessage(playerid,red,1);
   }
   else return 
ShowMessage(playerid,red,2);
   } 
Errors:
PHP код:
D:\samp folder\XtremeX-Stunting\filterscripts\JLadmin.pwn(9125) : error 010invalid function or declaration 
Line Error:
PHP код:
else return ShowMessage(playerid,red,2); 



Re: Give me error - Infinity - 05.06.2016

I'm starting to feel like a broken record, but work on your indentation. If you would have done that, you would have seen that the code is formatted wrongly, and that the last ShowMessage(...), which causes an error, is not part of the command.


Re: Give me error - Loinal - 05.06.2016

what should i do in it


Re: Give me error - Infinity - 05.06.2016

Quote:
Originally Posted by Loinal
Посмотреть сообщение
what should i do in it
Step 1:
Indent your code

Step 2:
When you are doing so, you will notice something is wrong. Fix that.

Step 3:
Done.


Re: Give me error - Loinal - 05.06.2016

Thanks


Re: Give me error - Lucky13 - 05.06.2016

Код:
CMD:highoff(playerid,params[])
{
  	if(pInfo[playerid][pLevel] >= 5)
  	{
  		new target;
  		if(sscanf(params,"u",target)) return SendClientMessage(playerid,red,"USAGE: /highoff [playerid]");
  		if(!IsPlayerConnected(target)) return SendClientMessage(playerid,red,"Player not connected);
  		if(MegaJump[target] == 1)
  		{
    		        new string[68];
    		        format(string,sizeof(string),"* Admin %s Has Disabled For you HighJump",GetName(playerid));
    		        SendClientMessage(target,red,string);
    		        MegaJump[target] = 0;
    	        }
    	        else { SendClientMessage(playerid, -1, "This Player Not Using /highjump Now"); }
   }
   else { SendClientMessage(playerid,red," You're not an admin with the required level!"); }
   return 1;
}