Error 25 - 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: Error 25 (
/showthread.php?tid=590436)
Error 25 -
Hybris - 29.09.2015
Hello may I please get a hand whenever I attempt to compile I get this error
Код:
include\rnpc.inc(539) : error 025: function heading differs from prototype
OnPlayerSpawn
Код:
ApplyAnimation(playerid, "BOMBER", "null", 0, 0, 0, 0, 0, 1);
ApplyAnimation(playerid, "PED", "null", 0, 0, 0, 0, 0, 1);
if(IsPlayerNPC(playerid))
{
new spawn = random(sizeof(ZombieSpawns));
SetPlayerPos(playerid, ZombieSpawns[spawn][0], ZombieSpawns[spawn][1], ZombieSpawns[spawn][2]);
SetRNPCHealth(playerid, ZOMBIE_HEALTH);
SetPlayerSkin(playerid, ZOMBIE_SKIN);
SetPlayerColor(playerid, ZOMBIE_COLOR);
RNPC_SetShootable(playerid, 1);
RNPC_ToggleVehicleCollisionCheck(playerid, 1);
GetZombieVictimID[playerid] = INVALID_PLAYER_ID;
ZombiesAlive++;
ZombiesMax++;
return 1;
}
else
{
GetVictimDetectRange[playerid] = ZOMBIE_DETECT;
GetVictimTimerStatus[playerid] = 0;
}
OnPlayerSpawn in include
Код:
public OnPlayerSpawn(playerid) {
if (IsPlayerRNPC(playerid)) {
rnpcData[playerid][RNPC_HEALTH] = 100.0;
rnpcData[playerid][RNPC_DEAD] = 0;
}
#if defined RNPC_OnPlayerSpawn
return RNPC_OnPlayerSpawn(playerid);
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerSpawn
#undef OnPlayerSpawn
#else
#define _ALS_OnPlayerSpawn
#endif
#define OnPlayerSpawn RNPC_OnPlayerSpawn
forward RNPC_OnPlayerSpawn(playerid);
Please help me,also the identitations are correct but the forums messed them up.
Re: Error 25 -
CalvinC - 29.09.2015
Код:
ppublic OnPlayerSpawn(playerid) {
You wrote it with 2 P's, it should just be "public".
Re: Error 25 -
Hybris - 29.09.2015
I must've accidently added an extra p when i wrote the thread sorry