Amine#TN Posted March 30, 2017 Posted March 30, 2017 (edited) server site disallowedWeapons = {} function loadSettings() settings = xmlLoadFile ( "settings.xml" ) disWeaponsNode = xmlFindChild ( settings, "disallowed_weapons", 0 ) ill_weaponNodes = xmlNodeGetChildren ( settings ) for k, node in ipairs ( ill_weaponNodes ) do disallowedWeapons[k] = xmlNodeGetAttribute ( node, "id" ) end adminOnly = xmlNodeGetValue ( xmlFindChild ( settings, "admin_only", 0 ) ) end function checkWeapon ( prevSlot, curSlot ) local weapon = getPedWeapon ( getLocalPlayer(), curSlot ) local weaponName = getWeaponNameFromID ( weapon ) local pName = getPlayerName ( source ) for index, weaponID in ipairs ( disallowedWeapons ) do if tonumber(weapon) == tonumber(weaponID) then if getTeamName ( getPlayerTeam ( getLocalPlayer() ) ) == "STAFFS" then if adminOnly == "true" then --let it slide outputChatBox ( "Don't abuse it :)", 0, 255, 0 ) break else illegalWeaponFound ( getLocalPlayer(), weapon ) break end else illegalWeaponFound ( getLocalPlayer(), weapon ) break end else toggleControl ( "fire", true ) toggleControl ( "action", true ) end end end function illegalWeaponFound ( player, weapon ) toggleControl ( "fire", false ) toggleControl ( "action", false ) triggerServerEvent ( "onIllegalWeapon", getLocalPlayer(), getWeaponNameFromID(getPedWeapon(getLocalPlayer(), curSlot ) ), getPlayerName(source) ) end addEventHandler ( "onClientPlayerWeaponSwitch", getRootElement(), checkWeapon ) addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource() ), loadSettings ) ---------------------------------- server site addEvent ( "onIllegalWeapon", true ) addEventHandler ( "onIllegalWeapon", getRootElement(), function ( weaponName, pName ) outputChatBox ( "#FF0000The Player #FFFFFF" ..pName.. " #FF0000Has Been Kicked Because He use #00FF00" ..weaponName.. "#FF0000", getRootElement(), 255, 0, 0, true ) setTimer ( kickPlayer , 1000 , 1 , source , "You Use An Forbidden Weapon!") end ) ----------------------------------- <meta><info description="This script warns server and possibly punishes when a player pulls an illegal weapon" name="Anti Cheat Weapons" type="script" version="3.0" author="Dr.PhillyBlunt"/><script type="server" src="server.lua"/><script type="client" src="client.lua"/><config type="client" src="settings.xml"/></meta> ----------------------------------- i want if some one can upgrade it make it destroy the gun of the player + kick it and make it with acl not team Edited March 30, 2017 by NOONE done
NeXuS™ Posted March 30, 2017 Posted March 30, 2017 function illegalWeaponFound ( player, weapon ) toggleControl ( "fire", false ) toggleControl ( "action", false ) triggerServerEvent ( "onIllegalWeapon", getLocalPlayer(), weapon, getPlayerName(source)) end addEvent ( "onIllegalWeapon", true ) addEventHandler ( "onIllegalWeapon", getRootElement(), function ( weaponID, pName ) outputChatBox ( "#FF0000The Player #FFFFFF" ..pName.. " #FF0000Has Been Kicked Because He use #00FF00" ..getWeaponNameFromID(weaponID).. "#FF0000", getRootElement(), 255, 0, 0, true ) takeWeapon(source, weaponID) setTimer ( kickPlayer , 1000 , 1 , source , "You Use An Forbidden Weapon!") end ) I suppose you want this.
Amine#TN Posted March 30, 2017 Author Posted March 30, 2017 bro you did not understand i want a script to destroy the guns forbidden for the simple players and locale the acl not the team
NeXuS™ Posted March 30, 2017 Posted March 30, 2017 I don't understand at all what you are trying to say... Destroy the gun? What the hack?
Amine#TN Posted March 30, 2017 Author Posted March 30, 2017 i will give you exemple in my server the knife is a forbidden weapon and some staff give it to players i want a script to replace the gun gived to the player maybe katana or any thing or destroy it
NeXuS™ Posted March 30, 2017 Posted March 30, 2017 The script which I sent you takes the forbidden weapons from you if you switch to them.
Amine#TN Posted March 30, 2017 Author Posted March 30, 2017 ahhh thanx bro you can make it local the acl admin and supermoderator
Amine#TN Posted March 30, 2017 Author Posted March 30, 2017 that script allow staff on the team staff to use that guns but i need to make it allow staff in aclGroup to use that guns
NeXuS™ Posted March 30, 2017 Posted March 30, 2017 Buddy, we won't make you everything. Show us a bit of something, that shows you are trying to reach what you want.
Amine#TN Posted March 30, 2017 Author Posted March 30, 2017 dont worry i fixed it and thanx for the fonction of taking the weapon from the player
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