Perfect Posted August 21, 2012 Share Posted August 21, 2012 Hi all, How to disable warp players to me. I mean if players try to warp me then they can't and got message "this player diable warping". yes by using command Help Pls!!! Link to comment
Castillo Posted August 21, 2012 Share Posted August 21, 2012 You are talking about Freeroam warping? Link to comment
Perfect Posted August 21, 2012 Author Share Posted August 21, 2012 You are talking about Freeroam warping? Yes Link to comment
Castillo Posted August 21, 2012 Share Posted August 21, 2012 You can use: setElementData -- To set the warping state. getElementData -- To get the warping state. You'll have to edit the Freeroam script though. Link to comment
Perfect Posted August 21, 2012 Author Share Posted August 21, 2012 You can use: setElementData -- To set the warping state. getElementData -- To get the warping state. You'll have to edit the Freeroam script though. I know i need to edit but i don't know how use those funcions and yes i try wiki but can't help. can you explain me how to use those functions or can you make disable warping for me Pls ? Link to comment
Castillo Posted August 21, 2012 Share Posted August 21, 2012 Click on each link and read, I won't do it for you. Link to comment
Perfect Posted August 21, 2012 Author Share Posted August 21, 2012 Click on each link and read, I won't do it for you. I did'nt understand. can you give any simple example and can you explain me better, what i do with that functions ? Link to comment
Castillo Posted August 21, 2012 Share Posted August 21, 2012 Both functions has examples, you should make a command to enable/disable warping and then on the function ( at the freeroam script ) where it tries to warp, it'll check that element data with getElementData and if it's disabled, don't let him warp. Link to comment
Perfect Posted August 21, 2012 Author Share Posted August 21, 2012 Both functions has examples, you should make a command to enable/disable warping and then on the function ( at the freeroam script ) where it tries to warp, it'll check that element data with getElementData and if it's disabled, don't let him warp. ok i try but not working here is my code function warpStatus(player,cmd,) if Player then if not getElementData(player, "warp.status") then setElementData(player, "warp.status", true) outputChatBox("You have enabled your warping", player) else setElementData(player, "lift.permission", false) outputChatBox("You have disabled warping", player) end end end addCommandHandler("warpstatus", warpStatus) function warpMe(targetPlayer) if getElementData(player, "warp.status") then 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 local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) end Link to comment
Taalasmaa Posted August 21, 2012 Share Posted August 21, 2012 Try: EDIT: Fixed some arguements. function warpStatus(player,cmd) if player then if (getElementData(player,"warp.status") == false) then setElementData(player, "warp.status", true) outputChatBox("You have enabled your warping", player) else setElementData(player, "warp.status", false) outputChatBox("You have disabled warping", player) end end end addCommandHandler("warpstatus", warpStatus) function warpMe(targetPlayer) if (getElementData(targetPlayer,"warp.status") == false) then 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 local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) end Link to comment
Perfect Posted August 21, 2012 Author Share Posted August 21, 2012 Try:EDIT: Fixed some arguements. function warpStatus(player,cmd) if player then if (getElementData(player,"warp.status") == false) then setElementData(player, "warp.status", true) outputChatBox("You have enabled your warping", player) else setElementData(player, "warp.status", false) outputChatBox("You have disabled warping", player) end end end addCommandHandler("warpstatus", warpStatus) function warpMe(targetPlayer) if (getElementData(targetPlayer,"warp.status") == false) then 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 local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) end thnx but I don't know where i put "if (getElementData(targetPlayer,"warp.status") == false) then" Link to comment
TAPL Posted August 21, 2012 Share Posted August 21, 2012 Try:EDIT: Fixed some arguements. function warpStatus(player,cmd) if player then if (getElementData(player,"warp.status") == false) then setElementData(player, "warp.status", true) outputChatBox("You have enabled your warping", player) else setElementData(player, "warp.status", false) outputChatBox("You have disabled warping", player) end end end addCommandHandler("warpstatus", warpStatus) function warpMe(targetPlayer) if (getElementData(targetPlayer,"warp.status") == false) then 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 local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) end You have missed 'end' Link to comment
Perfect Posted August 21, 2012 Author Share Posted August 21, 2012 Try:EDIT: Fixed some arguements. function warpStatus(player,cmd) if player then if (getElementData(player,"warp.status") == false) then setElementData(player, "warp.status", true) outputChatBox("You have enabled your warping", player) else setElementData(player, "warp.status", false) outputChatBox("You have disabled warping", player) end end end addCommandHandler("warpstatus", warpStatus) function warpMe(targetPlayer) if (getElementData(targetPlayer,"warp.status") == false) then 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 local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) end You have missed 'end' where i put "if (getElementData(targetPlayer,"warp.status") == false) then" ? Link to comment
TAPL Posted August 21, 2012 Share Posted August 21, 2012 can't you see it? it's already on the code. Link to comment
Perfect Posted August 21, 2012 Author Share Posted August 21, 2012 can't you see it?it's already on the code. you mean code is complete ? if i write warpstatus then i can disallowed warping ? Link to comment
TAPL Posted August 23, 2012 Share Posted August 23, 2012 can't you see it?it's already on the code. you mean code is complete ? if i write warpstatus then i can disallowed warping ? function warpMe is from freeroam > fr_server.lua > line (251) just copy this if getElementData(targetPlayer,"warp.status") then return end and paste it below function warpMe(targetPlayer) result function warpMe(targetPlayer) if getElementData(targetPlayer,"warp.status") then return end .. Link to comment
Perfect Posted August 23, 2012 Author Share Posted August 23, 2012 ok but when player try to warp and i disable warping then that player will get message like "This player is diable his warping", how to that ? Link to comment
Castillo Posted August 23, 2012 Share Posted August 23, 2012 function warpMe(targetPlayer) if getElementData(targetPlayer,"warp.status") then outputChatBox ( "This player has disabled warping.", source, 255, 0, 0 ) return end .. Link to comment
Perfect Posted August 23, 2012 Author Share Posted August 23, 2012 Thank you so much!!! (Solidsnake14,Taalasmaa and TAPL) Link to comment
TheBite Posted January 31, 2013 Share Posted January 31, 2013 Try:EDIT: Fixed some arguements. function warpStatus(player,cmd) if player then if (getElementData(player,"warp.status") == false) then setElementData(player, "warp.status", true) outputChatBox("You have enabled your warping", player) else setElementData(player, "warp.status", false) outputChatBox("You have disabled warping", player) end end end addCommandHandler("warpstatus", warpStatus) function warpMe(targetPlayer) if (getElementData(targetPlayer,"warp.status") == false) then 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 local interior = getElementInterior(targetPlayer) setElementInterior(source, interior) setCameraInterior(source, interior) end Guys, where can i insert this? Link to comment
Castillo Posted January 31, 2013 Share Posted January 31, 2013 "freeroam/fr_server.lua". Link to comment
TheBite Posted January 31, 2013 Share Posted January 31, 2013 "freeroam/fr_server.lua". Ok, and how to set this script only for the staff? e.g.: only staff can type /nowarps and the script is active for these players. Link to comment
Castillo Posted January 31, 2013 Share Posted January 31, 2013 getPlayerAccount getAccountName isObjectInACLGroup Link to comment
TheBite Posted January 31, 2013 Share Posted January 31, 2013 getPlayerAccount getAccountName isObjectInACLGroup in what part of the scrip can i put it and what is the command e.g.:/nowarps ? 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