Započeo Assassin007
•26. Sep. 2015.• Zaključano[Pomoc]Revive CMD
726
pregleda
11
postova
Enforcer
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
300
Postovi:
29
Teme:
Pridružio se:Dec. 2012
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:
Neke slike/video za lakse dobivanje pomoci(neobavezno):///
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):///
Kingpin
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
1,427
Postovi:
90
Teme:
Pridružio se:Okt. 2012
26. Sep. 2015.
umjesto
i ovako zamjeni svoj kod sa ovim:
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;
}Enforcer
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
300
Postovi:
29
Teme:
Pridružio se:Dec. 2012
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 Minutesforward 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;
}Kingpin
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
1,427
Postovi:
90
Teme:
Pridružio se:Okt. 2012
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;
}Enforcer
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
300
Postovi:
29
Teme:
Pridružio se:Dec. 2012
Enforcer
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
300
Postovi:
29
Teme:
Pridružio se:Dec. 2012
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;
}Enforcer
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
300
Postovi:
29
Teme:
Pridružio se:Dec. 2012
Enforcer
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
300
Postovi:
29
Teme:
Pridružio se:Dec. 2012
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava