13.07.2010, 06:40
Код:
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);
}
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... =(

