[Pomoc]Revive CMD

Započeo Assassin007
26. Sep. 2015. Zaključano
713
pregleda
11
postova
Assassin007
4
Enforcer
26. Sep. 2015.
Skripta koju koristim:Od nule sam krenuo
Detaljan opis problema:Znaci nasao sam na internetu deathsystem i sada sam isao napraviti da  admin moze revive. System je kada igraca netko ubije on se stvori na istom mjestu i lezi dole tako da hitna ga moze izljeciti radi Rp-a a ako nema igraca iz hitne da ga izljeci ima cmd acceptdeath i onda ide na afterlife i poslje tog tajmera stvori se ispred bolnice.E sada imam problem neznam kako da zaustavim AutoDeath timer koji imam.
Dio skripte:
COMANDA
YCMD:arevive(playerid,params[])
{
if(PlayerInfo > 3)
{
  new string, target, reason;
  if(sscanf(params, "us", target,reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /revive ");
  if(IsPlayerConnected(target))
  {
  format(string, sizeof(string), "Admin %s has revive player %s.: %s",PlayerName(playerid), PlayerName(target),reason);
  SendClientMessage(playerid, COLOR_LIGHTRED, string);
  format(string, sizeof(string), "AdmWarning: %s has revive player %s.: %s", PlayerName(playerid), PlayerName(target),reason);
  AMessage(COLOR_LIGHTRED, string);
  ClearAnimations(target);
  SecsToGo = 0;
  KillTimer(AUTODEATH_SECONDS);
  SetPlayerHealth(target, 100);
  SetCameraBehindPlayer(playerid);
  TogglePlayerControllable(playerid,1);
  }
  else
  {
  SendClientMessage(playerid, COLOR_GRAD2, "That player is not injured!");
  }
}
else
{
  SendClientMessage(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
}
return 1;
}
public AutoDeath(playerid)
{
        if (IsDead == 0) { return 0; }
        else if (IsDead == 1)
        {
            new saystring, deathstring, name;
            GetPlayerName(playerid,name,sizeof(name));
            switch (random(2))
            {
            case 0:
            {
                    format(saystring,sizeof(saystring),"%s mumbles: I can't hold more..", name);
                    format(deathstring,sizeof(deathstring),"* %s closes his eyes, falling into death.", name);
            }
            case 1:
            {
                format(saystring,sizeof(saystring),"%s mumbles: Aghh.. It's cold.. I feel something.. A light-..",name);
                format(deathstring,sizeof(deathstring),"* %s is now inmobilized, and dead.",name);
            }
            }
            ProxDetector(30, playerid, deathstring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            ProxDetector(10, playerid, saystring, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);

            IsDead = 0;
            SecsToGo = AFTERLIFE_SECONDS;
            SendClientMessage(playerid,0x00D2E1FF,"------------------ Health Advise -----------------");
            SendClientMessage(playerid,COLOR_WHITE,"You are now in the afterlife. You may rest in peace.");
            SendClientMessage(playerid,COLOR_WHITE,"When you revive, you will lost memory of last 30 minutes.");
            SendClientMessage(playerid,COLOR_WHITE,"If you were non-RPly killed, report the player at the forums.");
            SendClientMessage(playerid,0x00D2E1FF,"--------------------------------------------------------");
            SetPlayerPos(playerid,0, 0, 0);
            SetPlayerCameraPos(playerid,DeathPosX,DeathPosY,DeathPosZ);
            SetPlayerCameraLookAt(playerid,DeathPosX,DeathPosY,DeathPosZ+100);
            AfterLifeTimer = SetTimerEx("AfterLife",1000,true,"i",playerid);
            return 1;
        }
        return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):///
Vuzimir
5
Kingpin
26. Sep. 2015.
umjesto
new AfterLifeTimer;
dodaj:
new AfterLifeTimer;


i ovako zamjeni svoj kod sa ovim:
COMANDA
YCMD:arevive(playerid,params[])
{
if(PlayerInfo > 3)
{
  new string, target, reason;
  if(sscanf(params, "us", target,reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /revive ");
  if(IsPlayerConnected(target))
  {
  format(string, sizeof(string), "Admin %s has revive player %s.: %s",PlayerName(playerid), PlayerName(target),reason);
  SendClientMessage(playerid, COLOR_LIGHTRED, string);
  format(string, sizeof(string), "AdmWarning: %s has revive player %s.: %s", PlayerName(playerid), PlayerName(target),reason);
  AMessage(COLOR_LIGHTRED, string);
  ClearAnimations(target);
  SecsToGo = 0;
  KillTimer(AfterLifeTimer);
  SetPlayerHealth(target, 100);
  SetCameraBehindPlayer(playerid);
  TogglePlayerControllable(playerid,1);
  }
  else
  {
  SendClientMessage(playerid, COLOR_GRAD2, "That player is not injured!");
  }
}
else
{
  SendClientMessage(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
}
return 1;
}

public AutoDeath(playerid)
{
        if (IsDead == 0) { return 0; }
        else if (IsDead == 1)
        {
            new saystring, deathstring, name;
            GetPlayerName(playerid,name,sizeof(name));
            switch (random(2))
            {
            case 0:
            {
                    format(saystring,sizeof(saystring),"%s mumbles: I can't hold more..", name);
                    format(deathstring,sizeof(deathstring),"* %s closes his eyes, falling into death.", name);
            }
            case 1:
            {
                format(saystring,sizeof(saystring),"%s mumbles: Aghh.. It's cold.. I feel something.. A light-..",name);
                format(deathstring,sizeof(deathstring),"* %s is now inmobilized, and dead.",name);
            }
            }
            ProxDetector(30, playerid, deathstring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            ProxDetector(10, playerid, saystring, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);

            IsDead = 0;
            SecsToGo = AFTERLIFE_SECONDS;
            SendClientMessage(playerid,0x00D2E1FF,"------------------ Health Advise -----------------");
            SendClientMessage(playerid,COLOR_WHITE,"You are now in the afterlife. You may rest in peace.");
            SendClientMessage(playerid,COLOR_WHITE,"When you revive, you will lost memory of last 30 minutes.");
            SendClientMessage(playerid,COLOR_WHITE,"If you were non-RPly killed, report the player at the forums.");
            SendClientMessage(playerid,0x00D2E1FF,"--------------------------------------------------------");
            SetPlayerPos(playerid,0, 0, 0);
            SetPlayerCameraPos(playerid,DeathPosX,DeathPosY,DeathPosZ);
            SetPlayerCameraLookAt(playerid,DeathPosX,DeathPosY,DeathPosZ+100);
            AfterLifeTimer = SetTimerEx("AfterLife",1000,true,"i",playerid);
            return 1;
        }
        return 1;
}
Assassin007
4
Enforcer
26. Sep. 2015.
i dalje me vraca u afterlife evo ti sve u vezi autodeath pa ako mozes da pogledas...
#define AUTODEATH_SECONDS          300 // 5 Minutes
forward AutoDeath(playerid);
public AutoDeath(playerid)
{
        if (IsDead == 0) { return 0; }
        else if (IsDead == 1)
        {
            new saystring, deathstring, name;
            GetPlayerName(playerid,name,sizeof(name));
            switch (random(2))
            {
            case 0:
            {
                    format(saystring,sizeof(saystring),"%s mumbles: I can't hold more..", name);
                    format(deathstring,sizeof(deathstring),"* %s closes his eyes, falling into death.", name);
            }
            case 1:
            {
                format(saystring,sizeof(saystring),"%s mumbles: Aghh.. It's cold.. I feel something.. A light-..",name);
                format(deathstring,sizeof(deathstring),"* %s is now inmobilized, and dead.",name);
            }
            }
            ProxDetector(30, playerid, deathstring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            ProxDetector(10, playerid, saystring, COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE);

            IsDead = 0;
            SecsToGo = AFTERLIFE_SECONDS;
            SendClientMessage(playerid,0x00D2E1FF,"------------------ Health Advise -----------------");
            SendClientMessage(playerid,COLOR_WHITE,"You are now in the afterlife. You may rest in peace.");
            SendClientMessage(playerid,COLOR_WHITE,"When you revive, you will lost memory of last 30 minutes.");
            SendClientMessage(playerid,COLOR_WHITE,"If you were non-RPly killed, report the player at the forums.");
            SendClientMessage(playerid,0x00D2E1FF,"--------------------------------------------------------");
            SetPlayerPos(playerid,0, 0, 0);
            SetPlayerCameraPos(playerid,DeathPosX,DeathPosY,DeathPosZ);
            SetPlayerCameraLookAt(playerid,DeathPosX,DeathPosY,DeathPosZ+100);
            AfterLifeTimer = SetTimerEx("AfterLife",1000,true,"i",playerid);
            return 1;
        }
        return 1;
}
OnPLayerSpawn 
  IsAfterLifing = 0;
    if (IsDead == 1)
    {
    SetPlayerPos(playerid,DeathPosX,DeathPosY,DeathPosZ);
    SetPlayerCameraPos(playerid,DeathPosX,DeathPosY,DeathPosZ+5);
    SetPlayerCameraLookAt(playerid,DeathPosX,DeathPosY,DeathPosZ);
    TogglePlayerControllable(playerid,false);
    ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE", 4.0, 0, 0, 0, 1, 0);
    SetTimerEx("AutoDeath",AUTODEATH_SECONDS * 1000,false,"i",playerid);
    SendClientMessage(playerid,0x00D2E1FF,"------------------ Health Advise -----------------");
    SendClientMessage(playerid,COLOR_WHITE,"You are now laying death. You are bleeding to death.");
    SendClientMessage(playerid,COLOR_WHITE,"Remember that the medics can revive you.");
    SendClientMessage(playerid,COLOR_WHITE,"You can type /acceptdeath, if no medics are available.");
    SendClientMessage(playerid,0x00D2E1FF,"--------------------------------------------------------");
    return 1;
    }
Vuzimir
5
Kingpin
26. Sep. 2015.
Ovako probaj:


YCMD:arevive(playerid,params[])
{
if(PlayerInfo > 3)
{
  new string, target, reason;
  if(sscanf(params, "us", target,reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /revive ");
  if(IsPlayerConnected(target))
  {
  format(string, sizeof(string), "Admin %s has revive player %s.: %s",PlayerName(playerid), PlayerName(target),reason);
  SendClientMessage(playerid, COLOR_LIGHTRED, string);
  format(string, sizeof(string), "AdmWarning: %s has revive player %s.: %s", PlayerName(playerid), PlayerName(target),reason);
  AMessage(COLOR_LIGHTRED, string);
  ClearAnimations(target);
IsDead = 0;
  SecsToGo = 0;
  KillTimer(AfterLifeTimer);
  SetPlayerHealth(target, 100);
  SetCameraBehindPlayer(targetid);
  TogglePlayerControllable(targetid,1);
  }
  else
  {
  SendClientMessage(playerid, COLOR_GRAD2, "That player is not injured!");
  }
}
else
{
  SendClientMessage(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
}
return 1;
}
Assassin007
4
Enforcer
26. Sep. 2015.
izbacuje mi warning
warning 215: expression has no effect
Vuzimir
5
Kingpin
26. Sep. 2015.
Pa daj na,kojoj liniji jbt
Assassin007
4
Enforcer
26. Sep. 2015.
YCMD:arevive(playerid,params[])
{
if(PlayerInfo > 3)
{
  new string, target, reason;
  if(sscanf(params, "us", target,reason)) return SendClientMessage(playerid, COLOR_GERY, "USAGE: /arevive ");
  if(IsPlayerConnected(target))
  {
  format(string, sizeof(string), "Admin %s has revive player %s.: %s",PlayerName(playerid), PlayerName(target),reason);
  SendClientMessage(playerid, COLOR_LIGHTRED, string);
  format(string, sizeof(string), "AdmWarning: %s has revive player %s.: %s", PlayerName(playerid), PlayerName(target),reason);
  AMessage(COLOR_LIGHTRED, string);
  ClearAnimations(target);
  IsDead == 0;///ova linija jbt ;D
  SecsToGo = 0;
  KillTimer(AfterLifeTimer);
  SetPlayerHealth(target, 100);
  SetCameraBehindPlayer(playerid);
  TogglePlayerControllable(playerid,1);
  }
  else
  {
  SendClientMessage(playerid, COLOR_GRAD2, "That player is not injured!");
  }
}
else
{
  SendClientMessage(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
}
return 1;
}
Vuzimir
5
Kingpin
26. Sep. 2015.
Linija na kojoj je warning a ne citav kod!!!!!!! 
Assassin007
4
Enforcer
26. Sep. 2015.
Pa citaj kod stavio sam ti kao komentar ova linija jbt -.-
IsDead == 0;
Vuzimir
5
Kingpin
26. Sep. 2015.
Na tel sam i ne vidim kod i napisao sam ti gore daj liniju samo a ne kod. Ovako stavi:
IsDead = 0;
Assassin007
4
Enforcer
26. Sep. 2015.
Moze Lock rijesio sam.  hvala..

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha