Započeo .варнинг
•3. Jul 2018.• ZaključanoDamage Informer
1,177
pregleda
7
postova
Made Man
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
430
Postovi:
105
Teme:
Pridružio se:Maj 2017
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:
OnPlayerTake i GiveDamage:
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): ///
Slika/video ingame problema(obavezno ako je ingame problem): ///
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): ///
Made Man
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
430
Postovi:
105
Teme:
Pridružio se:Maj 2017
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... 😛
Godfather
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
241 / 250 XP
Početnik(0)
2,043
Postovi:
83
Teme:
Pridružio se:Jan. 2014
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;
}Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
731
Postovi:
29
Teme:
Pridružio se:Nov. 2016
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).
Kingpin
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosAktivan Član
2 / 250 XP
Početnik(1)
1,147
Postovi:
38
Teme:
Pridružio se:Feb. 2010
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)
😕
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