SA-MP Forums Archive
Detecter perca de muniзгo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: Detecter perca de muniзгo (/showthread.php?tid=214109)



Detecter perca de muniзгo - Black Sσldiєя - 20.01.2011

Alguйm teria alguma forma? Tentei, tentei e nгo consegui. Preciso disso, pra saber realmente se o player estб atirando.
Atй mais.


Re: Detecter perca de muniзгo - [FeK]Knife - 20.01.2011

pawn Код:
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys)
{
if ( newkeys == KEY_FIRE)
{
SendClientMessage(playerid,COR,"Vocк ta atirando RIARIAIRAIAR");
}
return 1;
}



Re: Detecter perca de muniзгo - Black Sσldiєя - 20.01.2011

Isso eu sei, mas nгo serve. :/
Tem que calcular se a muniзгo diminui.


Re: Detecter perca de muniзгo - Macintosh - 20.01.2011

Eu acho que nгo й sу no mouse que atira nao viu Knife '-'


Respuesta: Detecter perca de muniзгo - ipsBruno - 20.01.2011

pawn Код:
public OnPlayerUpdate(playerid)
{
    static Count,Ammo,Ping;
    Ping = GetPlayerPing(playerid);
    if(Count > Ping - (Ping / 2))
    {
        if(Ammo != GetPlayerAmmo(playerid))
        {
            Count = 0;
            //municao perdida
        }
       
    }
    else
    {
        Ammo = GetPlayerAmmo(playerid);
        ++Count;
    }
    return true;
}



Re: Detecter perca de muniзгo - [FeK]Knife - 20.01.2011

Sim Sim , atira com varias teclas. Mas eu tinha entendido a pergunta dele se tem como verificar se o cara tava atirando ._.


Re: Detecter perca de muniзгo - simstosh - 20.01.2011

Tem um include pra checar se o player acertou outro player.

https://sampforum.blast.hk/showthread.php?tid=195439

Agora pra checar se ele atirou, nгo sei.


Respuesta: Detecter perca de muniзгo - ipsBruno - 20.01.2011

Sempre me ignorando essas pessoas,que feio,agora atй me sinto triste

pawn Код:
public OnPlayerUpdate(playerid)
{
    static Count,Ammo,Ping;
    Ping = GetPlayerPing(playerid);
    if(Count > Ping - (Ping / 2))
    {
        if(Ammo != GetPlayerAmmo(playerid))
        {
            Count = 0;
            //municao perdida
        }
       
    }
    else
    {
        Ammo = GetPlayerAmmo(playerid);
        ++Count;
    }
    return true;
}
NOVAMENTE /\


Re: Detecter perca de muniзгo - Black Sσldiєя - 20.01.2011

Drakins, seu mйtodo funcionou, porйm o cбlculo ficou lento com as sub-metralhadores e fuzis. Eu fiz aqui de outro jeito, usei SetTimer mesmo.
Obrigado pela ajuda e atenзгo manolinhos.