Moderators IIYAMA Posted July 31, 2015 Moderators Share Posted July 31, 2015 There is no need to cancel anything. 1: trigger directly after onClientExplosion event. (no looping through the vehicles because that is what you are going to do at serverside) 2: Loop through the vehicles at serverside and check if the owners are in the same team. It is just combining and adjusting those scripts, no big deal. Link to comment
Xwad Posted July 31, 2015 Author Share Posted July 31, 2015 Thank you! I go try to make it!but meantime thanks. Link to comment
Xwad Posted August 1, 2015 Author Share Posted August 1, 2015 is it better? client addEventHandler ( "onClientExplosion", root, function ( x, y, z ) triggerServerEvent ( "Team", resourceRoot ) for i, v in ipairs ( getElementsByType ( "vehicle" ) ) do local vx, vy, vz = getElementPosition ( v ); if ( getDistanceBetweenPoints3D ( x, y, z, vx, vy, vz ) <= 20 and getElementModel ( v ) == 432 ) then triggerServerEvent ( "OnRhinoDamageFromExplosion", v, (20 / getDistanceBetweenPoints3D ( x, y, z, vx, vy, vz ))*13 ); end end end ) server [lua ]addEvent ( "OnRhinoDamageFromExplosion", true ); addEventHandler ( "OnRhinoDamageFromExplosion", root, function ( d ) setElementHealth ( source, getElementHealth ( source ) - d ); end ); function AntiTeamKill() local Germanteam = getTeamFromName("German") if(getPlayerTeam (localPlayer ) == Germanteam) then cancelEvent end addEvent( "Team", true ) addEventHandler( "Team", resourceRoot, AntiTeamKill ) [/lua] 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