"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(playerid, params[])
{
new Float:pz, Float:x, Float:y, Float:z;
GetPlayerFacingAngle(playerid, pz);
GetPlayerPos(playerid, Float:x, Float:y, Float:z);
if(PlayerInfo[playerid][pClass] >= 2)
{
GetXYInFrontOfPlayer(playerid, Float:x,Float:y, 1.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(playerid, params[])
{
new Float:pz, Float:x, Float:y, Float:z;
GetPlayerFacingAngle(playerid, pz);
GetPlayerPos(playerid, Float:x, Float:y, Float: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!