SetPlayerMapIcon under Public - 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: SetPlayerMapIcon under Public (
/showthread.php?tid=343422)
SetPlayerMapIcon under Public -
Jimbo01 - 17.05.2012
Код:
public MoneyBag()
{
new string[175];
if(!MoneyBagFound)
{
format(string, sizeof(string), "**The {33FF66} Money bag {FFFFFF}has {FF0000} not {FFFFFF} been found, it is still hidden in {FFFF66} %s", MoneyBagLocation);
SendClientMessageToAll(-1, string);
}
else if(MoneyBagFound)
{
MoneyBagFound = 0;
new randombag = random(sizeof(MBSPAWN));
MoneyBagPos[0] = MBSPAWN[randombag][XPOS];
MoneyBagPos[1] = MBSPAWN[randombag][YPOS];
MoneyBagPos[2] = MBSPAWN[randombag][ZPOS];
format(MoneyBagLocation, sizeof(MoneyBagLocation), "%s", MBSPAWN[randombag][Position]);
format(string, sizeof(string), "**The {33FF66}Money Bag has been {FF0000} hidden in {FFFF66} %s!", MoneyBagLocation);
SendClientMessageToAll(-1, string);
MoneyBagPickup = CreatePickup(1550, 2, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2], -1);
}
return 1;
}
SetPlayerMapIcon( playerid, 12, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2], 52, 0, MAPICON_GLOBAL );
How can i put SetPlayerMapicon under this function? It gives me error because "playerid"
Re: SetPlayerMapIcon under Public -
Yuryfury - 17.05.2012
loop through all the players (for i loop)
Re: SetPlayerMapIcon under Public -
Jimbo01 - 17.05.2012
is this right?
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerMapIcon( i, 12, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2], 52, 0, MAPICON_GLOBAL );
}
Код:
public MoneyBag()
{
new string[175];
if(!MoneyBagFound)
{
format(string, sizeof(string), "**The {33FF66} Money bag {FFFFFF}has {FF0000} not {FFFFFF} been found, it is still hidden in {FFFF66} %s", MoneyBagLocation);
SendClientMessageToAll(-1, string);
}
else if(MoneyBagFound)
{
MoneyBagFound = 0;
new randombag = random(sizeof(MBSPAWN));
MoneyBagPos[0] = MBSPAWN[randombag][XPOS];
MoneyBagPos[1] = MBSPAWN[randombag][YPOS];
MoneyBagPos[2] = MBSPAWN[randombag][ZPOS];
format(MoneyBagLocation, sizeof(MoneyBagLocation), "%s", MBSPAWN[randombag][Position]);
format(string, sizeof(string), "**The {33FF66}Money Bag has been {FF0000} hidden in {FFFF66} %s!", MoneyBagLocation);
SendClientMessageToAll(-1, string);
MoneyBagPickup = CreatePickup(1550, 2, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2], -1);
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetPlayerMapIcon( i, 12, MoneyBagPos[0], MoneyBagPos[1], MoneyBagPos[2], 52, 0, MAPICON_GLOBAL );
}
}
return 1;
}
Re: SetPlayerMapIcon under Public -
Jimbo01 - 17.05.2012
Looped it now it does complines but it dont shows the marker on the map ^^
Re: SetPlayerMapIcon under Public -
Jimbo01 - 18.05.2012
*bump*
EDIT: It works now