Players using /kill command when their health reach almost 5% while fight!
I have a solution! Please find cmd:kill in gamemod and add this line after CMD:kill(playerid) {
if(IsPlayerNearEnemies(playerid)) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You can't use this command near enemies.");
For Example:
CMD:kill(playerid)
{
if(IsPlayerNearEnemies(playerid)) return SendClientMessage(playerid, COLOR_FIREBRICK, "ERROR: You can't use this command near enemies.");
if(IsPlayerInAnyVehicle(playerid))
{
new Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerPos(playerid, pos[0], pos[1], pos[2] + 2.2);//eject the player!
}
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, COLOR_SEA_GREEN, "* You are now dead!");
NotifyPlayer(playerid, "You commited sucide!", 5000);
return 1;
}