SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/11/2013, 04:46 PM   #1
Bost
Little Clucker
 
Join Date: Oct 2011
Posts: 47
Reputation: 0
Default Help please.

I got this code:
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:
Code:
F:\Games\Game-Mode\...\...\gamemodes\riv.pwn(3319) : error 004: function "SafeSetPlayerInterior" is not implemented
How can I fix it?
__________________
Boooooooooooooooooooooooooo
Bost is offline   Reply With Quote
Old 29/11/2013, 04:49 PM   #2
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,831
Reputation: 1401
Default Re: Help please.

This error is given because you have forwarded SafeSetPlayerInterior, but you don't have the public function in the script.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 29/11/2013, 04:58 PM   #3
Bost
Little Clucker
 
Join Date: Oct 2011
Posts: 47
Reputation: 0
Default Re: Help please.

And how to solve it?
__________________
Boooooooooooooooooooooooooo
Bost is offline   Reply With Quote
Old 29/11/2013, 05:16 PM   #4
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,831
Reputation: 1401
Default Re: Help please.

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

Look for something like:
pawn Code:
public SafeSetPlayerInterior( ... ) // parameters..
{
    // code..
}

and if you find it, then add it to your script (after the forward line).
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 04:31 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.