Jump to content
  • 0

problema sistem Air gift


InceMan

Question

salut ma-m gândit sa fac un sistem de airgift de la 0 de către mine, bine însa am o problema nu știu sau mai bine nu am cunostintile necesare.

deci nu reușesc sa finalizez partea când x trage în ea sa scadă hp din label un glonț = 1 hp din cutie.

eu la OnPlayerShootDynamicObject am făcut tot ce ma dus pe mine capu dar tot nu scade acele hp din cutie.

ori cum hp din cutie este pus la 3000hp

cod  

asa am la OnPlayerShootDynamicObject 

if(objectid == BoxObject) 
        {
           
           
            if(airBox_HP[objectid] > 0) airBox_HP[objectid] -= random(1);
            new stringtextlabel[500];
            format(stringtextlabel, sizeof(stringtextlabel), "{fff700}[GIFT AIR BOX]{ffffff}\nHP: {FC6A6A}%s \n {FFFFFF}Trage in ea cu arma pana o distrugi.", FormatNumber(airBox_HP[objectid]));
            UpdateDynamic3DTextLabelText(AirLabel, -1, stringtextlabel);
            if(airBox_HP[objectid] <= 0) // Verifici daca au omorat cadoul

            {
                foreach(new x : airBox_Players)
                {

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

salut in primul rand se pot spawna mai mult de un singur drop in acelasi timp? pentru ca daca nu variabila 

airBox_HP 

nu ai nevoie de ea sub forma de vector ci simpu

in al doilea rand

-= random(1);

1 inseamna o singura posibilitate adica doar 0 pune 2 pentru a putea pica random 0 damage sau 1 damage sau cel mai bine pui direct -= 2 sau poti pune -=random(2)+1 si va scadea  ba 1 ba 2

 

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
Acum 51 minute, Mister a spus:

salut in primul rand se pot spawna mai mult de un singur drop in acelasi timp? pentru ca daca nu variabila 


airBox_HP 

nu ai nevoie de ea sub forma de vector ci simpu

in al doilea rand


-= random(1);

1 inseamna o singura posibilitate adica doar 0 pune 2 pentru a putea pica random 0 damage sau 1 damage sau cel mai bine pui direct -= 2 sau poti pune -=random(2)+1 si va scadea  ba 1 ba 2

 

am făcut și cum ai spus tu dar când trag în cutie nu îmi trece de linia asta 

https://imgur.com/a/q6grrt0

if(airBox_HP[objectid] > 0) airBox_HP[objectid] -=random(2)+1;

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

  • 0

nu prea am inteles exact cum ai facut sistemul doar din atata cod, dar incearca o verificare si vezi dupa unde e problema daca chiar nu reusesti sa treci de iful acesta

if(airBox_HP[objectid] > 0) 
{
 printf("HP Box = %d",airBox_HP[objectid]);
 airBox_HP[objectid] -=random(2)+1;
 printf("HP Box = %d dupa",airBox_HP[objectid]);
 
}

 

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
Acum 46 minute, Mister a spus:

nu prea am inteles exact cum ai facut sistemul doar din atata cod, dar incearca o verificare si vezi dupa unde e problema daca chiar nu reusesti sa treci de iful acesta


if(airBox_HP[objectid] > 0) 
{
 printf("HP Box = %d",airBox_HP[objectid]);
 airBox_HP[objectid] -=random(2)+1;
 printf("HP Box = %d dupa",airBox_HP[objectid]);
 
}

 

imi da eroare asa cum ai zis tu sa verific error 001: expected token: ")", but found "�"
error 029: invalid expression, assumed zero

si airBox_HP lam definit asa airBox_HP[MAX_OBJECTS] = 3000,

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.