Posts: 2,286
Threads: 18
Joined: Jun 2010
Quote:
Originally Posted by Breto
First of all , You have to Add at the Top , , Then , Under ongamemodeinit , Add :
PHP код:
health = CreateDynamicPickup(1240, X,Y,Z,VW); // Replace the X Y Z VW with Your Cordinates and Virtural World
- Now. under OnPlayerPickupPickup , Add :
PHP код:
if(pickupid == health)
{
SetPlayerHealth(playerid,100);
GivePlayerMoney(playerid,-1000);
SendClientMessage(playerid,COLOR,"You have Bought Health");
return 1;
}
And you are done
|
Even though, it will work even if the player has - 120120210 money... You also need to check if the player's money is more than 1000.
pawn Код:
if(pickupid == health)
{
if (GetPlayerMoney(playerid) < 1000)
{
SetPlayerHealth(playerid,100);
GivePlayerMoney(playerid,-1000);
SendClientMessage(playerid,COLOR,"You have Bought Health");
}
return 1;
}