15.02.2018, 10:00
I have my respawn command, It works good and all, but how do I make it to respawn nearby players? ( Not too nearby, but with a little distance as I would say something about from binco to grove street distance! )
Код:
CMD:respawn(playerid, params[]) { if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5); if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,-1,"{c3c3c3}(INFO) You need to wait 10 seconds before using /respawn again!"); Killed[playerid] = 0; SetPVarInt(playerid,"CMDABUSE",GetTickCount()+10000); // anti abuse measurements new interiorID = GetPlayerInterior(playerid); new Float:health; GetPlayerHealth(playerid,health); if(interiorID == 10) return SendClientMessage(playerid, -1, "{c3c3c3}You can't use /respawn while in lobby, type /back first!"); // checking if player is in /lobby before typing /respawn if(health > 90) { SpawnPlayer(playerid); SendClientMessage(playerid, -1, "{c3c3c3}(INFO) You have respawned!"); PlayerTotalKills[playerid] = 0; Killed[playerid] = 0; } else { SendClientMessage(playerid, -1, "{c3c3c3}(INFO) Atleast 90hp is required in order to respawn."); } return 1; }