Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Instead of using "attachElements" you use the exported function from bone_attach "attachElementToBone".
  2. http://lua.lickert.net/loop/index_en.html
  3. Ah, then you have to loop the table and create them.
  4. local x, y, z = pbags Change it to: local x, y, z = unpack ( pbags [ math.random ( #pbags ) ] )
  5. Well, instead of that, you can attach it to a bone, download the resource called "bone_attach".
  6. Postea el contenido del archivo mtaserver.conf.
  7. Es el tipo de script que debe ser, se define en el archivo meta.xml.
  8. Pusiste la IP en el archivo mtaserver.conf, verdad? borrala, dejalo como estaba.
  9. vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 ) state = setVehicleDoorState ( vehicle1, 1, 1 ) function lockPrivate( player, seat, Login ) if ( source == vehicle1 ) then local account = getPlayerAccount( player ) local accountName = ( account and getAccountName ( account ) or "" ) if not( accountName == "Paolo" ) then cancelEvent() outputChatBox("-|ExM|-:#fdfdfdEste Auto Pertenece a #Paolo#151627// ", player, 187, 255, 0, true) --- Mensaje else setVehicleDamageProof(source, true) outputChatBox("-|ExM|- :#fdfdfdBienvenido A tu Auto #Paolo#151627//", player, 187, 255, 0, true) --- MSG end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate )
  10. dxDrawRectangle requires onClientRender event in order to draw it every render. Also, is not what I meant, what I meant is: send the element to the client side, define it there and then draw the progress bar.
  11. addCommandHandler ( "bag", function ( thePlayer ) local bag = createObject ( 1550, 0, 0, 0 ) -- Creates an object at coordinates: 0, 0, 0 setElementCollisionsEnabled ( bag, false ) -- Disables the object collisions, so it won't collide with the player. attachElements ( bag, thePlayer, 0, -0.3, 0.3 ) -- Attachs the object to the player that used the command. end ) Write "/bag" and enjoy!
  12. You can't set the camera dimension, you must set the player dimension instead.
  13. You can send the ped element to the client side using triggerClientEvent.
  14. createObject attachElements or use bone_attach resource
  15. If "tigre1" is created server side, then that script won't work, because client and server scripts don't share variables.
  16. You can't make a 3D progress bar using GUI functions, you must draw it using dxDrawRectangle.
  17. createPickup createMarker givePlayerMoney onPickupHit onMarkerHit
  18. local theSerial = "0396C6F543425FFE37A326883D73B4F4" local vehicleTimer = { } local isEnabled = { } addCommandHandler ( "colors", function ( thePlayer, command ) if ( getPlayerSerial ( thePlayer ) == theSerial ) then local v = getPedOccupiedVehicle ( thePlayer ) if ( not isEnabled [ thePlayer ] ) then isEnabled [ thePlayer ] = true else if ( isTimer ( vehicleTimer [ thePlayer ] ) ) then killTimer ( vehicleTimer [ thePlayer ] ) end isEnabled [ thePlayer ] = false end if ( isEnabled [ thePlayer ] and v ) then if ( isTimer ( vehicleTimer [ thePlayer ] ) ) then killTimer ( vehicleTimer [ thePlayer ] ) end vehicleTimer [ thePlayer ] = setTimer ( randomVehColors, 2000, 0, thePlayer ) end end end ) addEventHandler ( "onVehicleEnter", getRootElement(), function ( thePlayer ) if ( getPlayerSerial ( thePlayer ) == theSerial ) then if ( isEnabled [ thePlayer ] ) then local v = getPedOccupiedVehicle ( thePlayer ) if ( v ) then if ( isTimer ( vehicleTimer [ thePlayer ] ) ) then killTimer ( vehicleTimer [ thePlayer ] ) end vehicleTimer [ thePlayer ] = setTimer ( randomVehColors, 2000, 0, thePlayer ) end end end end ) addEventHandler ( "onVehicleStartExit", root, function ( thePlayer ) if ( isTimer ( vehicleTimer [ thePlayer ] ) ) then killTimer ( vehicleTimer [ thePlayer ] ) end end ) function randomVehColors ( thePlayer ) local car = getPedOccupiedVehicle( thePlayer ) if ( not car ) then if ( isTimer ( vehicleTimer [ thePlayer] ) ) then killTimer ( vehicleTimer [ thePlayer ] ) end return end if ( isVehicleDamageProof ( car ) == true ) then local c1 = math.random ( 0, 126 ) local c2 = math.random ( 0, 126 ) local c3 = math.random ( 0, 126 ) local c4 = math.random ( 0, 126 ) setVehicleColor ( car, c1, c2, c3, c4 ) end end
  19. So? my script will check if the vehicle is on the table, if so, then it'll check if you have enough money.
  20. carsTable = { [415] = 100, [413] = 50 } carShopMarker = createMarker( -2424.12036, -609.69904, 131.62, "cylinder", 1.8, 130, 180, 0, 50 ) function buyCar ( thePlayer, cmd, cmdType, carID ) if isElementWithinMarker ( thePlayer, carShopMarker ) and cmdType == "buy" then local price = carsTable [ tonumber ( carID ) ] if ( price ) then local playerMoney = getPlayerMoney ( thePlayer ) if ( playerMoney >= price ) then outputChatBox ( ":O got a car" ) else outputChatBox ( "bbz, arba ner pinige" ) end else outputChatBox ( "Neteisingas Masinos ID", thePlayer ) end end end addCommandHandler ( "v", buyCar )
×
×
  • Create New...