Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Claro que no va a funcionar con eso, porque no entras en un vehiculo, cambia el modelo nada mas, usa esto: local colors = { { 128, 255, 0 }, { 43, 25, 255 }, { 255, 2, 255 }, { 0, 255, 247 }, { 201, 255, 0 }, { 255, 0, 0 }, { 0, 81, 255 }, { 252, 255, 36 }, { 87, 16, 154 }, { 255, 94, 0 } } addEventHandler ( 'onVehicleEnter', root, function ( ) setVehicleColor ( source, unpack ( colors[ math.random ( #colors ) ] ) ) end ) addEvent ( "onPlayerPickUpRacePickup", true ) addEventHandler ( "onPlayerPickUpRacePickup", root, function ( pickupID, pickupType, vehicleModel ) if ( pickupType == "vehiclechange" ) then local theVehicle = getPedOccupiedVehicle ( source ) setVehicleColor ( theVehicle, unpack ( colors[ math.random ( #colors ) ] ) ) end end )
  2. Yo lo acabo de probar y funciona perfectamente.
  3. Talvez es porque los vehiculos aun no estan creados, usa esto: local colors = { { 128, 255, 0 }, { 43, 25, 255 } } addEventHandler ( 'onVehicleEnter', root, function ( ) setVehicleColor ( source, unpack ( colors[ math.random ( #colors ) ] ) ) end )
  4. local colors = { { 128, 255, 0 }, { 43, 25, 255 } } addEvent ( 'onMapStarting', true ) addEventHandler ( 'onMapStarting', root, function ( ) for _, car in ipairs ( getElementsByType 'vehicle' ) do setVehicleColor ( car, unpack ( colors[ math.random ( #colors ) ] ) ) end end )
  5. Cambiaste type="client" a type="server" en el meta.xml, verdad?
  6. -- server side: local colors = { { 128, 255, 0 }, { 43, 25, 255 } } addEventHandler ( 'onResourceStart', resourceRoot, function ( ) for _, car in ipairs ( getElementsByType 'vehicle' ) do setVehicleColor ( car, unpack ( colors[ math.random ( #colors ) ] ) ) end end )
  7. You are trying to cancel functions of all markers if the player is on a vehicle?
  8. local connectionHandle; local pldata = { } addEventHandler ( "onPlayerJoin", root, function ( ) spawnPlayer ( source, 1959.55, -1714.46, 10 ) fadeCamera ( source, true ) setCameraTarget ( source, source ) end ) addEventHandler ( "onResourceStart", root, function ( ) connectionHandle = dbConnect ( "mysql", "dbname=testgm;host=localhost", "root", "" ) local query = dbQuery ( connectionHandle, "SELECT * FROM `user`" ) if ( query ) then for key, value in ipairs ( dbPoll ( query, -1 ) ) do table.insert ( pldata, { id = value[ "id" ], name = value[ "name" ], age = value[ "age" ], profession = value[ "profession" ], language = value[ "language" ] } ) end end end )
  9. File path is right? script is set as client side?
  10. Castillo

    Es Posible?

    Te falto un 'end' en el server side: function spawnmcc ( ) local grupomcc = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user.".. grupomcc, aclGetGroup ( "MCC" ) )then spawnPlayer ( source, 0, 0, 5, 0, 204, 0, 0, MCC ) end end addEvent( "callingSpawn", true ) addEventHandler( "callingSpawn", getRootElement(), spawnmcc )
  11. The resource should work on it's own, you don't have to change anything, have you even started the resource at your server?
  12. To open a lua file you can use even default notepad, I suggest you to download notepad++.
  13. As I told you before, read the manual.
  14. Read this manual: https://wiki.multitheftauto.com/wiki/Ser ... our_server
  15. That's a resource, not a mod for single player. You have to put it on your server at "resources" folder.
  16. Ok, I'll lock this topic so nobody make's a useless reply.
  17. What the hell is this? you post a script and you don't tell us why?
  18. You can use "or". function lame ( great, lol, hey, now ) print ( great or "None" .." ".. lol or "None" .." ".. hey or "None" .." ".. now or "None" ) end lame("great", nil, 3, nil)
  19. That's wrong, correct: function lame ( great, lol, hey, now ) print ( tostring ( great ) .. " " .. tostring ( lol ) .. " " .. tostring ( hey ) .. " " .. tostring ( now ) ) end lame("great", nil, 3, nil)
  20. What do you mean? just fill the arguments you want.
  21. You can do this: local somedata = { { "name", "TopAz" }, { "age", "1000" }, { "profession", "Programmer" }, { "language", "CSharp" } } for index, value in ipairs ( somedata ) do print ( value[ 1 ] .. " | " .. value[ 2 ] ) end
  22. That's because is not an indexed table.
  23. Seems like 'account' is not returning an account userdata, but a boolean. Try adding some debug outputs.
×
×
  • Create New...