Jump to content
  • 0

Problema


Exaton

Question

Salut grup am si eu o problema am facut un actor ca cand ajunge la hp 0 sa dispara el in sine ajunge la hp 0 dar nu mai dispare stie cineva ce are?

new Float: ActorHP[MAX_PLAYERS];
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart) {
    GetActorHealth(MyActor[playerid], ActorHP[playerid]);
    if(damaged_actorid == MyActor[playerid]) {
        SetActorHealth(MyActor[playerid], ActorHP[playerid]-7);
    }
    if(ActorHP[playerid] <= 0) {
        DestroyActor(MyActor[playerid]);
    }
    return 1;
}

cand ajunge la hp 0 nu vrea sa execute aceasta functie stie cineva de ce?

    if(ActorHP[playerid] <= 0) {
        DestroyActor(MyActor[playerid]);
    }

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Acum 43 minute, Exaton a spus:

Salut grup am si eu o problema am facut un actor ca cand ajunge la hp 0 sa dispara el in sine ajunge la hp 0 dar nu mai dispare stie cineva ce are?

new Float: ActorHP[MAX_PLAYERS];
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart) {
    GetActorHealth(MyActor[playerid], ActorHP[playerid]);
    if(damaged_actorid == MyActor[playerid]) {
        SetActorHealth(MyActor[playerid], ActorHP[playerid]-7);
    }
    if(ActorHP[playerid] <= 0) {
        DestroyActor(MyActor[playerid]);
    }
    return 1;
}

cand ajunge la hp 0 nu vrea sa execute aceasta functie stie cineva de ce?

    if(ActorHP[playerid] <= 0) {
        DestroyActor(MyActor[playerid]);
    }

Incearca asa

new Float: ActorHP[MAX_PLAYERS];
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart) 
{
    GetActorHealth(MyActor[playerid], ActorHP[playerid]);
    if(damaged_actorid == MyActor[playerid]) 
    {
        SetActorHealth(MyActor[playerid], ActorHP[playerid]-7);
        if(ActorHP[playerid] <= 0) DestroyActorHP();
    }
    return 1;
}

function DestroyActorHP()
{
	DestroyActor(MyActor[playerid]);
	SendClientMessage(playerid, -1, "[Actor]: Actorul a murit.");
	return 1;
}

 

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

Link to comment
Share on other sites

  • 0
Acum 2 ore, StrikerM a spus:

Incearca asa


new Float: ActorHP[MAX_PLAYERS];
public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float: amount, weaponid, bodypart) 
{
    GetActorHealth(MyActor[playerid], ActorHP[playerid]);
    if(damaged_actorid == MyActor[playerid]) 
    {
        SetActorHealth(MyActor[playerid], ActorHP[playerid]-7);
        if(ActorHP[playerid] <= 0) DestroyActorHP();
    }
    return 1;
}

function DestroyActorHP()
{
	DestroyActor(MyActor[playerid]);
	SendClientMessage(playerid, -1, "[Actor]: Actorul a murit.");
	return 1;
}

 

e la fel, actorul se distruge doar atunci cand definesc ActorHP asa new ActorHP[MAX_PLAYERS] = 100; se duce in hp 0 dispare cand fac din nou actorul cu comanda /actor si da in el dispare instant din primul glont dar in comanda /actor actorul este setat pe hp 100 

Edited by Exaton
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.