Jump to content

Question

Posted

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]);
    }

2 answers to this question

Recommended Posts

  • 0
Posted
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.

  • 0
Posted (edited)
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.