Jump to content

Melbourne

Members
  • Posts

    26
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Melbourne's Achievements

Advanced Member

Advanced Member (8/54)

12

Reputation

  1. ¿El color se cambia o no? Supongo que quieres guardarle el objeto al jugador que lo compró, así que lo que tienes que hacer es simplemente guardar la cuenta del usuario y la ID del objeto que compró, luego, obtener la ID de ese objeto y crearlo con createObject. Doy por entendido que ya sabes hacer consultas básicas en SQL, si no es así intenta aprenderlas y hacerlo. Si no puedes, te puedo dar un ejemplo para que te guíes.
  2. Agrega esto en la función del boss(Nemesisbymanawydan) triggerClientEvent ( root, "onNemesiSpawn", root, nemesi ) Luego en el archivo client agregas esto: addEvent("onNemesiSpawn", true) addEventHandler("onNemesiSpawn", root, function( ped ) addEventHandler("onClientPlayerDamage", root, function( attacker, wep ) if ( attacker and attacker == ped and wep == 34 ) then setElementHealth( source, 0 ) end end ) end ) No estoy seguro de que funcione ya que no lo he probado, pero pruébalo a ver como va.
  3. function blip() if getElementType( source ) == "vehicle" then if vehicleBlips[source] then destroyElement( vehicleBlips[source] ) vehicleBlips[source] = nil end end end addEventHandler( "onClientElementDestroy", getRootElement(), blip )
  4. onClientElementDestroy debe funcionarte, úsalo pero con addEventHandler.
  5. Creo haber leído por ahí que tienes que remplazar el modelo de las armas por uno invisible... Era eso o usar shaders, la verdad no me acuerdo muy bien pero por ahí iba la cosa.
  6. This works fine, if you want it to be updated when writing something in the editbox, use onClientGUIChanged addEventHandler("onClientGUIClick",root, function() if source == v_button1 and guiGridListGetSelectedItem(v_gridlist) >= 0 then local getVehicle = guiGridListGetItemText(v_gridlist,guiGridListGetSelectedItem(v_gridlist),1) local vehicleID = getVehicleModelFromName(getVehicle) triggerServerEvent("createVehicle",localPlayer,vehicleID) elseif source == v_button2 then guiSetVisible(window,false) showCursor(false) elseif source == v_button3 then local text = guiGetText(v_editbox) guiGridListClear(v_gridlist) for i, v in ipairs( vehicles ) do if getVehicleNameFromModel(v[1]):find(text) then local row = guiGridListAddRow(v_gridlist) guiGridListSetItemText (v_gridlist,row,1,getVehicleNameFromModel(v[1]),false,false) end end end end )
  7. Stop freeroam resource
  8. ¿Puedes mostrar una imagen o vídeo del problema?
  9. Well, then try this addEventHandler("onMarkerHit", getRootElement(), function( hitter, matchingDimension ) if ( source == mFirstMis ) then if ( getElementType( hitter ) == "player" ) then destroyElement( mFirstMis ) destroyElement( bFirstMis ) end end end) If it still doesn't work, try changing the marker size to 1.5
  10. addEventHandler("onMarkerHit", getRootElement(), function( hitter, matchingDimension ) if ( source == mFirstMis ) then destroyElement( source ) destroyElement( bFirstMis ) end end) This could work... Test it
  11. If I did not understand wrong, what you want is when the player gets on the bike the marker is destroyed(Google translator): local x1, y1, z1, rx1, ry1, rz1 = 2243.2, -1263.2, 23.5, 0, 0, 270 -- I set the coordinates of the vehicle's spawn addEventHandler ( "onPlayerJoin", getRootElement(), function() setElementPosition( source, x1, y1, z1 ) Bike = createVehicle ( 481, 0, 0, 0 ) -- set the type of vehicle setVehicleColor( Bike, 88,142,110 ) -- set the color spawnVehicle( Bike, x1, y1, z1, rx1, ry1, rz1) local spawnVeh = spawnVehicle ( Bike, x1, y1, z1, rx1, ry1, rz1 ) -- spawns the vehicle local xb1, yb1, zb1 = getElementPosition ( Bike ) -- taking the vehicle's coordinates theMarker = createMarker ( xb1, yb1, zb1, "arrow", 0.4, 255, 255, 0, 170 ) -- create a marker over the vehicle attachElements ( theMarker, Bike, 0, 0, 1.5 ) -- that is attached to it end ) addEventHandler("onVehicleEnter", root, function ( player ) if ( source == Bike ) then destroyElement( theMarker ) end end)
  12. getPlayersInTeam returns a table of all the players in the team, so that only the team sees the blip you have to do this: addCommandHandler("showblip", function ( ... ) -- > this is the correct way local playersinteam = getPlayersInTeam(getTeamFromName("EMS")) for i, players in ipairs( playersinteam ) do createBlipAttachedTo( players, 0, 5, 255, 255, 0, 255, 0, 65535, players ) end -- > this is not the correct way --local playersinteam = getPlayersInTeam(getTeamFromName("EMS")) --createBlipAttachedTo( players, 0, 5, 255, 255, 0, 255, 0, 65535, players ) end) -- type /showblip to show the blip I'm sorry if you do not understand me, I'm using Google translator.
  13. local chat_tavolsag = 100 function onChat( msg, messagetype ) local X, Y, Z = getElementPosition(source) local nev = getPlayerName(source) for _, v in ipairs(getElementsByType("player")) do if messageType == 0 then if isPlayerInRangeOfPoint(v, X, Y, Z, chat_tavolsag) then outputChatBox("".. nev .." mondja: ".. msg .."", v, 255, 255, 255, true) end end end end addEventHandler("onPlayerChat", getRootElement(), onChat)
  14. Esto en teoría debería funcionar, no lo he probado. SERVER CLIENT Solo los que son del grupo Vip Diamond les debería dejar abrir el panel.
  15. ¿No te funcionó dejando el localPlayer? intenta cambiar el guiRoot por solamente root.
×
×
  • Create New...