Trying to make a scrip that not only catches cheaters, but embarrasses them too. The script works, excpt for one issue; the Wait command gets ignored regardless of where I put it. Once I announce the player cheated and kill them, to keep them from ruing the experience of others, I want the invincible check to delay to give the player time to turn off invincibility in their trainer. The player is killed and the announcement is made, but every tick, and the player looses control of the trainer. Not quite going to go over too well with players.
I know we can turn off scripthookv, and we eventually will. We can’t do that until we have all the player skins accessible through an alternative manner. Even then, cheaters are getting pretty sophisticated, so we will want more layers of protection then just turning off script hook.
Thanks for any help.
What I have so far:
Citizen.CreateThread(function()
– get the player info
playerPed = GetPlayerPed(-1)
playerid = PlayerId()
playername = GetPlayerName(playerid)while true do
Wait(1)
if not canbeinvincible then
if (GetPlayerInvincible(playerid)) then
SetPlayerInvincible(playerid, false)
killmessage = playername … " got caught being invincible."
TriggerServerEvent(“ZA:BroadcastMessage”, killmessage)
SendNUIMessage({
playsound = “termination.ogg”,
soundvolume = volume
})
SetEntityHealth(GetPlayerPed(-1), 1)
Wait(500) <---- DOES NOT HAPPEN
end
end
–SetPlayerInvincible(playerid, false)
CheckPlayerCar()
end
end)