justn Posted March 28, 2014 Share Posted March 28, 2014 Hey, so for the first code, the problem is, the player ( who's in group RIOT ) when he dies, he does not spawn in the location specified below. addEventHandler ( "onPlayerWasted", getRootElement(), function (player) if (getElementType(player) == ("player")) then if ( getElementData ( player, "Group" ) ~= "RIOT" ) then setTimer (spawnPlayer, 1500, 1, player, 846.85522460938, -2106.7973632813, 13.618446350098, 0, getPedSkin (player), 0, 0, getPlayerTeam(player)) end end end) and for this code below, the players in group "RIOT" cant kill each other, but it does not work, Idk why I also don't get errors in debugscript but here you go. addEventHandler ( "onPlayerDamage", getRootElement (), function (attacker) if ( getElementData(attacker, "Group" ) ~= "RIOT" ) and ( getElementData(source, "Group" ) ~= "RIOT" ) then cancelEvent() end end) Link to comment
kevenvz Posted March 28, 2014 Share Posted March 28, 2014 Why are you using ~= that means is NOT equal to, use == that means equal to. Link to comment
Anubhav Posted March 28, 2014 Share Posted March 28, 2014 addEventHandler ( "onPlayerWasted", getRootElement(), function ( source ) if (getElementType( source ) == ("player")) then if ( getElementData ( source , "Group" ) =="RIOT" ) then setTimer (spawnPlayer, 1500, 1, player, 846.85522460938, -2106.7973632813, 13.618446350098, 0, getElementModel( source ), 0, 0, getPlayerTeam( source )) end end end) 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