OnPlayerTakeDamage

Započeo ★ OneZero ★, Jun 21, 2019, 17:56:36 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Nema niti errora, niti warninga, niti crashdetect nista ne ispise. OnPlayerTakeDamage ne radi kako bi trebao, stavio sam printf da vidim sto se desava. Prvi put kad se pokrene imam oko 80hp, drugi put 40hp i treci put 20. Koristim zadnju verziju includa i ne koristim nikakvu fs koja bi mogal koristiti OnPlayerTakeDamage. Ima netko ideju u cemu je problem?
Deo skripte: [pawn]
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
   printf("PlayerDamage dela!");
   if(issuerid != INVALID_PLAYER_ID)
   {
      if(IgracPolicajac(issuerid))
      {
         if(GetPlayerWeapon(issuerid) == 23)
         {
            printf("Tazer dela!");
            new string[512];
            if(PI[playerid][pTrazeniLevel] == 0) return SCM(issuerid,-1,""CRVENA"* Greska: "BIJELA"Igrac nema Wanted Level!");
            if(IgracPolicajac(playerid)) return SCM(issuerid,-1,""CRVENA"* Greska: "BIJELA"Ne mozes tazovati PD!");
            if(PI[issuerid][pRank] == 0) return SCM(issuerid,-1,""CRVENA"* Greska: "BIJELA"Suspendovan si!");
            if(IsPlayerInAnyVehicle(playerid)) return SCM(issuerid,-1,""CRVENA"* Greska: "BIJELA"Igrac je u vozilu!");
            if(AdminDuty[playerid] == 1) return SCM(issuerid,-1,""CRVENA"* Greska: "BIJELA"Taj igrac je Admin na duznosti!");
            if(DeveloperDuty[playerid] == 1) return SCM(issuerid,-1,""SPLAVA"(UE) Ne mozes tazovati Developera!");
            format(string, sizeof(string), "%s puca tazerom na %s-a i pogadja ga.", GetName(issuerid) ,GetName(playerid));
            ProxDetector(20.0, issuerid, string, PROX,PROX,PROX,PROX,PROX);
            TogglePlayerControllable(playerid, 0); IgracTazovan[playerid] = 1;
            TazerTimer[playerid] = SetTimerEx("TazovanTajmer", 15000, false, "i", playerid);
            OnePlayAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
         }
       }
      if(IgracRanjen[playerid] != 1)
      {
         printf("Prvi dio dela!");
         new Float:hp;
         GetPlayerHealth(playerid,hp);
         if(hp <= 25)
         {
            printf("Drugi dio dela!");
            TogglePlayerControllable(playerid,0);
            IgracRanjen[playerid] = 1;
            new string[128];
            format(string, sizeof(string), "%s je ranjen.",GetName(playerid));
            ProxDetector(20.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
            ApplyAnimation(playerid, "SWAT", "gnstwall_injurd", 4.1, 0, 1, 1, 1, 1, 1);
            RanjenTimer[playerid] = SetTimerEx("RanjenTajmer",15000,true,"i",playerid);
            printf("Zavrseno!");
         }
      }
      if(weaponid == 34 && bodypart == 9)
      {
         printf("Snipe dela!");
         g_SetPlayerHealth(playerid, 0.0); //one shot one kill
      }
   }
   return 1;
}[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [17:35:59] [connection] 127.0.0.1:64129 requests connection cookie.
[17:36:00] [connection] incoming connection: 127.0.0.1:64129 id: 0
[17:36:00] [join] OneZero has joined the server (0:127.0.0.1)
[17:36:29] Drugi dio!
[17:36:29] Treci dio!
[17:36:29] Zavrseno!
[17:36:55] [chat] [OneZero]: s
[17:36:57] [chat] [OneZero]: assssssssss
[17:37:05] Drugi dio!
[17:37:05] Treci dio!
[17:37:05] Zavrseno!
[17:37:59] [chat] [OneZero]: s
[17:38:00] [chat] [OneZero]: aststsat
[17:38:03] [chat] [OneZero]: sstasts
[17:38:13] Drugi dio!
[17:38:13] Treci dio!
[17:38:13] Zavrseno!
[17:38:28] [chat] [OneZero]: a
[17:38:30] [chat] [OneZero]: a
[17:38:50] Drugi dio!
[17:38:50] Treci dio!
[17:38:50] Zavrseno!
[17:38:50] [death] OneZero died 255

Slika/video ingame problema(obavezno ako je ingame problem):

Probaj koristiti OnPlayerGiveDamage.
Third-party Pawn Developer

Ne radi, uopce ne pozove OnPlayerGiveDamage