Hello There, Guest! Login or Register


Anti-Afk / anti spawn kill
#1
I want to suggest anti-afk to prevent death evasion.
Anti Spawn Kill
https://wiki.sa-mp.com/wiki/SetTimerEx
Code:
// The event callback (OnPlayerSpawn) - we will start a timer here
public OnPlayerSpawn(playerid)
{
  // Anti-Spawnkill (5 seconds)

  // Set their health very high so they can't be killed
  SetPlayerHealth(playerid, 999999);

  // Notify them
  SendClientMessage(playerid, -1, "You are protected against spawn-killing for 5 seconds.");

  // Start a 5 second timer to end the anti-spawnkill
  SetTimerEx("EndAntiSpawnKill", 5000, false, "i", playerid);
}

// Forward (make public) the function so the server can 'see' it
forward EndAntiSpawnKill(playerid);

// The timer function - the code to be executed when the timer is called goes here
public EndAntiSpawnKill(playerid)
{
  // 5 seconds has passed, so let's set their health back to 100
  SetPlayerHealth(playerid, 100);

  // Let's notify them also
  SendClientMessage(playerid, -1, "You are no longer protected against spawn-killing.");
  return 1;
}
Reply
#2
No. Anti spawnkill, maybe, but what about all those idlers on the ship?
Reply
#3
(12-05-2016, 05:17 PM)Harambe Wrote: No. Anti spawnkill, maybe, but what about all those idlers on the ship?

Isn't the purpose of the ship ment for idlers?
Reply
#4
We already have an anti-idling mechanism at play on the server, and an anti-spawnkill has been suggested already. Putting time and effort into preventative measures against death evasion (with specific regard to quitting/minimization) is almost moot, considering the fact that players can always simply quit the game to do so. We do already have certain restrictions for our teleportation systems (including interiors), though. Overall, it is best to simply report these players when you come across them. :)
Reply
#5
Ricky, that's what I meant lol, what about them ? They are always afk xd
Reply
#6
(12-05-2016, 07:57 PM)TEF Wrote: We already have an anti-idling mechanism at play on the server, and an anti-spawnkill has been suggested already. Putting time and effort into preventative measures against death evasion (with specific regard to quitting/minimization) is almost moot, considering the fact that players can always simply quit the game to do so. We do already have certain restrictions for our teleportation systems (including interiors), though. Overall, it is best to simply report these players when you come across them. :)

Why Chepe he always afk and there's nothing happen to him he always stay in the ship and afking
Reply
#7
That's the purpose of a ship, peaople are granted invincibility so they can idle in there
Also, i don't know what you have against idlers, but they are not doing any harm... So i think this anti afk suggestion is pretty much useless
Reply
#8
I can AFK in the ship safetly?
Reply
#9
Yes, the ship is for a reason weapon-free and vehicles won't be able to enter that zone.

I do recommend though to keep idling at a minimum!
Reply
#10
Idling is absolutely fine. We have proper systems in place to make sure that it won't affect your stats.

I think that Yassine uploaded a pull request for adding spawn protection, but I haven't been able to get to that yet. I agree that we should add something like that.
Reply