Jump to content
  • 0

Sendclientmessage


Speis.

Question

YCMD:mygoal(playerid, params[], help){
    new string[128];
    SCM(playerid, -1, "//-----------JOB GOAL-----------//");
    if(PlayerInfo[playerid][pMyGoal] < 30){
        format(string, sizeof(string), "Momentan ai adunat doar %d. Pentru a primi bonusul, ai nevoie de minim 40!",PlayerInfo[playerid][pMyGoal]);
        SCM(playerid, COLOR_RED, string);
    }
    else if(PlayerInfo[playerid][pMyGoal] > 40){
        format(string, sizeof(string), "Felicitari! Ai acumulat %d salarii.Munceste mai mult pentru un bonus mai mare!",PlayerInfo[playerid][pMyGoal]);
        SCM(playerid, COLOR_LIGHTBLUE, string);
    }
    return true;
}

 

Cred ca e ceva banal dar nu inteleg de ce in al2lea caz nu imi afiseaza mesajul ( cand ai peste 40 de salarii ).

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Acum 2 ore, Speis. a spus:

YCMD:mygoal(playerid, params[], help){
    new string[128];
    SCM(playerid, -1, "//-----------JOB GOAL-----------//");
    if(PlayerInfo[playerid][pMyGoal] < 30){
        format(string, sizeof(string), "Momentan ai adunat doar %d. Pentru a primi bonusul, ai nevoie de minim 40!",PlayerInfo[playerid][pMyGoal]);
        SCM(playerid, COLOR_RED, string);
    }
    else if(PlayerInfo[playerid][pMyGoal] > 40){
        format(string, sizeof(string), "Felicitari! Ai acumulat %d salarii.Munceste mai mult pentru un bonus mai mare!",PlayerInfo[playerid][pMyGoal]);
        SCM(playerid, COLOR_LIGHTBLUE, string);
    }
    return true;
}

 

Cred ca e ceva banal dar nu inteleg de ce in al2lea caz nu imi afiseaza mesajul ( cand ai peste 40 de salarii ).

mareste string-ul

  • Upvote 1

YouTube : Click

Discord : CosminAK47#8524

Link to comment
Share on other sites

  • 0

Salutare, in comanda ta se verifica doar cazurile mai mici de 30 si mai mari de 40, adica daca variabila va avea una din valorile 30,31,32,33,34,35,36,37,38,39,40 nu se va intampla nimic

Ai 2 variante, scoti else if sau modifici >=30 inloc de > 40

 

YCMD:mygoal(playerid, params[], help){
    new string[128];
    SCM(playerid, -1, "//-----------JOB GOAL-----------//");
    if(PlayerInfo[playerid][pMyGoal] < 30){// inloc de 30 modifici cu 40 sau valoarea de care ai tu nevoie
        format(string, sizeof(string), "Momentan ai adunat doar %d. Pentru a primi bonusul, ai nevoie de minim 40!",PlayerInfo[playerid][pMyGoal]);
        SCM(playerid, COLOR_RED, string);
    }
    else if(PlayerInfo[playerid][pMyGoal] >= 30){
        format(string, sizeof(string), "Felicitari! Ai acumulat %d salarii.Munceste mai mult pentru un bonus mai mare!",PlayerInfo[playerid][pMyGoal]);
        SCM(playerid, COLOR_LIGHTBLUE, string);
    }
    return true;
}
YCMD:mygoal(playerid, params[], help){
    new string[128];
    SCM(playerid, -1, "//-----------JOB GOAL-----------//");
    if(PlayerInfo[playerid][pMyGoal] < 30){ // inloc de 30 modifici cu 40 sau valoarea de care ai tu nevoie
        format(string, sizeof(string), "Momentan ai adunat doar %d. Pentru a primi bonusul, ai nevoie de minim 40!",PlayerInfo[playerid][pMyGoal]);
        SCM(playerid, COLOR_RED, string);
    }
    else
   {
        format(string, sizeof(string), "Felicitari! Ai acumulat %d salarii.Munceste mai mult pentru un bonus mai mare!",PlayerInfo[playerid][pMyGoal]);
        SCM(playerid, COLOR_LIGHTBLUE, string);
    }
    return true;
}
  • Thanks 1

 

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

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.