respawn command
#6

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
PHP код:
CMD:respawnplayers(playeridparams[])
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);//get pos of the player doing the cmd
    
for(new iGetPlayerPoolSize(); <= ji++)//loop through all players
    
{
        if(
IsPlayerInRangeOfPoint(i10.0xyz) && != playerid)//check if any player is in range of the player who did the command and that player is not the command issuer.
        
{
            
SpawnPlayer(i);//spawn him
//etc code 
So it should look somewhere like that?

Код:
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 5 seconds before using /respawn again!");
   Killed[playerid] = 0;
   SetPVarInt(playerid,"CMDABUSE",GetTickCount()+5000); // anti abuse measurements
   new Float:x, Float:y, Float:z;
   GetPlayerPos(playerid, x, y, z);//get pos of the player doing the cmd
    for(new i, j = GetPlayerPoolSize(); i <= j; i++)//loop through all players
    {
        if(IsPlayerInRangeOfPoint(i, 10.0, x, y, z) && i != playerid)
        {
            SpawnPlayer(i);//spawn him
		}
	 }
   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!");
   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;
}
Reply


Messages In This Thread
respawn command - by ivndosos - 15.02.2018, 10:00
Re: respawn command - by RogueDrifter - 15.02.2018, 10:03
Re: respawn command - by PepsiCola23 - 15.02.2018, 10:35
Re: respawn command - by ivndosos - 15.02.2018, 10:49
Re: respawn command - by RogueDrifter - 15.02.2018, 10:57
Re: respawn command - by ivndosos - 15.02.2018, 11:06
Re: respawn command - by Mugala - 15.02.2018, 11:13
Re: respawn command - by ivndosos - 19.02.2018, 19:43
Re: respawn command - by ivndosos - 09.03.2018, 06:16
Re: respawn command - by KayJ - 09.03.2018, 06:22

Forum Jump:


Users browsing this thread: 1 Guest(s)