Pomoc u vezi OnPlayerGiveDamageActor

Započeo mattazz
26. Sep. 2020. Zaključano
1,174
pregleda
20
postova
_maxy
3
Hustler
26. Sep. 2020.
Pokusavam da napravim kada upucam actora da mi iskoci dialog za dm arenu,ali nikako nece,ako moze neko da pomogne bilo bi super

KOD IZ SKRIPTER:


new Actor_DM;
Actor_DM = CreateDynamicActor(230, 1728.7434,-1655.4818,20.2484,93.0006);

public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart)
{
    if(IsValidActor(Actor_DM))
    {
    new string;
format(string, sizeof(string), "Lokacija:\tIgraca:\n"PPLAVA": "BELA"DeathMatch - Ghost Town\t[%d]\n"PPLAVA": "BELA"DeathMatch - Interior 1\t[%d]\n"PPLAVA": "BELA"DeathMatch - Police Dept.\t[%d]\n"PPLAVA": "BELA"Spawn\tn/a",
  IgracaUDMZoni_GhostTown, IgracaUDMZoni_Interior1, IgracaUDMZoni_PoliceDept);
SPD(playerid, DIALOG_TELEPORT, DSTH, D_NASLOV, string, D_POTVRDI, D_ZATVORI);
    }
    return 1;
}
Danisoni
5
Godfather
26. Sep. 2020.
Zato što si napravio 2 greške:

1. Praviš dinamičnog aktora, a koristiš callback za obične:
zamjeni
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart)

sa
public OnPlayerGiveDamageDynamicActor(playerid, actorid, Float:amount, weaponid, bodypart)


2. Nije ti dobra provjera, moraš provjeriti actor id, ne da li je validan, odnosno u tom slučaju, bilo kojeg dinamičkog aktora da neki igrač opuca, ukoliko je DM aktor validan (bez obzira što njega nije upucao), tebi će se dialog pojaviti.
zamjeni
if(IsValidActor(Actor_DM))

sa
if(actorid == Actor_DM)
Skrilew
6
Godfather
26. Sep. 2020.
Mozes i ovako nesto, koristeci obicne :
new NekiActor;

public OnGameModeInit() {

NekiActor = CreateActor(skinID, X, Y, Z, Rot);
SetActorInvulnerable(NekiActor, 0);
return 1;
}

public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart) {

if(damaged_actorid == NekiActor) {

SendClientMesssage(playerid, -1, "Actor Upucan!");
return 1;
}
return 1;
}


Mozes i dinamicke, potpuno je na tebi, u tom slucaju samo koristis :
OnPlayerGiveDamageDynamicActor(playerid, STREAMER_TAG_ACTOR actorid, Float:amount, weaponid, bodypart)

Umesto ovoga :
OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart)
Chuffy
4
Made Man
26. Sep. 2020.
Mislim da je Slade sve objasnio, ne treba da se ponavljaš.
_maxy
3
Hustler
26. Sep. 2020.
Ja sam stavio ovako sve,ali opet kad ga upucam ne izadje mi taj dialog,nzm do cega je problem

KOD IZ SKRIPTE:


new Actor_DM;

ovo je u ongamemodeinit

Actor_DM = CreateActor(230, 1728.7434,-1655.4818,20.2484,93.0006);
SetActorInvulnerable(Actor_DM, 0);

public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart)
{
    if(damaged_actorid == Actor_DM)
    {
    new string;
format(string, sizeof(string), "Lokacija:\tIgraca:\n"PPLAVA": "BELA"DeathMatch - Ghost Town\t[%d]\n"PPLAVA": "BELA"DeathMatch - Interior 1\t[%d]\n"PPLAVA": "BELA"DeathMatch - Police Dept.\t[%d]\n"PPLAVA": "BELA"Spawn\tn/a",
  IgracaUDMZoni_GhostTown, IgracaUDMZoni_Interior1, IgracaUDMZoni_PoliceDept);
SPD(playerid, DIALOG_TELEPORT, DSTH, D_NASLOV, string, D_POTVRDI, D_ZATVORI);
return 1;
    }
    return 1;
}
_maxy
3
Hustler
27. Sep. 2020.
Pokušao sam i praznu sktiptu VO1D-ov kod,ali opet je isto ja pucam actora ali ne izlazi dialog
Skrilew
6
Godfather
27. Sep. 2020.
Daj kod iz te prazne skripte
_maxy
3
Hustler
27. Sep. 2020.
Evo ovako sam stavio

new NekiAktor;

ovo je u OnGameModeInit

NekiAktor = CreateActor(294, 1728.7434,-1655.4818,20.2484,93.0006);

SetActorInvulnerable(NekiAktor, 0);

 

public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart)

{

if(damaged_actorid == NekiAktor)

{
                SCM(playerid, -1, "VO1D pomaze da fixam");
return 1;

}

return 1;

}

Danisoni
5
Godfather
27. Sep. 2020.
Zašto jednostavno nisi uradio kako sam ti ja napisao?
_maxy
3
Hustler
27. Sep. 2020.
Pa i kad sam uradio ka sto si mi ti rekao nije opet radilo
Danisoni
5
Godfather
27. Sep. 2020.
Pošalji hajde kako si uradio sa mojim kodom,kako je on izgledao kompletan?
Exnas.pwn
5
Godfather
27. Sep. 2020.
Jesi ti retardiran lik ti je napisao da si kreirao dynamic aktora i koristis callback za obicne i ti kazes da su uradio kao sto ti je poslao ?
Nexxy
2
Wheel Man
27. Sep. 2020.
Osnove dečkooooooo
_maxy
3
Hustler
27. Sep. 2020.
@Slade evo sad cu da stavim kao ti,pa cu ds vidim,ako ne radi saljem kod  🙂
_maxy
3
Hustler
27. Sep. 2020.
Evo sad sam radio kao sto si mi ti reko,sad mi reci sta treba radim

Actor_DM = CreateDynamicActor(230, 1728.7434,-1655.4818,20.2484,93.0006);

public OnPlayerGiveDamageDynamicActor(playerid, actorid, Float:amount, weaponid, bodypart)
{
    if(actorid == Actor_DM)
    {
SCM(playerid, -1, "Ne pucaj seljaku boli me");
return 1;
    }
    return 1;
}

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha