SA-MP Forums Archive
Mapicons for properties - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mapicons for properties (/showthread.php?tid=71999)



Mapicons for properties - Rks25 - 05.04.2009

Guys,

As you all may know, i have an script named nitrosfreeroam. So now this is my question:
The script has a very difficult propertysystem. And i want to set mapicons for it.
So green if not bought and red if bought.
But the difficult part is , it gets saved in the players.txt's.. And a player can buy/over-buy/sell
So i couldn't succeed in it.
And offcourse we also need a streamer, Double-O-Icons seems to be a good one.

Can someone help me with this?

I am willing to pm the link of script to you.


Re: Mapicons for properties - [M2S]moe - 05.04.2009

A good place to start would be to tell us how you load the entrance coordinates for your properties.


Re: Mapicons for properties - Rks25 - 05.04.2009

the entrances don't get loaded as they get in rp scripts.
Like entrancex and entrancey. But this is a different 0.1 script.


Re: Mapicons for properties - [M2S]moe - 05.04.2009

They have to get loaded if you're saving properties. There must be some enum somewhere with coordinates for properties?


Re: Mapicons for properties - MenaceX^ - 05.04.2009

Find a good map icons streamer for beginning.


Re: Mapicons for properties - Rks25 - 05.04.2009

Quote:
Originally Posted by MenaceX^
Find a good map icons streamer for beginning.
Double-O-Icons

Quote:
Originally Posted by [M2S
moe ]
They have to get loaded if you're saving properties. There must be some enum somewhere with coordinates for properties?
There is no enum but there is array with coordinates. Wait, i have an link with more info.

Edit: this is the link
http://forum.sa-mp.com/index.php?topic=16435.0


Re: Mapicons for properties - [M2S]moe - 05.04.2009

so this array, use this to set your map icons.

I dont know how this streamer works, so its hard to tell you where to add the code, but if you have an array with the proper coordinates, for example:

Float:HouseCoords[2][3] = {
{0.0,0.0,0.0},
{0.0,0.0,0.0}
};

(obviously it must have more coords, exit etc, I just put entrance only to help you understand how to use this)



use that array to add your map icons OnGameModeInit:

SetPlayerMapIcon(playerid, iconid, HouseCoords[houseid][0], HouseCoords[houseid][1], HouseCoords[houseid][2], markertype, color);

where "houseid" = the house ID (0 = first line in HouseCoords, 1 = second line, etc).

Do you understand how it works?


Re: Mapicons for properties - Rks25 - 05.04.2009

yes i could have also come this far, but how to change when overbought and sold and bought. How to change it than?


Re: Mapicons for properties - [M2S]moe - 05.04.2009

The default value given to propertyOwner[property] for a property not owned seems to be 999 (again, I dont know your script so correct this as you see fit).

So, all you need to do under OnGameModeInit:

if(propertyOwner[property] > 999) // which means the house is owned
{
SetPlayerMapIcon(icon for house owned);
}
else SetPLayerMapIcon(icon for house not owned);


Re: Mapicons for properties - Rks25 - 05.04.2009

but that will only keep it at start of gamemode.
so if someone buys it in game, i will have to wait for restart, to see a red icon?