SHARE
TWEET

Untitled

a guest Aug 14th, 2019 39 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public OnPlayerUpdate(playerid)// This is a part of a very simply script made by Jujuv
  2. {
  3.     if(GetPlayerState(playerid) == 2)
  4.     {
  5.         new Float:vehHealth;// we crate a new var (type Float value 0.0)
  6.         new Float:playerArmour;//we create a new var (type floatvalue 0.0)
  7.         new curentVeh = GetPlayerVehicleID(playerid);//Get the vehicle (id) of the player (and store it in curentVeh)
  8.         GetVehicleHealth(curentVeh, vehHealth);//Get the vehicle health and store it in vehHealth(value returned e.g: 2500.2)
  9.         vehHealth = vehHealth/10;// we divide the value of vehHealth per 10
  10.         SetPlayerHealth(playerid, vehHealth);//Set the health of the vehicle at the health of the player(value e.g : 250)
  11.         if(GetPlayerArmour(playerid,playerArmour) != 0)// if the armour of the playerArmour is not equal at 0 (player have armour)
  12.         {
  13.         SetPlayerArmour(playerid,0);//Set the armour ofthe player at 0 ("delete his armour")
  14.         SetPlayerHealth(playerid, vehHealth);//Set the health of the vehicle at the health of the player
  15.         }
  16.     }
  17.  
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top