SA-MP Forums Archive
[Ajuda] Por que nada acontece ?? Actors - 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] Por que nada acontece ?? Actors (/showthread.php?tid=584338)



Por que nada acontece ?? Actors - KinX - 04.08.2015

Fala glr, entao ainda sou iniciante em codigos aqui, sei que ja devia ter aprendido ZCMD , mas vou aprender mais pra frente por causa do tempo .

Fiz um codigo pra testar os actor mas nao acontece nada, queria criar um actor e adicionar uma animacao a ele.

Код:
#include <a_samp>
#include <a_actor>

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/teste", true))
    {
               new Float:x, Float:y, Float:z;
               new Float:Angle;    
               new ActorCJ;
               GetPlayerPos(playerid, x, y, z);
               GetPlayerFacingAngle(playerid, Angle);
               if(Angle == 0.0) 
               {
               ActorCJ = CreateActor(0, x, y + 1.0, z, 0.0);
               SetActorFacingAngle(ActorCJ, 180.0);
               ApplyAnimation(playerid, "BD_FIRE", "Playa_Kiss_03", 4.1, 1, 1, 1, 1, 1, 1);
               ApplyActorAnimation(ActorCJ, "BD_FIRE", "Grlfrd_Kiss_03", 4.1, 0, 0, 0, 0, 0);
               }
               else if(Angle == 180.0) 
               {
               ActorCJ = CreateActor(0, x, y + 1.0, z, 0.0);
               SetActorFacingAngle(ActorCJ, 0.0);
               ApplyAnimation(playerid, "BD_FIRE", "Playa_Kiss_03", 4.1, 1, 1, 1, 1, 1, 1);
               ApplyActorAnimation(ActorCJ, "BD_FIRE", "Grlfrd_Kiss_03", 4.1, 0, 0, 0, 0, 0);
               }
               else if(Angle == 90.0) 
               {
               ActorCJ = CreateActor(0, x, y + 1.0, z, 0.0);
               SetActorFacingAngle(ActorCJ, 270.0);
               ApplyAnimation(playerid, "BD_FIRE", "Playa_Kiss_03", 4.1, 1, 1, 1, 1, 1, 1);
               ApplyActorAnimation(ActorCJ, "BD_FIRE", "Grlfrd_Kiss_03", 4.1, 0, 0, 0, 0, 0);
               }
               else if(Angle == 270.0) 
               {
               ActorCJ = CreateActor(0, x, y + 1.0, z, 0.0);
               SetActorFacingAngle(ActorCJ, 90.0);
               ApplyAnimation(playerid, "BD_FIRE", "Playa_Kiss_03", 4.1, 1, 1, 1, 1, 1, 1);
               ApplyActorAnimation(ActorCJ, "BD_FIRE", "Grlfrd_Kiss_03", 4.1, 0, 0, 0, 0, 0);
               }
               return 1;
       }
       
    return 0;
   
}
Alguem sabe por que nao acontece nada ??

A parte de angulo da face do jogador nгo sei usar direito ainda


Obrigado


Re: Por que nada acontece ?? Actors - willttoonn - 04.08.2015

Olhando seu cуdigo assim por cima, creio que nгo exista nenhum bug.

Vocк jб criou um comando para setar vocк nesse FacingAngle? pois ele sу vai setar se vocк estiver no 90.0, 0.0, 180.0 e etc.. se vocк tiver 180.1, 90.1 nгo vai setar.


Re: Por que nada acontece ?? Actors - KinX - 04.08.2015

Bem pensado.. Vou criar um comando para isso , ja posto aqui

@edit:

Ajeitei algumas coisas aqui e usei esse comando, ja esta funcionadno normal, valeu !