Turbe$Z Posted September 17, 2016 Share Posted September 17, 2016 fr_server.lua: function warpMe(targetPlayer) local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) if getElementData(targetPlayer, "IsWarpLocked") then outputChatBox("Ez a játékos nem engedte meg hogy rá warpoljanak", source, r, g, b, false) return end if isPedDead(source) then spawnMe() end local vehicle = getPedOccupiedVehicle(targetPlayer) if not vehicle then -- target player is not in a vehicle - just warp next to him local x, y, z = getElementPosition(targetPlayer) clientCall(source, 'setPlayerPosition', x + 2, y, z) else -- target player is in a vehicle - warp into it if there's space left if getPedOccupiedVehicle(source) then --removePlayerFromVehicle(source) outputChatBox('Get out of your vehicle first.', source) return end local numseats = getVehicleMaxPassengers(vehicle) for i=0,numseats do if not getVehicleOccupant(vehicle, i) then if isPedDead(source) then local x, y, z = getElementPosition(vehicle) spawnMe(x + 4, y, z + 1) end warpPedIntoVehicle(source, vehicle, i) return end end outputChatBox("No free seats left in " .. getPlayerName(targetPlayer) .. "'s vehicle.", source, 255, 0, 0) end end addCommandHandler("warpki", function(player) outputChatBox("Nem tudnak rád warpolni", source, r, g, b) setElementData(player, "IsWarpLocked", true) end) addCommandHandler("warpbe", function(player) outputChatBox("Mostmár rád tudnak warpolni", source, r, g, b) removeElementData(player, "IsWarpLocked") end) fr_client.lua: function toggleWarponoff() local state = guiCheckBoxGetSelected(getControl(wndMain, 'warpkibe')) guiCheckBoxSetSelected(getControl(wndMain, 'warpkibe'), not state) server.IsWarpLocked(state) end {'chk', id='warpkibe', text='Warp', onclick=toggleWarponoff}, Link to comment
Gravestone Posted September 17, 2016 Share Posted September 17, 2016 1 hour ago, Turbo777 said: server.IsWarpLocked(state) I don't see any IsWarpLocked function server sided. Link to comment
Turbe$Z Posted September 17, 2016 Author Share Posted September 17, 2016 2 hours ago, Turbo777 said: if getElementData(targetPlayer, "IsWarpLocked") then outputChatBox("Ez a játékos nem engedte meg hogy rá warpoljanak", source, r, g, b, false) return end 45 minutes ago, Gravestone said: I don't see any IsWarpLocked function server sided. Link to comment
Gravestone Posted September 17, 2016 Share Posted September 17, 2016 That is an element data which is being set, it's not a function which can be called by the client. WarpMe is the function. Link to comment
Turbe$Z Posted September 17, 2016 Author Share Posted September 17, 2016 then server.warpMe(state) ? Link to comment
Gravestone Posted September 17, 2016 Share Posted September 17, 2016 function setWarpLocked(player) outputChatBox("Nem tudnak rád warpolni", source, r, g, b) setElementData(player, "IsWarpLocked", true) end addCommandHandler("warpki", setWarpLocked) function setWarpUnlocked(player) outputChatBox("Mostmár rád tudnak warpolni", source, r, g, b) setElementData(player, "IsWarpLocked", false) end addCommandHandler("warpbe", setWarpUnlocked) Use these functions ^ Link to comment
Turbe$Z Posted September 17, 2016 Author Share Posted September 17, 2016 12 minutes ago, Gravestone said: function setWarpLocked(player) outputChatBox("Nem tudnak rád warpolni", source, r, g, b) setElementData(player, "IsWarpLocked", true) end addCommandHandler("warpki", setWarpLocked) function setWarpUnlocked(player) outputChatBox("Mostmár rád tudnak warpolni", source, r, g, b) setElementData(player, "IsWarpLocked", false) end addCommandHandler("warpbe", setWarpUnlocked) Use these functions ^ Doesn't working What wrong? server.setWarpLocked(state) server.setWarpUnlocked(state) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now