Pickup Script help Rep+
#4

Quote:
Originally Posted by Breto
Посмотреть сообщение
First of all , You have to Add at the Top ,
PHP код:
new health
, Then , Under ongamemodeinit , Add :
PHP код:
health CreateDynamicPickup(1240X,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;
    }
Reply


Messages In This Thread
Pickup Script help Rep+ - by boyan96 - 01.02.2012, 18:24
Re: Pickup Script help Rep+ - by -CaRRoT - 01.02.2012, 18:37
Re: Pickup Script help Rep+ - by boyan96 - 01.02.2012, 18:40
Re: Pickup Script help Rep+ - by KingHual - 01.02.2012, 18:43
Re: Pickup Script help Rep+ - by boyan96 - 01.02.2012, 18:47

Forum Jump:


Users browsing this thread: 1 Guest(s)