Jokeℝ1472771893 Posted December 2, 2012 Share Posted December 2, 2012 (edited) function admt ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then if isWorldSpecialPropertyEnabled( "hovercars" ) then setWorldSpecialPropertyEnabled( "hovercars", true ) outputChatBox("Water drive: on ", 255, 255, 0 ) else setWorldSpecialPropertyEnabled( "hovercars", false ) outputChatBox("Water drive: off", 255, 0, 0 ) end end end end addCommandHandler ( "water", admt ) function adm ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then if isWorldSpecialPropertyEnabled( "aircars" ) then setWorldSpecialPropertyEnabled( "aircars", true ) outputChatBox("Flying vehicle is on !", 255, 255, 0 ) else setWorldSpecialPropertyEnabled( "aircars", false ) outputChatBox("Flying vehicle is off !", 255, 0, 0 ) end end end addCommandHandler ( "fly", adm ) what is wrong here? Edited December 2, 2012 by Guest Link to comment
Blaawee Posted December 2, 2012 Share Posted December 2, 2012 --Toppexxx function admt ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then if isWorldSpecialPropertyEnabled( "hovercars" ) then setWorldSpecialPropertyEnabled( "hovercars", true ) outputChatBox("Water drive: on ", 255, 255, 0 ) else setWorldSpecialPropertyEnabled( "hovercars", false ) outputChatBox("Water drive: off", 255, 0, 0 ) end end end addCommandHandler ( "water", admt ) function adm ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then if isWorldSpecialPropertyEnabled( "aircars" ) then setWorldSpecialPropertyEnabled( "aircars", true ) outputChatBox("Flying vehicle is on !", 255, 255, 0 ) else setWorldSpecialPropertyEnabled( "aircars", false ) outputChatBox("Flying vehicle is off !", 255, 0, 0 ) end end end addCommandHandler ( "fly", adm ) Link to comment
Jokeℝ1472771893 Posted December 2, 2012 Author Share Posted December 2, 2012 didn't work Link to comment
Guest Guest4401 Posted December 2, 2012 Share Posted December 2, 2012 Your script has both clientside & serverside functions, so isn't it obvious that it won't work? Link to comment
Jokeℝ1472771893 Posted December 2, 2012 Author Share Posted December 2, 2012 hhhm errors are that i can't use /fly and /water and karthik how to fix? Link to comment
Guest Guest4401 Posted December 2, 2012 Share Posted December 2, 2012 hhhm errors are that i can't use /fly and /waterand karthik how to fix? When player logs in, check if he's an admin and set element data to it. In clientside, get its element data, and if he's admin allow him to so. Otherwise you can make the command serverside and trigger a clientside event to set the special property. Link to comment
Blaawee Posted December 2, 2012 Share Posted December 2, 2012 (edited) client addEvent( "activeDriveOnWater", true ) addEventHandler("activeDriveOnWater", root, function() if isWorldSpecialPropertyEnabled( "hovercars" ) == false then setWorldSpecialPropertyEnabled( "hovercars", true ) outputChatBox("Water drive: on ", 255, 255, 0 ) else setWorldSpecialPropertyEnabled( "hovercars", false ) outputChatBox("Water drive: off", 255, 0, 0 ) end end ) addEvent( "activeFlyinCar", true ) addEventHandler("activeFlyinCar", root, function() if isWorldSpecialPropertyEnabled( "aircars" ) == false then setWorldSpecialPropertyEnabled( "aircars", true ) outputChatBox("Flying vehicle is on !", 255, 255, 0 ) else setWorldSpecialPropertyEnabled( "aircars", false ) outputChatBox("Flying vehicle is off !", 255, 0, 0 ) end end ) server function admt ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then triggerClientEvent ( "activeDriveOnWater", root ) end end addCommandHandler ( "water", admt ) function adm ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then triggerClientEvent ( "activeFlyinCar", root ) end end addCommandHandler ( "fly", adm ) didnt notice it's clientside & serverside functions Edited December 2, 2012 by Guest Link to comment
Jokeℝ1472771893 Posted December 2, 2012 Author Share Posted December 2, 2012 didn't work Link to comment
Jokeℝ1472771893 Posted December 2, 2012 Author Share Posted December 2, 2012 oh, thnx it's working perfect Link to comment
myonlake Posted December 2, 2012 Share Posted December 2, 2012 I am sorry to say but that code is wrong. It will trigger the world cheat for all players if you use that code, use this, this is a little more simple anyways. Server-side addCommandHandler("water", function(player, cmd) if isGuestAccount(getPlayerAccount(player)) then return end if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then triggerClientEvent(player, "activateCheat", player, cmd) end end ) addCommandHandler("fly", function(player, cmd) if isGuestAccount(getPlayerAccount(player)) then return end if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then triggerClientEvent(player, "activateCheat", player, cmd) end end ) Client-side addEvent("activateCheat", true) addEventHandler("activateCheat", root, function(cmd) if cmd == "fly" then setWorldSpecialPropertyEnabled("hovercars", not isWorldSpecialPropertyEnabled("hovercars")) outputChatBox("Flying vehicle cheat is " .. (isWorldSpecialPropertyEnabled("hovercars") and "on" or "off") .. ".", 255, 180, 10, false) elseif cmd == "water" then setWorldSpecialPropertyEnabled("aircars", not isWorldSpecialPropertyEnabled("aircars")) outputChatBox("Flying vehicle cheat is " .. (isWorldSpecialPropertyEnabled("aircars") and "on" or "off") .. ".", 255, 180, 10, false) end end ) Link to comment
Jokeℝ1472771893 Posted December 2, 2012 Author Share Posted December 2, 2012 oh yeah, true thnx dude it's working now. 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