ramzi Posted July 1, 2016 Posted July 1, 2016 Hi guys,i've over here my Headshot script which works only with team"Admins",the problem is that i tried to add 2 more teams using "and" but i failed ,Plz help me out!here is the script: addEvent "onPlayerHeadshot" addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if getElementType ( attacker ) == "player" then if bodypart == 9 and weapon == 34 then local HSteam = getPlayerTeam(attacker) if HSteam and getTeamName(HSteam)=="Admins" then local result = triggerEvent("onPlayerHeadshot",source, attacker, weapon, loss) if result == true then killPed(source, attacker, weapon, bodypart) setPedHeadless( source, true ) addEventHandler("onPlayerSpawn", root, function () setPedHeadless( source, false) end ) end end end end end ) function BackUp( source ) if getElementType ( source ) == "player" then setPedHeadless ( source, false ) end end DZ Army Base: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11101 Flyingcars script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11116
Walid Posted July 1, 2016 Posted July 1, 2016 'or' not 'and' Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
G-Stefan Posted July 2, 2016 Posted July 2, 2016 BE CAREFUL! if Condition1 AND Condition2 then body The body will be executed ONLY IF Condition1 is TRUE AND Condition2 is TRUE if Condition1 or Condition2 then body The body will be executed ONLY IF Condition1 is TRUE or Condition2 is TRUE example:if HSteam and (getTeamName(HSteam)=="Admins" OR getTeamName(HSteam)=="Moderators") then ... the example should work Multi Theft Auto : Racers Land 10%
ramzi Posted July 2, 2016 Author Posted July 2, 2016 Well thnx,that worked!! DZ Army Base: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11101 Flyingcars script: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11116
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