Advertisement
Guest User

Untitled

a guest
Feb 5th, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | None | 0 0
  1. addEventHandler( 'onClientVehicleEnter', root,
  2.     function( pPlayer )
  3.         if pPlayer == localPlayer then
  4.             addVehicleUpgrade( source, 1010 )
  5.             outputChatBox( 'Nitro installed' )
  6.         end
  7.     end
  8. )
  9.  
  10. addCommandHandler( 'nitro_count',
  11.     function( _, sCount )
  12.         local pVehicle = getPedOccupiedVehicle( localPlayer )
  13.         if pVehicle then
  14.             setVehicleNitroCount( pVehicle, tostring( sCount ) )
  15.         end
  16.     end
  17. )
  18.  
  19. addCommandHandler( 'nitro_level',
  20.     function( _, sCount )
  21.         local pVehicle = getPedOccupiedVehicle( localPlayer )
  22.         if pVehicle then
  23.             setVehicleNitroLevel( pVehicle, tostring( sCount ) )
  24.         end
  25.     end
  26. )
  27.  
  28. addCommandHandler( 'nitro_activated',
  29.     function( _, sValue )
  30.         local pVehicle = getPedOccupiedVehicle( localPlayer )
  31.         if pVehicle then
  32.             setVehicleNitroActivated( pVehicle, sValue == 'true' and true or false )
  33.         end
  34.     end
  35. )
  36.  
  37.  
  38. addEventHandler( 'onClientRender', root,
  39.     function()
  40.         if isPedInVehicle( localPlayer ) then
  41.             local pVehicle = getPedOccupiedVehicle( localPlayer )
  42.             if pVehicle then
  43.                 local fNitroLevel           = getVehicleNitroLevel( pVehicle )
  44.                 local iNitroCount           = getVehicleNitroCount( pVehicle )
  45.                 local bIsNitroRecharging    = isVehicleNitroRecharging( pVehicle )
  46.                 local bIsNitroActivated     = isVehicleNitroActivated( pVehicle )
  47.                
  48.                 dxDrawText( 'Nitro level = ' .. tostring( fNitroLevel ), 700, 100 )
  49.                 dxDrawText( 'Nitro count = ' .. tostring( iNitroCount ), 700, 150 )
  50.                 dxDrawText( 'Nitro recharging = ' .. tostring( bIsNitroRecharging ), 700, 200 )
  51.                 dxDrawText( 'Nitro ativated = ' .. tostring( bIsNitroActivated ), 700, 250 )
  52.             end
  53.         end
  54.     end
  55. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement