08.05.2015, 01:39
I want the server to show 2 global map icons whenever a player enters a certain vehicle(export system)
and then I want the server to remove them map icons as soon as the player exits that vehicle.
I almost had it working, except there was 1 problem.
Whenever I exited the vehicle, both the global map icons would disappear, which is good,
but then another random map icon in range of me would disappear, eg (ammunation icon) etc.
First off, I use streamer map icons. But for these 2 global map icons, i used SetPlayerMapIcon.
could they be interfering with each other? (i have around 170 streamer map icons)
here are some snippets of my code:
and then I want the server to remove them map icons as soon as the player exits that vehicle.
I almost had it working, except there was 1 problem.
Whenever I exited the vehicle, both the global map icons would disappear, which is good,
but then another random map icon in range of me would disappear, eg (ammunation icon) etc.
First off, I use streamer map icons. But for these 2 global map icons, i used SetPlayerMapIcon.
could they be interfering with each other? (i have around 170 streamer map icons)
here are some snippets of my code:
PHP код:
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
{
RemovePlayerMapIcon(playerid, 1); // export ls
RemovePlayerMapIcon(playerid, 2); // export sf
}
PHP код:
if(GetVehicleModel(vehicleid) == 535)
{
if(sold1 == 0) //not sold
{
SetPlayerMapIcon(playerid, 1, 2801.4045,-2348.7034,13.6276, 55, 0, MAPICON_GLOBAL ); // Export LS
SetPlayerMapIcon(playerid, 2, -1545.0740,128.1534,3.5547, 55, 0, MAPICON_GLOBAL ); // Export SF
GameTextForPlayer(playerid,"Slamvan",3000,1);
SendClientMessage(playerid, LIME, "You Can Sell This Vehicle for $5000 At any Export Crane!");
}
else if(sold1 == 1) // sold
{
GameTextForPlayer(playerid,"Slamvan",3000,1);
SendClientMessage(playerid, RED, "This Vehicle has already been Exported! Use /exlist to See the Current List.");
}
}