-
Posts
26 -
Joined
-
Last visited
Melbourne's Achievements
![Rank: Advanced Member (8/54) Advanced Member](https://forum.multitheftauto.com/uploads/set_resources_22/84c1e40ea0e759e3f1505eb1788ddf3c_default_rank.png)
Advanced Member (8/54)
12
Reputation
-
¿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.
-
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.
-
function blip() if getElementType( source ) == "vehicle" then if vehicleBlips[source] then destroyElement( vehicleBlips[source] ) vehicleBlips[source] = nil end end end addEventHandler( "onClientElementDestroy", getRootElement(), blip )
-
onClientElementDestroy debe funcionarte, úsalo pero con addEventHandler.
-
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.
-
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 )
-
¿Puedes mostrar una imagen o vídeo del problema?
-
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
-
addEventHandler("onMarkerHit", getRootElement(), function( hitter, matchingDimension ) if ( source == mFirstMis ) then destroyElement( source ) destroyElement( bFirstMis ) end end) This could work... Test it
-
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)
-
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.
-
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)
-
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.
-
¿No te funcionó dejando el localPlayer? intenta cambiar el guiRoot por solamente root.