Hide player blips on entering interiors
I'm not sure if it should be posted here or elsewhere as it's not an include or filterscript.
Just a proof-of-concept, which could be possibly modified or enhaced to fit one's needs.
It can be put either in FS or GM.
The thing is that if You enter certain interior and do not change the virtual world, Your blip will be still seen by other players and it will most likely be missplaced.
This tiny piece of code is ought to hide Your blip on entering interiors and re-show it when getting out.
Код:
// Hide player blips on entering interiors fix for samp 0.3
new gPlayerOldColor[MAX_PLAYERS]; // temp var if we need to change the color for a sec
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) {
// Entering interiors: hide player blip
if(oldinteriorid == 0) {
gPlayerOldColor[playerid] = GetPlayerColor(playerid);
SetPlayerColor(playerid, ( gPlayerOldColor[playerid] & 0xFFFFFF00 ));
}
// Leaving interiors: restore player blip
else if(newinteriorid == 0) SetPlayerColor(playerid, gPlayerOldColor[playerid]);
return true;
}
Or use the pastebin link here:
http://pastebin.com/f2ea7ab9a
It has a small bug, which re-enables the blip while player's char is still playing their "getting out of the interior" anim, so the blip will be missplaced on leaving interiors for a sec or two. It can be easily solved with timers, but i was too lazy... ;]
Also be carefull if Your gamemode/scripts has some other invisibility-applying functions as they may possibly colide with this.