Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Please read the post before reply, he's talking about 3D text, not 2D.
  2. El script deberia funcionar, algun error?
  3. Castillo

    MP3 URL

    addCommandHandler playSound
  4. Me parece que es obvio el porque, dartelo hecho no seria ayudar.
  5. getElementID does not return the model of the object, for that you need to use getElementModel. addEventHandler ( "onClientClick", root, function ( _, _, _, _, _, _, _, element ) if ( element and getElementType ( element ) == "object" ) then outputChatBox ( "ID: ".. getElementModel ( element ) ) end end )
  6. Aca no hacemos las cosas por los demas, tenes que intentar hacerlo y ahi te ayudamos si no funciona.
  7. Castillo

    Help please

    Are you completely sure?
  8. outputChatBox("* " .. .." welcome!", source,0,255,0,false)
  9. Castillo

    Help please

    You may have two resources managing kills.
  10. Ah, you mean a cutscene like the ones on the single player, that's possible, but you gotta use your imagination to do it. Functions you need: setCameraMatrix createPed setPedControlState
  11. That's wrong Max, he should use addCommandHandler.
  12. No errors? that's just impossible, because the second argument of "onPlayerVehicleEnter" is the seat you entered, not the vehicle Use 'source' instead of theVehicle on your functions.
  13. Well, what you did doesn't make any sense. You need the following functions: addCommandHandler getPlayerMoney takePlayerMoney giveWeapon outputChatBox
  14. The table contains all the compatible upgrades for the vehicle. Like: 1: upgrade ID 2: upgrade ID etc...
  15. Fort Carson comes from leaked valhalla scripts. Topic locked.
  16. Castillo

    DM Levels

    What is the element data update for? it's not even right.
  17. cars={} buycarpickup={} maxcars = 0 addEventHandler ( "onResourceStart", getResourceRootElement(), function () local root = xmlLoadFile ("cars.xml") local houseroot = xmlFindChild (root,"cars",0) if (houseroot) then for i,v in ipairs (xmlNodeGetChildren(houseroot)) do local carmodel = xmlNodeGetAttribute (v,"model") local x = xmlNodeGetAttribute (v,"x") local y = xmlNodeGetAttribute (v,"y") local z = xmlNodeGetAttribute (v,"z") local color1 = xmlNodeGetAttribute (v,"color1") local color2 = xmlNodeGetAttribute (v,"color2") local owner = xmlNodeGetAttribute (v,"owner") local price = xmlNodeGetAttribute (v,"price") local a = xmlNodeGetAttribute (v,"a") cars[i] = createVehicle ( tonumber(carmodel),tonumber(x),tonumber(y),tonumber(z), 0, 0, tonumber(a) ) setElementInterior ( cars[i], 0 ) setElementData (cars[i],"xpos",tonumber(x)) setElementData (cars[i],"ypos",tonumber(y)) setElementData (cars[i],"zpos",tonumber(z)) setElementData (cars[i],"angle",tonumber(a)) setElementData (cars[i],"owner",owner) setElementData (cars[i],"price",tonumber(price)) setElementData (cars[i], "num", i ) setVehicleColor ( cars[i], tonumber(color1), tonumber(color2), 0, 0 ) if getElementData ( cars[i], "owner" ) == "Nobody" then buycarpickup[i] = createPickup ( x, y, z, 3, 1274 ) attachElements ( buycarpickup[i], cars[i], 0, 0, 1.9 ) end maxcars = maxcars+1 end outputDebugString ("Cars loaded!") end end ) function saveCars () local root = xmlLoadFile ("cars.xml") local houseroot = xmlFindChild (root,"cars",0) if (houseroot) then for i,v in ipairs (xmlNodeGetChildren(houseroot)) do local color1, color2, color3, color4 = getVehicleColor ( cars[i] ) xmlNodeSetAttribute ( v, "model", getElementModel(cars[i]) ) xmlNodeSetAttribute ( v, "x", getElementData(cars[i], "xpos") ) xmlNodeSetAttribute ( v, "y", getElementData(cars[i], "ypos") ) xmlNodeSetAttribute ( v, "z", getElementData(cars[i], "zpos") ) xmlNodeSetAttribute ( v, "a", getElementData(cars[i], "angle") ) xmlNodeSetAttribute ( v, "color1", color1 ) xmlNodeSetAttribute ( v, "color2", color2 ) xmlNodeSetAttribute ( v, "owner", getElementData(cars[i], "owner") ) xmlNodeSetAttribute ( v, "price", getElementData(cars[i], "price") ) end xmlSaveFile(root) end end function adminCreateVehicle ( source, cmd ) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then local root = xmlLoadFile ("cars.xml") local houseroot = xmlFindChild (root,"cars",0) local createdcar = xmlCreateChild ( houseroot, "vehicle" ) local carmodel = xmlNodeSetAttribute ( createdcar, "model", "451" ) local x, y, z = getElementPosition ( source ) local xa,ya,a = getElementRotation ( source ) xmlNodeSetAttribute ( createdcar, "x", x ) xmlNodeSetAttribute ( createdcar, "y", y ) xmlNodeSetAttribute ( createdcar, "z", z ) xmlNodeSetAttribute ( createdcar, "a", a ) xmlNodeSetAttribute ( createdcar, "color1", "0" ) xmlNodeSetAttribute ( createdcar, "color2", "0" ) xmlNodeSetAttribute ( createdcar, "owner", "Nobody" ) xmlNodeSetAttribute ( createdcar, "price", "0" ) cars[maxcars+1] = createVehicle ( 451,x,y,z,0,0,a ) setElementData (cars[maxcars+1],"xpos",x) setElementData (cars[maxcars+1],"ypos",y) setElementData (cars[maxcars+1],"zpos",z) setElementData (cars[maxcars+1],"angle", a) setElementData (cars[maxcars+1],"owner","Nobody") setElementData (cars[maxcars+1],"price",0) xmlSaveFile(root) maxcars = maxcars+1 else outputChatBox ("Error: You can't use this command",source, 255,255,127 ) end end addCommandHandler ("acarcreate", adminCreateVehicle) addCommandHandler ("acarsave", saveCars) function getCar ( car ) return cars[car] end addEventHandler ( "onVehicleStartEnter", getRootElement(), function ( player, seat, jacked ) local playercar = source if ( seat == 0 ) then if (getElementData ( playercar, "owner" )) then if (getElementData ( playercar, "owner" ) == getAccountName(getPlayerAccount( player ))) then outputChatBox ("It is your car!",player, 255,255,127 ) else cancelEvent () outputChatBox ("This vehicle owner: "..getElementData ( playercar, "owner" ).."",player, 255,255,127 ) end elseif (getElementData ( playercar, "owner" ) ~= "Nobody" ) then local price = getElementData ( playercar, "price" ) triggerClientEvent ( player, "showBuyCar", player, price) toggleAllControls ( player, false, true, false ) end end end ) function AcceptToBuyCar ( ) local playercar = getPedOccupiedVehicle ( source ) if(getElementData ( playercar, "owner" ) == "Nobody") then if(getPlayerMoney ( source ) > tonumber(getElementData ( playercar, "price"))) then setElementData ( playercar, "owner", getAccountName(getPlayerAccount( source ))) takePlayerMoney ( source, tonumber(getElementData ( playercar, "price" ))) toggleAllControls ( source, true ) outputChatBox ("You buy this car!", source, 243,149,72 ) destroyElement(buycarpickup[getElementData(playercar,"num")]) saveCars () else outputChatBox ("Error: You don't have enought money", source, 243,149,72 ) setControlState ( source, "enter_exit", true ) end end end addEvent("acceptBuyCar",true) addEventHandler("acceptBuyCar",root,AcceptToBuyCar)
  18. Selling? that's the default dxscoreboard with different config.
  19. Go to "scoreboard/dxscoreboard_clientsettings.lua"
×
×
  • Create New...