Author Topic: Buy Heal/Armour  (Read 2378 times)

2204

  • Newbie
  • *
  • Posts: 46
  • Karma: +4/-2
    • View Profile
Buy Heal/Armour
« on: May 12, 2018, 11:05:48 pm »
As the title suggests you can buy a heal (Health = 100%) or Armour.

Adapt this to your script however you want to, change 5000/8000 if you think it's too much or too little

Code: [Select]
else if ( szCommand == "heal" ) {
if ( pPlayer.Health != 100 && pPlayer.Cash >= 5000)
{
pPlayer.Health = 100;
pPlayer.Cash -= 5000;
MessagePlayer( "Purchased a heal for $5000. Remaining cash: $" + pPlayer.Cash + ".", pPlayer);
}
else if ( pPlayer.Health == 100)
{
MessagePlayer( "You already have full health!", pPlayer);
}
else if ( pPlayer.Cash < 5000)
{
MessagePlayer( "You don't have enough money!", pPlayer);
}
}

else if ( szCommand == "armour" || szCommand == "armor" ) {
if ( pPlayer.Armour != 100 && pPlayer.Cash >= 8000)
{
pPlayer.Armour = 100;
pPlayer.Cash -= 8000;
MessagePlayer( "Purchased armour for $8000. Remaining cash: $" + pPlayer.Cash + ".", pPlayer);
}
else if ( pPlayer.Armour == 100)
{
MessagePlayer( "You already have full armour!", pPlayer);
}
else if ( pPlayer.Cash < 8000)
{
MessagePlayer( "You don't have enough money!", pPlayer);
}
}
Things to do:
Make a stunting server

 

© Liberty Unleashed Team.