"function heading differs from prototype"
#1

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!
Reply
#2

PHP код:
forward RemoveLadders(playerid); 
Reply
#3

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..
Reply
#4

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

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;

Reply
#6

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

Nevermind that, it's fixed. Thanks again!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)