*** Terrible Title Removed
#1

Yesterday, I went to sleep
Today I wake up, admins saying server was full
but any class, any player, doesn't take damage, the HP bar refills
PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponid)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
        new 
Float:health;
        
GetPlayerHealth(playeridhealth);
        if(
weaponid == 7)
                        
SetPlayerHealth(playerid,health-12);
        if(
weaponid == 8)
                        
SetPlayerHealth(playerid,health-90);
        if(
weaponid == 4)
                        
SetPlayerHealth(playerid,health-78);
        if(
weaponid == 3)
                        
SetPlayerHealth(playerid,health-11);
        if(
weaponid == 5)
                        
SetPlayerHealth(playerid,health-11);
        if(
weaponid == 23)
                        
SetPlayerHealth(playerid,health-53);
        if(
weaponid == 24)
                        
SetPlayerHealth(playerid,health-90);
        if(
weaponid == 22)
                        
SetPlayerHealth(playerid,health-39);
        if(
weaponid == 25)
                        
SetPlayerHealth(playerid,health-65);
        if(
weaponid == 26)
                        
SetPlayerHealth(playerid,health-48);
        if(
weaponid == 27)
                        
SetPlayerHealth(playerid,health-32);
        if(
weaponid == 28)
                        
SetPlayerHealth(playerid,health-28);
        if(
weaponid == 29)
                        
SetPlayerHealth(playerid,health-31);
        if(
weaponid == 30)
                        
SetPlayerHealth(playerid,health-41);
        if(
weaponid == 31)
                        
SetPlayerHealth(playerid,health-41);
        if(
weaponid == 32)
                        
SetPlayerHealth(playerid,health-27);
        if(
weaponid == 33)
                        
SetPlayerHealth(playerid,health-97);
        if(
weaponid == 34)
                        
SetPlayerHealth(playerid,health-213);
        if(
weaponid == 33)
                        
SetPlayerHealth(playerid,health-97);
        if(
weaponid == 33)
                       
SetPlayerHealth(playerid,health-97);
    }
    return 
1;

It's not that, anyone?

Another thing, Quit messages aren't sending
PHP код:
//Public OnPlayerDisconnect.
public OnPlayerDisconnect(playeridreason)
{
    new 
INI:File INI_Open(UserPath(playerid));
    
INI_SetTag(File,"Player's Data");
    
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
    
INI_WriteInt(File,"WantedLevel",GetPlayerWantedLevel(playerid));
    
INI_WriteInt(File,"AdminLevel",PlayerInfo[playerid][pAdminLevel]);
    
INI_WriteInt(File,"Army",PlayerInfo[playerid][pArmy]);
    
INI_WriteInt(File,"BankAccount",PlayerInfo[playerid][pBankAccount]);
    
INI_WriteInt(File,"Datasaved",PlayerInfo[playerid][pAccountdata]);
    
INI_WriteInt(File,"Arrests",PlayerInfo[playerid][pArrests]);
    
INI_WriteInt(File,"Robberies",PlayerInfo[playerid][pRobberies]);
    
INI_WriteInt(File,"Hits",PlayerInfo[playerid][pHits]);
    
INI_WriteInt(File,"Tazers",PlayerInfo[playerid][pTazers]);
    
INI_WriteInt(File,"Heals",PlayerInfo[playerid][pHeals]);
    
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    
INI_WriteInt(File,"AntiBanned",PlayerInfo[playerid][pABanned]);
    
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
    
INI_WriteInt(File,"Jail",PlayerInfo[playerid][pJail]);
    
INI_Close(File);
    
ResetVariables(playerid);
    
TextDrawDestroy(JailTimer[playerid]);
    
LeaveGroup(playerid2);
    
//=================================IRC====================================//
    
new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
    switch(
reason)
    {
        case 
0reasonMsg "Timeout";
        case 
1reasonMsg "Leaving";
        case 
2reasonMsg "Kicked";
    }
    
GetPlayerName(playeridnamesizeof(name));
    
format(leaveMsgsizeof(leaveMsg), "02[%d] 03*** %s has left the server. (%s)"playeridnamereasonMsg);
    
IRC_GroupSay(groupIDIRC_CHANNELleaveMsg);
    
IRC_GroupSay(groupIDADMIN_CHANNELleaveMsg);
    
//========================================================================//
    
new pname[MAX_PLAYER_NAME], string[63 MAX_PLAYER_NAME];
    switch(
reason)
    {
        case 
0reasonMsg "Timeout";
        case 
1reasonMsg "Leaving";
        case 
2reasonMsg "Kicked";
    }
    
GetPlayerName(playeridpnamesizeof(pname));
    
format(stringsizeof(string), "%s(%d) has Left the server. (%s)",pnameplayerid,reasonMsg);
    
SendClientMessageToAll(COLOR_CYANstring);
    return 
1;

Reply
#2

Check for SetPlayerTeam.
Reply
#3

@SuperViper, Explain more.
PHP код:
//Stock SetPlayerTeamFromClass.
stock SetPlayerTeamFromClass(playeridclassid)
{
    switch(
classid)
    {
        case 
0:
        {
            
gTeam[playerid] = TEAM_CIVIL;
        }
        case 
1:
        {
            
gTeam[playerid] = TEAM_COP;
        }
        case 
2:
        {
            
gTeam[playerid] = TEAM_ARMY;
        }
         case 
3:
        {
            
gTeam[playerid] = TEAM_CIA;
        }
         case 
4:
        {
            
gTeam[playerid] = TEAM_MEDIC;
        }
         case 
5:
        {
            
gTeam[playerid] = TEAM_FIRE;
        }
    }
    return 
1;

Reply
#4

Bump
Reply
#5

I'm sorry for bumping again, but It's important, I can't leave players online with their HP refilling :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)