GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: myke - 2015. május 18. - 20:02:33

Cím: Nem mindig adja be az animokat
Írta: myke - 2015. május 18. - 20:02:33
Hali.
Lenne egy olyan problémám, hogy a szerver nem mindig adja be az animokat.
Miért?
Például itt van egy ilyen lábon/fejen/gyomron lövéses script:
 
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(AdminSzoliban[damagedid] == 0)
{
if(GetPlayerWeapon(playerid) >= 22 && GetPlayerWeapon(playerid) <= 34)
{
   new string[128];
   if(sokkolopisztoly[playerid] == 0)
   {
      if(IsPlayerAimingTargetBodyPart(playerid, damagedid, BODY_PART_HEAD))
      {
          SetPlayerHealth(damagedid,0);
           format(string,sizeof(string),\"* %s golyót kapott a fejébe.\",Nev(damagedid));
         ProxDetector(18.0, playerid, string,LILA,LILA,LILA,LILA,LILA);
         SetPlayerChatBubble(damagedid,\"* golyót kapott a fejébe *\", LILA, 15.0, 10000);
      }else if(IsPlayerAimingTargetBodyPart(playerid, damagedid, BODY_PART_TORSO))
      {
          new Float:hp;
          GetPlayerHealth(damagedid,hp);
          SetPlayerHealth(damagedid,hp-50);
          TogglePlayerControllable(damagedid,0);
            ClearAnimations(damagedid);
           ApplyAnimation(damagedid,\"SWAT\",\"gnstwall_injurd\",4.1,0,1,1,1,1);
           ApplyAnimation(damagedid,\"SWAT\",\"gnstwall_injurd\",4.1,0,1,1,1,1);
          format(string,sizeof(string),\"* %s golyót kapott a gyomrába.\",Nev(damagedid));
         ProxDetector(18.0, playerid, string,LILA,LILA,LILA,LILA,LILA);
         SetPlayerChatBubble(damagedid,\"* golyót kapott a gyomrába *\", LILA, 15.0, 10000);
         Serult[damagedid] = true;
      }else if(IsPlayerAimingTargetBodyPart(playerid, damagedid, BODY_PART_LEGS))
      {
          new Float:hp;
          GetPlayerHealth(damagedid,hp);
          SetPlayerHealth(damagedid,hp-20);
          TogglePlayerControllable(damagedid,0);
          ClearAnimations(damagedid);
           ApplyAnimation(damagedid,\"PED\",\"KO_skid_front\",4.1,0,1,1,1,1);
           ApplyAnimation(damagedid,\"PED\",\"KO_skid_front\",4.1,0,1,1,1,1);
             format(string,sizeof(string),\"* %s golyót kapott a lábába.\",Nev(damagedid));
             SetPlayerChatBubble(damagedid,\"* golyót kapott a lábába *\", LILA, 15.0, 10000);
         ProxDetector(18.0, playerid, string,LILA,LILA,LILA,LILA,LILA);
         Serult[damagedid] = true;
      }
   }else
   {
      if(IsPlayerAimingTargetBodyPart(playerid, damagedid, BODY_PART_HEAD))
      {
          TogglePlayerControllable(damagedid,0);
          ClearAnimations(damagedid);
          new Float:hp;
          GetPlayerHealth(damagedid,hp);
          SetPlayerHealth(damagedid,hp);
          ApplyAnimation(damagedid, \"CRACK\", \"crckdeth2\", 4.0, 1, 0, 0, 0, 0);
          ApplyAnimation(damagedid, \"CRACK\", \"crckdeth2\", 4.0, 1, 0, 0, 0, 0);
           format(string,sizeof(string),\"* %s sokkolva lett.\",Nev(damagedid));
         ProxDetector(18.0, playerid, string,LILA,LILA,LILA,LILA,LILA);
         SetPlayerChatBubble(damagedid,\"* sokkolva lett *\", LILA, 15.0, 10000);
      }else if(IsPlayerAimingTargetBodyPart(playerid, damagedid, BODY_PART_TORSO))
      {
          TogglePlayerControllable(damagedid,0);
            ClearAnimations(damagedid);
            new Float:hp;
          GetPlayerHealth(damagedid,hp);
          SetPlayerHealth(damagedid,hp);
           ApplyAnimation(damagedid, \"CRACK\", \"crckdeth2\", 4.0, 1, 0, 0, 0, 0);
           ApplyAnimation(damagedid, \"CRACK\", \"crckdeth2\", 4.0, 1, 0, 0, 0, 0);
          format(string,sizeof(string),\"* %s sokkolva lett.\",Nev(damagedid));
         ProxDetector(18.0, playerid, string,LILA,LILA,LILA,LILA,LILA);
         SetPlayerChatBubble(damagedid,\"* sokkolva lett *\", LILA, 15.0, 10000);
      }else if(IsPlayerAimingTargetBodyPart(playerid, damagedid, BODY_PART_LEGS))
      {
          TogglePlayerControllable(damagedid,0);
          ClearAnimations(damagedid);
          new Float:hp;
          GetPlayerHealth(damagedid,hp);
          SetPlayerHealth(damagedid,hp);
           ApplyAnimation(damagedid, \"CRACK\", \"crckdeth2\", 4.0, 1, 0, 0, 0, 0);
                  ApplyAnimation(damagedid, \"CRACK\", \"crckdeth2\", 4.0, 1, 0, 0, 0, 0);
             format(string,sizeof(string),\"* %s sokkolva lett.\",Nev(damagedid));
             SetPlayerChatBubble(damagedid,\"* sokkolva lett *\", LILA, 15.0, 10000);
         ProxDetector(18.0, playerid, string,LILA,LILA,LILA,LILA,LILA);
      }
   }
}
}
else
{
}
return 1;
}

 
Ha meglőnek, olyan 10-ből 3-szor adja be az illetőnek az animot. Miért?
A válaszokat előre is köszönöm!
Cím: Nem mindig adja be az animokat
Írta: Flash - 2015. május 18. - 20:08:49
Nem az, hogy másodjára játszódik le?
Akkor szerezd be Epsilon animbetöltőjét.
Cím: Nem mindig adja be az animokat
Írta: myke - 2015. május 18. - 20:25:27
Mondhatjuk azt is. Ha paranccsal adom, akkor igen 2x kell beírni. Viszont, mint az előbb leírt scriptbe látod, 2x van az \"ApllyAnimation\" és mégse működik mindig.
Cím: Nem mindig adja be az animokat
Írta: Flash - 2015. május 18. - 20:28:09
Meg se akarod oldani a problémádat, azért nem nézel utána?
Vedd ki az egyiket, hogy 1 lejátszás legyen és rakd be ezt: http://sampforum.hu/index.php?topic=13221
Cím: Nem mindig adja be az animokat
Írta: myke - 2015. május 18. - 20:32:02
Na beraktam, és úgy néz ki működik.
Köszi a segítséget.