Jump to content

Ayuda /fix


Recommended Posts

quiero que este script no funcione si el player no tiene money... actualmente cualquiera lo usa sin money..

function mamamia (player, command) 
local auto = getPedOccupiedVehicle(player) 
fixVehicle(auto) 
local prachy = getPlayerMoney(player) 
    if prachy > 2000 then 
        takePlayerMoney(player, 2000) 
        outputChatBox("Your vehicle has been fixed - 2000$.  You have $" ..  getPlayerMoney(player), player, 0, 255, 0) 
else 
        outputChatBox("You don't have a 2000$", player, 250, 0, 0 ) 
end 
end 
  
addCommandHandler("fix", mamamia)  

podria usar esto?

setElementPosition 

Link to comment

Intena probando con el que uso yo

  function repair(source) 
    if isPedInVehicle(source) then 
      if ( getPlayerMoney (source) >= 5000 ) then 
        takePlayerMoney(source, 5000) 
        fixVehicle(getPedOccupiedVehicle(source)) 
        outputChatBox("Has Comprado Repair por $5000.", source, 0, 255, 0, true) 
      else 
        outputChatBox("No tienes suficiente dinero para realizar esta acción.", source, 255, 0, 0, true) 
      end      
    else 
      outputChatBox("No estas en un vehiculo.", source, 255, 0, 0, true) 
    end 
  end 
  addCommandHandler('fixcar', repair) 

Link to comment
function mamamia (player, command) 
local prachy = getPlayerMoney(player) 
local auto = getPedOccupiedVehicle(player) 
    if auto and prachy >= 2000 then 
        fixVehicle(auto) 
        takePlayerMoney(player, 2000) 
        outputChatBox("Your vehicle has been fixed - 2000$.  You have $" ..  getPlayerMoney(player), player, 0, 255, 0) 
else 
        outputChatBox("You don't have a 2000$", player, 250, 0, 0 ) 
end 
end 
  
addCommandHandler("fix", mamamia) 

Tenias el fixVehicle arriba del if por lo que reparaba el auto aun o no tengas la plata.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...