SA-MP Forums Archive
Help please. - 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: Help please. (/showthread.php?tid=478423)



Help please. - Bost - 29.11.2013

I got this code:
Код:
public Spectator()
{
	new string[350];
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(Spectate[i] != 255)
			{
				new targetid = Spectate[i];
				if(IsPlayerConnected(targetid))
				{
				    if(PlayerInfo[i][pAdmin] >= 1)
				    {
				        new Float:health,Float:armour,Float:health2;
					    new name[MAX_PLAYER_NAME];
					    new money = GetPlayerMoney(targetid);
					    new carid = GetPlayerVehicleID(targetid);
					    new kmh = GetPlayerSpeed(targetid, true);
					    new bankmoney = PlayerInfo[targetid][pAccount];
					    GetPlayerName(targetid, name, sizeof(name));
					    GetPlayerHealth(targetid, health);
					    GetPlayerArmour(targetid, armour);
					    GetVehicleHealth(carid, health2);
					    if(!IsPlayerInAnyVehicle(targetid))
					    {
					        format(string, sizeof(string),"~p~- ~h~%s (ID: %d) ~p~-~n~~n~~n~ ~b~Health: ~w~%.1f ~g~:-: ~b~Armour: ~w~%.1f ~n~ ~b~Money: ~w~$%d ~g~:-: ~b~Bank: ~w~$%d",name,targetid,health,armour,money,bankmoney);
						    TextDrawSetString(Textdraw54[i],string);
						}
						else
						{
						    format(string, sizeof(string),"~p~- ~h~%s (ID: %d) ~p~-~n~~n~~n~ ~b~Health: ~w~%.1f ~g~:-: ~b~Armour: ~w~%.1f ~n~ ~b~Money: ~w~$%d ~g~:-: ~b~Bank: ~w~$%d ~n~~n~~g~---------------------------------------------------~n~~n~ ~b~Vehicle ID: ~w~%d ~b~Vehicle HP: ~w~%.1f ~n~~n~~b~Speed: ~w~%d",name,targetid,health,armour,money,bankmoney,carid,health2,kmh);
						    TextDrawSetString(Textdraw54[i],string);
						}
				    }
					if(GetPlayerInterior(targetid) > 0)
					{
						SafeSetPlayerInterior(i,GetPlayerInterior(targetid));
					}
					if(GetPlayerVirtualWorld(targetid) > 0)
					{
						SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(targetid));
					}
				}//Targetid connected
			}
		}
	}
}
And I get this error:
Код:
F:\Games\Game-Mode\...\...\gamemodes\riv.pwn(3319) : error 004: function "SafeSetPlayerInterior" is not implemented
How can I fix it?


Re: Help please. - Konstantinos - 29.11.2013

This error is given because you have forwarded SafeSetPlayerInterior, but you don't have the public function in the script.


Re: Help please. - Bost - 29.11.2013

And how to solve it?


Re: Help please. - Konstantinos - 29.11.2013

You got SafeSetPlayerInterior from somewhere, so it should have the public function there as well.

Look for something like:
pawn Код:
public SafeSetPlayerInterior( ... ) // parameters..
{
    // code..
}
and if you find it, then add it to your script (after the forward line).