[Ajuda] sistema de sede
#2

Algo do tipo, teste e adapte...
PHP код:
enum tInfo {
    
pCheckInAgua
}

new 
TimerInfo[MAX_PLAYERS][tInfo];

forward OnPlayerInAgua(playerid);

public 
OnPlayerConnect(playerid)
{
    
TimerInfo[playerid][pCheckInAgua] = SetTimerEx("OnPlayerInAgua"2000true"i"playerid);
    return 
1;
}

public 
OnPlayerDisconnect(playeridreason)
{
    
KillTimer(TimerInfo[playerid][pCheckInAgua]);
    return 
1;
}

public 
OnPlayerInAgua(playerid)
{
    static 
Floatvida;
    
GetPlayerHealthplayerid,  vida );
    if(
vida != 0.0)
    {
        static 
anime;
         
anime GetPlayerAnimationIndex(playerid);
        if ((
anime== 1544) || (anime== 1250) || (anime== 1062) ||  ((anime>=  1538) && (anime<= 1542)))
        {
            if(
pInfo[playerid][SelectedItem] == 1023// Agua_Cheia
            
{
                
GiveItem[playerid][Agua_Cheia]--;
                
SetPVarInt(playerid,"Sede1",GetPVarInt(playerid,"Sede1")-12);
                
SetProgressBarValue(SedeGetPVarInt(playerid,"Sede1"));
                
UpdateProgressBar(Sedeplayerid);
                return 
1;
            }
        }
    }
    return 
true;

Reply


Messages In This Thread
sistema de sede - by zPawnu - 03.11.2015, 20:42
Re: sistema de sede - by [BOPE]Seu._.Madruga - 04.11.2015, 00:23

Forum Jump:


Users browsing this thread: 1 Guest(s)