SA-MP Forums Archive
"function heading differs from prototype" - 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: "function heading differs from prototype" (/showthread.php?tid=599052)



"function heading differs from prototype" - D1am0nd - 20.01.2016

Hello. So I am making a command, which creates a ladder, then after the 10 seconds, it gets destroyed. For some reason I'm getting an error after the re-compile. Although the includes from YSI are updated.


Here is the code:

PHP код:
forward RemoveLadders();
CMD:ladders(playeridparams[])
{
    new 
Float:pzFloat:xFloat:yFloat:z;
    
GetPlayerFacingAngle(playeridpz);
    
GetPlayerPos(playeridFloat:xFloat:yFloat:z);
    if(
PlayerInfo[playerid][pClass] >= 2)
    {
    
GetXYInFrontOfPlayer(playeridFloat:x,Float:y1.0);
    
CreateObject(1437,Float:x,Float:y,Float:z,-22.0,0.0,pz,500.0);
    
SetTimerEx("RemoveLadders"10000,false,"i",playerid);
    }
    return 
1;
}
public 
RemoveLadders(playerid)
{
  
DestroyObject(ladders[playerid]);
  return 
1;

The error is related to "public RemoveLadders(playerid)"

Please help me to fix this. Thanks in advance!


Re: "function heading differs from prototype" - BiosMarcel - 20.01.2016

PHP код:
forward RemoveLadders(playerid); 



Re: "function heading differs from prototype" - D1am0nd - 20.01.2016

Ah, what a silly mistake.. Thanks! +REP


P.S, Do you know how to remove the object? Because the code which I've provided under public RemoveLadders(playerid) does not work..


Re: "function heading differs from prototype" - BiosMarcel - 20.01.2016

PHP код:
ladders[playerid] = CreateObject.....
DestroyObject(ladders[playerid]); 



Re: "function heading differs from prototype" - D1am0nd - 20.01.2016

It doesn't destroy the ladder..

I made a command, to remove the ladder and see if something is wrong:

PHP код:
CMD:remladders(playeridparams[])
{
    new 
Float:pzFloat:xFloat:yFloat:z;
    
GetPlayerFacingAngle(playeridpz);
    
GetPlayerPos(playeridFloat:xFloat:yFloat:z);
    
    if(
PlayerInfo[playerid][pClass] >= 2)
    {
    
ladders[playerid] = CreateObject(1437,Float:x,Float:y,Float:z,-22.0,0.0,pz,500.0);
    
DestroyObject(ladders[playerid]);
    }
    return 
1;




Re: "function heading differs from prototype" - BiosMarcel - 20.01.2016

did u even create the ladder properly? and properly means just like i showed u


Re: "function heading differs from prototype" - D1am0nd - 20.01.2016

Nevermind that, it's fixed. Thanks again!