Hello MTA Community,
i've made a script which Makes the Team "name" undamageable until they get a wanted level, i've tried it in many ways and i'm still having this error :
ANTIDM/Server.lua:3: syntax error near 'end'
Client Side :
dmteam = {
["Emergency"] = true,
}
function antidm (Player)
Player = getLocalPlayer()
if dmteam[getTeamName(getPlayerTeam(Player))] and triggerServerEvent("Dm", Player, Player) then
cancelEvent()
end
end
addEventHandler("onClientPlayerDamage", getRootElement(), antidm)
Server Side :
function check(Player)
(exports.SACGpolice:getWantedLevel(Player) == 0)
end
addEvent("Dm",true)
addEventHandler("Dm", getRootElement(Player), check)
Note : i've done this TriggerServerEvent, cause the "SACGpolice" is exportable with Server Side.
Thank you.