[Ajuda] Bug vida
#9

OnPlayerDeath Inteirinho
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
SetTimerEx("AntiFakeFreeKill"2000,false,"i",playerid);
    
DarK_OnPlayerDeath(playeridkilleridreason);
    
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(killeridmatadorsizeof(matador));
        
GetPlayerName(playeridpnamesizeof(pname));
        
format(stringsizeof(string), "[X1] {09FF00}%s {00FFE1}venceu o /x1 contra {FF0000}%s{00FFE1} parabйns para o {09FF00}%s{00FFE1}!"matadorpnamematador);
        
SendClientMessageToAll(AMARELOstring);
    }else{
        
GetPlayerPos(playeridpos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]);
        
GetPlayerFacingAngle(playeridpos_info[playerid][pA]);
        
CriouCaixao++;
        
ObjetoCaixao[CriouCaixao] = CreateObject(19339pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]-0.70.000000.00000pos_info[playerid][pA]);
        
ObjetoMorto[playerid] = CreateObject(18668pos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ]-0.60.000000.000000.00000);
        new 
string[128];
        new 
pname[MAX_PLAYER_NAME];
        new 
matador[MAX_PLAYER_NAME];
        
GetPlayerName(killeridmatadorsizeof(matador));
        
GetPlayerName(playeridpnamesizeof(pname));
        
format(stringsizeof(string), "{FF0000}%s{3845FF} foi morto por {00FF22}%s{3845FF} aqui!"pname,matador);
        
CriouTextoCaixao++;
        
TextoCaixao[CriouTextoCaixao] = Create3DTextLabel(string0xFF00FFFFpos_info[playerid][pX], pos_info[playerid][pY], pos_info[playerid][pZ], 40.000);
        
SetTimerEx "ApagarObjetoMorto" ,  5000 ,  ,  "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 0gunammoi_slot != 12i_slot++)
        {
            
            new 
Float:pPosXFloat:pPosYFloat:pPosZ;
            
GetPlayerPos(playeridpPosXpPosYpPosZ);
            
GetPlayerWeaponData(playeridi_slotgunammo);
            if(
gun != && ammo != 0CreateDroppedGun(gunammopPosX+random(2)-random(2), pPosY+random(2)-random(2), pPosZ);
        }
    }
    
TextDrawShowForPlayer(playeridTextdraw10000);
    if(
killerid != INVALID_PLAYER_IDSendDeathMessage(killeridplayeridreason);
    else  
SendDeathMessage(INVALID_PLAYER_IDplayeridreason);
    
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    
ScoreNaSessao[killerid]++;
    
CallRemoteFunction("DarDinheiro""ii"killerid100);
    if(
killerid == INVALID_PLAYER_ID)
    {
        
        
TogglePlayerSpectating playerid ,  );
        
PlayerSpectatePlayer playerid ,  49 );
        
SetTimerEx "FinishPlayerSpectatePlayer" ,  5000 ,  ,  "i" ,  playerid );
    }
    
TogglePlayerSpectating playerid ,  );
    
PlayerSpectatePlayer playerid ,  killerid );
    
GameTextForPlayer(playerid,"~y~OLHA QUEM TE ~n~~r~MATOU",3000,3);
    
GameTextForPlayer(killerid,"~y~MENOS UM!",3000,3);
    
SetTimerEx "FinishPlayerSpectatePlayer" ,  5000 ,  ,  "i" ,  playerid );
    
TextDrawHideForPlayer(playerid,txtTimeDisp);
    
TextDrawHideForPlayer(playerid,txtDateDisp);
    if(
IsPlayerAttachedObjectSlotUsed(playerid1)) ATT_RemovePlayerAttachedObject(playerid1);
    
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;

Reply


Messages In This Thread
Bug vida - by RafaelMau - 30.10.2015, 15:38
Re: Bug vida - by RafaelMau - 30.10.2015, 21:53
Re: Bug vida - by LockedLucas - 30.10.2015, 21:58
Re: Bug vida - by RafaelMau - 30.10.2015, 22:17
Re: Bug vida - by DjonathaTM - 31.10.2015, 17:10
Re: Bug vida - by RafaelMau - 31.10.2015, 18:16
Re: Bug vida - by DjonathaTM - 31.10.2015, 18:21
Re: Bug vida - by DjonathaTM - 31.10.2015, 20:17
Re: Bug vida - by RafaelMau - 01.11.2015, 01:56

Forum Jump:


Users browsing this thread: 5 Guest(s)