if(killerid != INVALID_PLAYER_ID) SendDeathMessage(killerid, playerid, reason);
else SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
ScoreNaSessao[killerid]++;
CallRemoteFunction("DarDinheiro", "ii", killerid, 100);
if(killerid == INVALID_PLAYER_ID)
{
TogglePlayerSpectating ( playerid , 1 );
PlayerSpectatePlayer ( playerid , 49 );
SetTimerEx ( "FinishPlayerSpectatePlayer" , 5000 , 0 , "i" , playerid );
}
TogglePlayerSpectating ( playerid , 1 );
PlayerSpectatePlayer ( playerid , killerid );
SetTimerEx ( "FinishPlayerSpectatePlayer" , 5000 , 0 , "i" , playerid );
Bom do GM й isso...
PHP код:
|
1° Vocк cometeu Double-Post, se eu nгo me engano, sу pode fazer double-post depois de 24hrs se ninguйm comentar seu post.
Bom, pelo que vi , quando o jogador morre irб aparecer o jogador que o matou nй? Isso estб funcionando? Porque vocк disse que quando o jogador morre ele ainda pode continuar andando mбs com a vida no 0... Se a funзгo de espiar o jogador que matou te matou estiver funcionando, acho que depois que o player parar de espiar o matador, ele irб spawnar, estou certo ou errado? Me corrija por favor se eu estiver errado. Na verdade nгo intendi muito oque vocк quis dizer no post, pois fez um post com uma explicaзгo boa.. |
forward VerificarMorto(playerid);
public VerificarMorto(playerid)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health == 0.0)
{
SpawnPlayer(playerid);
}
return 1;
}
forward FinishPlayerSpectatePlayer (playerid);
public FinishPlayerSpectatePlayer(playerid)
{
TogglePlayerSpectating(playerid, 0);
return 1;
}
Mais ou menos isso, a timer chamada spawna o jogado como vc falou, o bug ocorre com frequкncia depois de reiniciar o servidor eu tentei fazer um timer para verificar se o jogador estб com 0 de vida dar spawn mas n funcionou, veja...
PHP код:
PHP код:
|
public OnPlayerDeath(playerid, killerid, reason)
{
SetTimerEx("AntiFakeFreeKill", 2000,false,"i",playerid);
DarK_OnPlayerDeath(playerid, killerid, reason);
KillTimer(TimerTeleportCP[playerid]);
if(TaX1[playerid] == true)
{
BloquearComandosNoX1[playerid] = false;
ResetPlayerWeapons(playerid);
ResetPlayerWeapons(killerid);
TaX1[playerid] = false;
TaX1[killerid] = false;
SpawnPlayer(killerid);
Playersx1 = 0;
new string[128];
new pname[MAX_PLAYER_NAME];
new matador[MAX_PLAYER_NAME];
GetPlayerName(killerid, matador, sizeof(matador));
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "[X1] {09FF00}%s {00FFE1}venceu o /x1 contra {FF0000}%s{00FFE1} parabйns para o {09FF00}%s{00FFE1}!", matador, pname, matador);
SendClientMessageToAll(AMARELO, string);
}else{
GetPlayerPos(playerid, pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]);
GetPlayerFacingAngle(playerid, pos_info[playerid][pA]);
CriouCaixao++;
ObjetoCaixao[CriouCaixao] = CreateObject(19339, pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]-0.7, 0.00000, 0.00000, pos_info[playerid][pA]);
ObjetoMorto[playerid] = CreateObject(18668, pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]-0.6, 0.00000, 0.00000, 0.00000);
new string[128];
new pname[MAX_PLAYER_NAME];
new matador[MAX_PLAYER_NAME];
GetPlayerName(killerid, matador, sizeof(matador));
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{FF0000}%s{3845FF} foi morto por {00FF22}%s{3845FF} aqui!", pname,matador);
CriouTextoCaixao++;
TextoCaixao[CriouTextoCaixao] = Create3DTextLabel(string, 0xFF00FFFF, pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ], 40.0, 0, 0);
SetTimerEx ( "ApagarObjetoMorto" , 5000 , 0 , "i" , playerid );
if(GetPlayerWeapon(playerid) == 17
|| GetPlayerWeapon(playerid) == 18
|| GetPlayerWeapon(playerid) == 35
|| GetPlayerWeapon(playerid) == 36
|| GetPlayerWeapon(playerid) == 37
|| GetPlayerWeapon(playerid) == 38
|| GetPlayerWeapon(playerid) == 43
|| GetPlayerWeapon(playerid) == 44
|| GetPlayerWeapon(playerid) == 45)
{
return 1;
}
for(new i_slot = 0, gun, ammo; i_slot != 12; i_slot++)
{
new Float:pPosX, Float:pPosY, Float:pPosZ;
GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
GetPlayerWeaponData(playerid, i_slot, gun, ammo);
if(gun != 0 && ammo != 0) CreateDroppedGun(gun, ammo, pPosX+random(2)-random(2), pPosY+random(2)-random(2), pPosZ);
}
}
TextDrawShowForPlayer(playerid, Textdraw10000);
if(killerid != INVALID_PLAYER_ID) SendDeathMessage(killerid, playerid, reason);
else SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
ScoreNaSessao[killerid]++;
CallRemoteFunction("DarDinheiro", "ii", killerid, 100);
if(killerid == INVALID_PLAYER_ID)
{
TogglePlayerSpectating ( playerid , 1 );
PlayerSpectatePlayer ( playerid , 49 );
SetTimerEx ( "FinishPlayerSpectatePlayer" , 5000 , 0 , "i" , playerid );
}
TogglePlayerSpectating ( playerid , 1 );
PlayerSpectatePlayer ( playerid , killerid );
GameTextForPlayer(playerid,"~y~OLHA QUEM TE ~n~~r~MATOU",3000,3);
GameTextForPlayer(killerid,"~y~MENOS UM!",3000,3);
SetTimerEx ( "FinishPlayerSpectatePlayer" , 5000 , 0 , "i" , playerid );
TextDrawHideForPlayer(playerid,txtTimeDisp);
TextDrawHideForPlayer(playerid,txtDateDisp);
if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) ATT_RemovePlayerAttachedObject(playerid, 1);
TextDrawHideForPlayer(playerid,NomeTeleporte[0]);
TextDrawHideForPlayer(playerid,NomeTeleporte[1]);
TextDrawHideForPlayer(playerid,NomeTeleporte[2]);
TextDrawHideForPlayer(playerid,NomeTeleporte[3]);
TextDrawHideForPlayer(playerid,NomeTeleporte[4]);
TextDrawHideForPlayer(playerid,NomeTeleporte[5]);
TextDrawHideForPlayer(playerid,NomeTeleporte[6]);
TextDrawHideForPlayer(playerid,NomeTeleporte[7]);
return 1;
}