Jump to content

Few questions.


Bleidex

Recommended Posts

Well i have some problems and i didn't think out how to fix them ;/

Keys won't get binded:

function repair ( thePlayer ) 
    playerVehicle = getPlayerOccupiedVehicle ( thePlayer ) 
    if ( playerVehicle ) then 
        setElementHealth ( playerVehicle, 999 ) 
    else 
        return 
    end 
end 
addCommandHandler ( "repair", repair ) 
  
function nos ( thePlayer ) 
    playerVehicle = getPlayerOccupiedVehicle ( thePlayer ) 
    if ( playerVehicle ) then 
        addVehicleUpgrade ( playerVehicle, 1010 ) 
    else 
        return 
    end 
end 
addCommandHandler ( "nos", nos ) 
  
function bindKeys ( player, commandName ) 
    bindKey ( player, "2", "down", repair ) 
    bindKey ( player, "LMB", "down", nos ) 
end 
addEventHandler ( "onPlayerLogin", getRootElement(), bindKeys ) 

Also. I mapped few cars and so on for my server. They are in .map file. And if I take any car and explode it, it won't respawn until I restart the map. How to make that they would respawn?

Link to comment
function repair ( thePlayer ) 
  
    playerVehicle = getPedOccupiedVehicle ( thePlayer ) 
    if (playerVehicle) then 
        fixVehicle ( playerVehicle ) 
    else 
  end 
end 
  
addCommandHandler ( "repair", repair ) 
  
function nos ( thePlayer ) 
  
    if (playervehicle) then 
        addVehicleUpgrade ( playerVehicle, 1010 ) 
    else 
  end 
end 
  
addCommandHandler ( "nos", nos ) 
  
function bindKeys ( thePlayer, commandName ) 
  
    bindKey ( thePlayer, "2", "down", repair ) 
    bindKey ( thePlayer, "mouse1", "down", nos ) 
  
end 
  
  
addEventHandler ( "onPlayerLogin", getRootElement(), bindKeys ) 

The meta.xml should be as server-side, not client-side. Report back, tell me if it worked.

Edited by Guest
Link to comment
function repair ( thePlayer ) 
  
    playerVehicle = getPedOccupiedVehicle ( thePlayer ) 
    if playerVehicle then 
        fixVehicle ( playerVehicle ) 
    else 
  end 
end 
  
addCommandHandler ( "repair", repair ) 
  
function nos ( thePlayer ) 
  
    if playervehicle then 
        addVehicleUpgrade ( playerVehicle, 1010 ) 
    else 
  end 
end 
  
addCommandHandler ( "nos", nos ) 
  
function bindKeys ( thePlayer, commandName ) 
  
    bindKey ( thePlayer, "2", "down", repair ) 
    bindKey ( thePlayer, "mouse1", "down", nos ) 
  
end 
  
  
addEventHandler ( "onPlayerLogin", getRootElement(), bindKeys ) 

The meta.xml should be as server-side, not client-side. Report back, tell me if it worked.

Meta is server-sided, haven't tested this yet, but /repair and /nos worked fine before, just binds didn't.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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