Damage Informer

3. Jul 2018. Zaključano
1,131
pregleda
7
postova
Nikola4
4
Made Man
3. Jul 2018.
Problem(error/warning): Ubacio sam DamageInformer i kada padnem ili tako nesto ne pojavi se td na kom pise koliko sam izgubio hp.
Dio skripte: TD:
    for(new i; i < MAX_PLAYERS; ++i)
{
GiveDamage = TextDrawCreate(171.000000, 388.000000, " ");
TextDrawAlignment(GiveDamage, 2);
TextDrawBackgroundColor(GiveDamage, 255);
TextDrawFont(GiveDamage, 2);
TextDrawLetterSize(GiveDamage, 0.160000, 0.599999);
TextDrawColor(GiveDamage, 0x00FF04FF);
TextDrawSetOutline(GiveDamage, 1);
TextDrawSetProportional(GiveDamage, 1);
}

for(new i; i < MAX_PLAYERS; ++i)
{
TakeDamage = TextDrawCreate(440.000000,388.000000, " ");
TextDrawAlignment(TakeDamage, 2);
TextDrawBackgroundColor(TakeDamage, 255);
TextDrawFont(TakeDamage, 2);
TextDrawLetterSize(TakeDamage, 0.160000, 0.599999);
TextDrawColor(TakeDamage, 0xE81010FF);
TextDrawSetOutline(TakeDamage, 1);
TextDrawSetProportional(TakeDamage, 1);
}

OnPlayerTake i GiveDamage:
forward OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid);
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
new s;
format(s, 20, "+Damage %.0f %", amount, playerid);
TextDrawSetString(GiveDamage, s);
TextDrawShowForPlayer(playerid, GiveDamage);
PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
return 1;
}

forward DestruirTextoDraw(playerid);
public DestruirTextoDraw(playerid)
{
TextDrawHideForPlayer(playerid, GiveDamage);
TextDrawHideForPlayer(playerid, TakeDamage);
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
    {
if(IgracPolicajac(issuerid))
{
if(GetPlayerWeapon(issuerid) == 23)
{
new string, Float:Poz;
GetPlayerPos(playerid, Poz, Poz, Poz);
if(IsPlayerInRangeOfPoint(issuerid, 5.0, Poz, Poz, Poz))
{
if(PlayerInfo == 0) return SCM(issuerid,-1,""PLAVA"( INFO ) "SIVA"Igrac nema Wanted Level!");
if(IgracPolicajac(playerid)) return SCM(issuerid,-1,""PLAVA"( INFO ) "SIVA"Ne mozes tazovati PD!");
if(PlayerInfo == 0) return SCM(issuerid,-1,""PLAVA"( INFO ) "SIVA"Suspendovan si!");
if(AdminDuty == 1) return SCM(issuerid,-1,""PLAVA"( INFO ) "SIVA"Taj igrac je Admin na duznosti!");
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);
JBC_TogglePlayerControllable(playerid, 0); IgracTazovan = 1;
TazerTimer = SetTimerEx("TazovanTajmer", 15000, false, "i", playerid);
OnePlayAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
}
}
}
    new s;
format(s, 20, "-Damage %.0f %.0f", amount, playerid);
TextDrawSetString(TakeDamage, s);
TextDrawShowForPlayer(playerid, TakeDamage);
PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
return 1;
}
if (weaponid == WEAPON_GRENADE || weaponid == 51)
{
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, (health - (amount * 0.3)));

FlashbangStage = 1;

HandleFlashbangStage(playerid);
}
return 1;
}

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): ///
Slika/video ingame problema(obavezno ako je ingame problem): ///
Nikola-.-
6
Kingpin
3. Jul 2018.
Moja ti je preporuka da koristis weapon-config.inc jer ima i druge benefite... 😛
Nikola4
4
Made Man
3. Jul 2018.
.бунта wrote on July 3, 2018, 8:28 am:
Moja ti je preporuka da koristis weapon-config.inc jer ima i druge benefite... 😛
Ubacio sam weapon-config, al mi izbaci error da je OnPlayerTakeDamage vec definisan definisan je u includu i kod mene u skrpi (kod mene je za pd, tazer i to) tkd nzm..
Nikola-.-
6
Kingpin
3. Jul 2018.
dodaÅ¡ to za tazer za pd ili Å¡ta već  u include?
Danisoni
5
Godfather
3. Jul 2018.
Pokusaj ovako:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(IgracPolicajac(issuerid))
{
if(GetPlayerWeapon(issuerid) == 23)
{
new string, Float:Poz;
GetPlayerPos(playerid, Poz, Poz, Poz);
if(IsPlayerInRangeOfPoint(issuerid, 5.0, Poz, Poz, Poz))
{
if(PlayerInfo == 0) return SCM(issuerid,-1,""PLAVA"( INFO ) "SIVA"Igrac nema Wanted Level!");
if(IgracPolicajac(playerid)) return SCM(issuerid,-1,""PLAVA"( INFO ) "SIVA"Ne mozes tazovati PD!");
if(PlayerInfo == 0) return SCM(issuerid,-1,""PLAVA"( INFO ) "SIVA"Suspendovan si!");
if(AdminDuty == 1) return SCM(issuerid,-1,""PLAVA"( INFO ) "SIVA"Taj igrac je Admin na duznosti!");
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);
JBC_TogglePlayerControllable(playerid, 0); IgracTazovan = 1;
TazerTimer = SetTimerEx("TazovanTajmer", 15000, false, "i", playerid);
OnePlayAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
}
}
}
}
if(amount >= 1) {
new s;
format(s, 60, "-Damage %.0f", amount);
TextDrawSetString(TakeDamage, s);
TextDrawShowForPlayer(playerid, TakeDamage);
PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
}
if (weaponid == WEAPON_GRENADE || weaponid == 51)
{
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, (health - (amount * 0.3)));
FlashbangStage = 1;
HandleFlashbangStage(playerid);
}
return 1;
}
TerzaScripting
5
Underboss
3. Jul 2018.
.варнинг wrote on July 3, 2018, 12:45 pm:
Ubacio sam weapon-config, al mi izbaci error da je OnPlayerTakeDamage vec definisan definisan je u includu i kod mene u skrpi (kod mene je za pd, tazer i to) tkd nzm..


Kod weapon-configa ti lepo pise da je OnPlayerTakeDamage izbrisan
Quote
OnPlayerGiveDamage and OnPlayerTakeDamage are removed. Use OnPlayerDamage (see below).
Nikola-.-
6
Kingpin
4. Jul 2018.
https://github.com/oscar-broman/samp-weapon-config/blob/master/weapon-config.inc

Sta je ovo u include-u?
red 3222 : public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
😕

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha