SA-MP Forums Archive
[Ajuda] if (player mirando) - 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: [Ajuda] if (player mirando) (/showthread.php?tid=510135)



if (player mirando) - pedrotvr - 29.04.2014

To precisando fazer uma comparaзгo se o player estiver mirando, sу consegui de um jeito:
if(GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID)

Jб tentei de todas as formas que eu achava, tipo:
if(GetPlayerTargetPlayer(playerid)) return 1;
(NADA aconteceu esse if sempre da TRUE, msm se n tiver mirnado)

(PRESSED(KEY_HANDBRAKE))
Nгo deu certo tbm...

Tem como eu dar um get na animaзгo de mirar ou alguma funзгo sei lб atй hj n achei

(ps perdi o outro tуpico, mas ninguйm ajudou jб tem mt tempo)


Re: if (player mirando) - Kuddy - 29.04.2014

https://sampwiki.blast.hk/wiki/GetAnimationName

Agora basta fazer os testes para saber qual й o nome da animaзгo de mirar.


Re: if (player mirando) - gmstrikker - 30.04.2014

Quote:
Originally Posted by pedrotvr
Посмотреть сообщение
To precisando fazer uma comparaзгo se o player estiver mirando, sу consegui de um jeito:
Tem como eu dar um get na animaзгo de mirar ou alguma funзгo sei lб atй hj n achei

(ps perdi o outro tуpico, mas ninguйm ajudou jб tem mt tempo)
Quote:
Originally Posted by Kuddy
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/GetAnimationName

Agora basta fazer os testes para saber qual й o nome da animaзгo de mirar.
kkkkkkkkkkkkkkkkkkkkkkkkkk, excelente ajuda sua agora o cara ta feito, duvido que ele sabia que pra dar get na animaзгo era GetAnimationName


Re: if (player mirando) - pedrotvr - 30.04.2014

Quote:
Originally Posted by Kuddy
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/GetAnimationName

Agora basta fazer os testes para saber qual й o nome da animaзгo de mirar.
Eu sei como dar get em animaзгo, mas tem a animaзгo real de mirar? E como vou achar ela?!


Re: if (player mirando) - ViniBorn - 30.04.2014

Usa uma mensagem pra saber qual o ID da animaзгo que estб sendo usada...


Re: if (player mirando) - pedrotvr - 30.04.2014

Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
Usa uma mensagem pra saber qual o ID da animaзгo que estб sendo usada...
Como? :S


Re: if (player mirando) - Kuddy - 30.04.2014

Quote:
Originally Posted by pedrotvr
Посмотреть сообщение
Como? :S
Olha o link que te passei no primeiro post.

Quote:
Originally Posted by gmstrikker
Посмотреть сообщение
kkkkkkkkkkkkkkkkkkkkkkkkkk, excelente ajuda sua agora o cara ta feito, duvido que ele sabia que pra dar get na animaзгo era GetAnimationName
Se ele sabia era sу ter copiado o cуdigo que estava na wiki, no link que eu passei. Vocк nгo tem moral pra me zoar nгo. Eu ajudei, se vocк nгo entendeu minha resposta era sу perguntar.

Para o cego de plantгo (gmstrikker):
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerAnimationIndex(playerid))
    {
        new animlib[32];
        new animname[32];
        new msg[128];
        GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
        format(msg, 128, "Running anim: %s %s", animlib, animname);
        SendClientMessage(playerid, 0xFFFFFFFF, msg);
    }
    return 1;
}



Re: if (player mirando) - pedrotvr - 30.04.2014

Quote:
Originally Posted by Kuddy
Посмотреть сообщение
Olha o link que te passei no primeiro post.



Se ele sabia era sу ter copiado o cуdigo que estava na wiki, no link que eu passei. Vocк nгo tem moral pra me zoar nгo. Eu ajudei, se vocк nгo entendeu minha resposta era sу perguntar.

Para o cego de plantгo (gmstrikker):
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerAnimationIndex(playerid))
    {
        new animlib[32];
        new animname[32];
        new msg[128];
        GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
        format(msg, 128, "Running anim: %s %s", animlib, animname);
        SendClientMessage(playerid, 0xFFFFFFFF, msg);
    }
    return 1;
}
Obrigado tinha achado isso tbm, mas te dou um +Rep pelo auxilio eu sу nгo consigo pegar o id da animaзгo, pelo menos jб tenho o nome pq pra fazer a comparaзгo precisava do id
if(GetPlayerAnimationIndex(playerid) == "PED", "Gun_stand", 4.1, 0, 1, 1, 1, 1, 1) return 1;
/\ assim n da precisa do id

na samp wiki diz que aqui q tem o id, mas aqui n vejo nada de id :S
http://pastebin.com/b1gYRfMF

Pra qm precisar de id aqui vai a lista numerada dos ids e animaзхes:
http://spelsajten.net/animation_names.inc


Re: if (player mirando) - ProKillerpa - 30.04.2014

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

Estб aн.
Da pra pegar oque vocк precisa.