βurak
Members-
Posts
370 -
Joined
-
Last visited
-
Days Won
21
Everything posted by βurak
-
I tested the code, as you said, it breaks the animation when the shift key is pressed, I'm not sure, but this may be a bug.
-
what do you mean by interrupted?
-
try making the loop true --this setPedAnimation(source, "crack", "crckdeth1", -1, true, false, false, true)
-
actually everything looks right here, if you want to cancel this event, I say go to the client side, but the onPlayerDamage event cannot be canceled and will be ineffective when you animate the player, so your code looks correct, but you can delete the second localPlayer parameter in the triggerServerEvent, instead use the source inside the server event triggerServerEvent("wastedEvent", localPlayer) --use source on server side so no second localPlayer parameter is required
-
you're welcome
-
root will send it to everyone change it to hitElement if you are going to send it only to the player who entered the marker --this triggerEvent( "addNotification", hitElement, "Você precisa da skin do CJ antes de poder definir a roupa!")
- 1 reply
-
- 1
-
When the onPlayerJoin event is triggered, the client-side file may not be loaded yet. You can solve this on the client-side with the "onClientResourceStart" event, so the panel will open when the files are loaded. GUIEditor = { window = {}, label = {}, edit = {}, button = {}, } function centerWindow (center_window) local screenW, screenH = guiGetScreenSize() local windowW, windowH = guiGetSize(center_window, false) local x, y = (screenW - windowW) /2,(screenH - windowH) /2 return guiSetPosition(center_window, x, y, false) end GUIEditor.window[1] = guiCreateWindow (0, 0, 300, 400, "Test", false) centerWindow (GUIEditor.window[1]) guiSetVisible (GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel (20, 50, 100, 70, "Test", false, GUIEditor.window[1]) GUIEditor.edit[1] = guiCreateEdit (20, 90, 200, 30, "", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton (20, 150, 150, 40, "Button", false, GUIEditor.window[1]) function openGUI(bool) if (bool == true) then guiSetVisible(GUIEditor.window[1], true) showCursor(true) end end addEvent ("showGUI", true) addEventHandler ("showGUI", root, openGUI) addEventHandler("onClientResourceStart", resourceRoot, function() openGUI(true) --open panel when client side files are loaded end )
-
?
-
try this local function default3SBuy() guiSetEnabled(skinPayButton3, false) local money = getPlayerMoney(localPlayer) --replace with localPlayer local id = getElementModel(localPlayer) --replace with localPlayer if (money < 500) then --if the player's money is less than 0 go no further outputChatBox("You don't have enough money! (500$)", 255, 0, 0) guiSetVisible(skinPayButton3, true) return end if id == 284 then --getElementType is unnecessary in this case outputChatBox("You already pruchased this skin!", 255, 0, 0) end outputChatBox("You purchased a Humvee! (500$)", 0, 255, 0) takePlayerMoney(500) --this might be problem for server side i suggest you to do it using triggerServerEvent setElementModel(localPlayer, 284) end addEventHandler("onClientGUIClick", skinPayButton3, default3SBuy, false)
-
ok that's nice
-
extra parameter is passed here can you try deleting the true part triggerServerEvent("addVehiclePaintJob", localPlayer, veh, model, id, true) -- <-- this triggerServerEvent("addVehiclePaintJob", localPlayer, veh, model, id)
-
change source to localPlayer addCommandHandler("pj", function(cmd,id) local veh = getPedOccupiedVehicle(localPlayer) --this if veh then local id = tonumber(id) or 0 local model = getElementModel(veh) if availablePaintJobs[model] and availablePaintJobs[model][id] then setElementData(veh, "tuning.paintjob", id) triggerServerEvent("addVehiclePaintJob", localPlayer, veh, model, id, true) end end end)
-
You're welcome
-
isObjectInACLGroup is server side function you can't use it on client side use triggerServerEvent and triggerClientEvent to do this split your code into pieces
-
Try changing thePlayer to localPlayer addCommandHandler("pj", function(cmd,id) local plrAccName = getElementData(localPlayer, 'accName') --change thePlayer to localPlayer if isObjectInACLGroup("user."..plrAccName, aclGetGroup("Admin")) or isObjectInACLGroup("user."..plrAccName, aclGetGroup("Owner")) then local veh = getPedOccupiedVehicle(localPlayer) if veh then local id = tonumber(id) or 0 local model = getElementModel(veh) if availablePaintJobs[model] and availablePaintJobs[model][id] then setElementData(veh, "tuning.paintjob", id) triggerServerEvent("addVehiclePaintJob", localPlayer, veh, model, id, true) end end end end)
-
You're welcome ?
-
function onSpawnHeliMarkerHit(hitElement, matchingDimension) change function parameters like this
-
function spawnItemsWhenStart ( name ) createPed(287, 1544.75390625, -1675.2421875, 13.55902671814, 90) end addEventHandler ( "onResourceStart", getResourceRootElement(), spawnItemsWhenStart ) function spawnMarkerFunction() --local deleteMarker = createMarker(1529.248046875, -1685.935546875, 4.5, "cylinder", 3, 135, 15, 15, 0) setElementInterior(spawnMarker, 0) setElementDimension(spawnMarker, 0) addEventHandler("onMarkerHit",spawnMarker,onSpawnMarkerHit) end spawnHeliMarker = createMarker (1930.0791015625, -2626.673828125, 12.5, "cylinder", 3, 122, 193, 67, 70) function onSpawnHeliMarkerHit (thePlayer, hitElement, heliSpawnPos) if(getElementType(hitElement) ~= "player") then --If hitElement is not a player, go no further return end local money = getPlayerMoney(hitElement) if (money < 10000) then --if the player's money is less than 10000 go no further outputChatBox("You don't have enough money!", hitElement, 255, 0, 0) return end outputChatBox("You purchased a blackhawk!", hitElement, 0, 255, 0) takePlayerMoney(hitElement, 10000) local heliSpawnPos={ {1967.8515625, -2636.1103515625, 13.546875}, {1998.966796875, -2636.849609375, 13.546875}, } local theVeh = getPedOccupiedVehicle(hitElement) if ( theVeh ) then if ( VehiclesTable[hitElement] ) then VehiclesTable[hitElement] = nil end return end local x, y, z = getElementPosition (hitElement) local rotX, rotY, rotZ = getElementRotation (hitElement) local random = math.random(1,#heliSpawnPos) VehiclesTable[hitElement] = createVehicle (563, heliSpawnPos[random][1], heliSpawnPos[random][2], heliSpawnPos[random][3]+2) setElementRotation (VehiclesTable[hitElement], rotX, rotY, 0) warpPedIntoVehicle (hitElement, VehiclesTable[hitElement]) end addEventHandler("onMarkerHit", spawnHeliMarker, onSpawnHeliMarkerHit) can you try this? You didn't say what getElementData means so I deleted that
-
What data do you want to get with getElementData?, can you show line 90? by the way this line should be above the if code local money = getPlayerMoney(hitElement)
-
there is an error here money must be a string tonumber(getElementData(hitElement, money)) change it like this tonumber(getElementData(hitElement, "money"))
-
kodu gösterirsen belki yardımcı oluruz kodsuz kimse yardım edemez
-
yes there must be something wrong with this link because it was working yesterday, now it's not working can you try to download it via archived website https://megalodon.jp/2022-0315-0707-50/bpb-team.ru/star-tR/files/maps.zip