OnPlayerPickUpPickup
#1

Код:
new Moneybag1;
new Moneybag2;
new Moneybag3;
MR()
{
	new mbrand = random(3);
	if(mbrand == 0)
	{
	    MB1();
 	}
	else if(mbrand == 1)
	{
	    MB2();
	}
	else if(mbrand == 2)
	{
	    MB3();
	}
}
MB1()
{
	Moneybag1 = CreatePickup(1550, 2, -435.7654,-60.1194,58.8750);//  The Panopticon In Small Garage
	SendClientMessageToAll(green, "Money Rush! A Money Bag has been dropped in The Panoption.");
}
MB2()
{
	Moneybag2 = CreatePickup(1550, 2, 571.3318,824.5909,-29.8438);//  Hunter Quarry Under Ladder
	SendClientMessageToAll(green, "Money Rush! A Money Bag has been dropped in Hunter Quarry.");
}
MB3()
{
	Moneybag3 = CreatePickup(1550, 2, -2374.7766,2215.7478,4.9844);// Bayside Behind Light House
	SendClientMessageToAll(green, "Money Rush! A Money Bag has been dropped in Bayside.");
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    new name[MAX_PLAYER_NAME];
    new string[128];
    if(pickupid == Moneybag2)
	{
	    GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "%s (%i) has Found the Lost Money Bag in The Hunter Quarry that Worth $180000.",name,playerid);
		SendClientMessageToAll(green, string);
		GivePlayerMoney(playerid, 180000);
	}
	else if(pickupid == Moneybag3)
	{
		GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "%s (%i) has Found the Lost Money Bag in Bayside that Worth $200000.",name,playerid);
		SendClientMessageToAll(green, string);
		GivePlayerMoney(playerid, 200000);
	}
	else if(pickupid == Moneybag1)
	{
	    GetPlayerName(playerid, name, sizeof(name));
		format(string, sizeof(string), "%s (%i) has Found the Lost Money Bag in The Panoption that Worth $240000.",name,playerid);
		SendClientMessageToAll(green, string);
		GivePlayerMoney(playerid, 240000);
	}
	DestroyMR();
}
DestroyMR()
{
	DestroyPickup(Moneybag1);
	DestroyPickup(Moneybag2);
	DestroyPickup(Moneybag3);
}
everytime i pickup a "money bag" it says i have found it in The Hunter Quarry. it doesnt save the pickup id for some reason i think?

and if i switch the else if with if in onplayerpickup it sends all the three messages and gives me money for the 3 money bags.

pls help guys i cant figure this shit out... =(
Reply


Messages In This Thread
OnPlayerPickUpPickup - by jamesbond007 - 13.07.2010, 06:40
Re: OnPlayerPickUpPickup - by sTeAlthy [Brandon Brown] - 13.07.2010, 06:52
Re: OnPlayerPickUpPickup - by jamesbond007 - 13.07.2010, 07:00
Re: OnPlayerPickUpPickup - by jamesbond007 - 13.07.2010, 14:27
Re: OnPlayerPickUpPickup - by Grim_ - 13.07.2010, 14:29
Re: OnPlayerPickUpPickup - by sTreTcheD - 13.07.2010, 14:42
Re: OnPlayerPickUpPickup - by [XST]O_x - 13.07.2010, 15:02
Re: OnPlayerPickUpPickup - by DJDhan - 13.07.2010, 16:30
Re: OnPlayerPickUpPickup - by jamesbond007 - 13.07.2010, 16:44
Re: OnPlayerPickUpPickup - by jamesbond007 - 13.07.2010, 17:47

Forum Jump:


Users browsing this thread: 1 Guest(s)