Jump to content

Scoreboard Colum and other question


#Paper

Recommended Posts

Mhh don't show any error, but don't works:

addEvent("onPlayerPickupRacePickup") 
function sevehicle() 
setElementData ( source, "Vehicle", getElementModel ( getVehicleOccupant ( source ) ) ) 
end 
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),sevehicle) 

How i can make that /login command and /register command, to use a gui instead not?

Link to comment

1. you're not checking if pickup is a vehiclechange

2. you're getting vehicleOccupant of a player (source is player here), use getPedOccupiedVehicle()

3. no need to get player's vehicle/id, if you're using vehicle change

addEvent("onPlayerPickupRacePickup") 
  function sevehicle(pID, pType, vehicleID) 
    if vehicleID then 
      setElementData(source, "Vehicle", tostring(vehicleID))    
    end 
  end 
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),sevehicle) 

though if you want to update this on every pickup type:

addEvent("onPlayerPickupRacePickup") 
  function sevehicle() 
    local vehicleID = getElementModel(getPedOccupiedVehicle(source)) 
    if vehicleID then 
      setElementData(source, "Vehicle", tostring(vehicleID)) 
    end 
  end 
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),sevehicle) 

as for second question: there were some «login gui» resources in the community, search it or script one yourself.

PS: you also may want to try using https://wiki.multitheftauto.com/wiki/Get ... eFromModel to set vehicle name instead of ID.

Link to comment
1. you're not checking if pickup is a vehiclechange

2. you're getting vehicleOccupant of a player (source is player here), use getPedOccupiedVehicle()

3. no need to get player's vehicle/id, if you're using vehicle change

addEvent("onPlayerPickupRacePickup") 
  function sevehicle(pID, pType, vehicleID) 
    if vehicleID then 
      setElementData(source, "Vehicle", tostring(vehicleID))    
    end 
  end 
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),sevehicle) 

though if you want to update this on every pickup type:

addEvent("onPlayerPickupRacePickup") 
  function sevehicle() 
    local vehicleID = getElementModel(getPedOccupiedVehicle(source)) 
    if vehicleID then 
      setElementData(source, "Vehicle", tostring(vehicleID)) 
    end 
  end 
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),sevehicle) 

as for second question: there were some «login gui» resources in the community, search it or script one yourself.

PS: you also may want to try using https://wiki.multitheftauto.com/wiki/Get ... eFromModel to set vehicle name instead of ID.

ty, can you modifi the scritp whit the vehicle's name instad the ID? :D

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...