SetPlayerMapIcon under Public
#1

Код:
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"
Reply
#2

loop through all the players (for i loop)
Reply
#3

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;
}
Reply
#4

Looped it now it does complines but it dont shows the marker on the map ^^
Reply
#5

*bump*

EDIT: It works now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)