Jump to content
  • 0

Problema skills burned


CosminZEQ

Question

2 answers to this question

Recommended Posts

  • 0
function GetPlayerSkill(playerid)

{

		case 14: {
            level = PlayerInfo[playerid][pTruckerSkill];
            if(level >= 0 && level < 100) level = 1;
            else if(level >= 100 && level < 150) level = 2;
            else if(level >= 150 && level < 180) level = 3;
            else if(level >= 180 && level < 210) level = 4;
            else if(level >= 210) level = 5;
        }

        return level;

}

function GetPlayerSkill2(playerid, id) {

		case 14: {
            level = PlayerInfo[playerid][pTruckerSkill];
            if(level >= 0 && level < 100) level = 1;
            else if(level >= 100 && level < 150) level = 2;
            else if(level >= 150 && level < 180) level = 3;
            else if(level >= 180 && level < 210) level = 4;
            else if(level >= 210) level = 5;
        }

        return level;

}

YCMD:skills(playerid, params[], help) {

// job 14
        skill = GetPlayerSkill2(playerid, 14);
        if(skill < 5) format(needp, 10, "%d", GetNeedPoints(playerid, 14));
        else needp = "-";
        format(string, sizeof(string), "* Trucker: %d (%d/%s)\n", GetPlayerSkill2(playerid, 14), PlayerInfo[playerid][pTruckerSkill], needp);
        strcat(szDialog, string);

function UpdateJobStats(playerid) {

case 13: {
                if(GetPlayerSkill(playerid) == 5) {
                    format(string, sizeof(string), "Ai skill %d si ai muncit de %d ori.~n~Ai skill maxim la acest job.~n~Ai facut %d drumuri si ai castigat in total $%s.~n~Muncitori la datorie: %d",
                    GetPlayerSkill(i), PlayerInfo[i][pTruckerSkill], CurseFacute[i], FormatNumber(MoneyEarned[i]), GetJobWorkers(14));
                }
                else {                    
                    format(string, sizeof(string), "Ai skill %d si ai muncit de %d ori.~n~Pentru a avansa, ai nevoie de inca %d puncte.~n~Ai facut %d drumuri si ai castigat in total $%s.~n~Muncitori la datorie: %d",
                    GetPlayerSkill(i), PlayerInfo[i][pTruckerSkill], GetNeedPoints(i, PlayerInfo[i][pJob])-PlayerInfo[i][pTruckerSkill], CurseFacute[i], FormatNumber(MoneyEarned[i]), GetJobWorkers(14));
                }
                PlayerTextDrawSetString(i, JobTD, string);
                PlayerTextDrawShow(i, JobTD);
            }    

Ar trebui sa mearga, cred. Sper ca ti-am fost de ajutor.

Edited by BaFFyJunior
Link to comment
Share on other sites

  • 0
On 12/13/2018 at 8:46 PM, BaFFyJunior said:
function GetPlayerSkill(playerid)

{

		case 14: {
            level = PlayerInfo[playerid][pTruckerSkill];
            if(level >= 0 && level < 100) level = 1;
            else if(level >= 100 && level < 150) level = 2;
            else if(level >= 150 && level < 180) level = 3;
            else if(level >= 180 && level < 210) level = 4;
            else if(level >= 210) level = 5;
        }

        return level;

}

function GetPlayerSkill2(playerid, id) {

		case 14: {
            level = PlayerInfo[playerid][pTruckerSkill];
            if(level >= 0 && level < 100) level = 1;
            else if(level >= 100 && level < 150) level = 2;
            else if(level >= 150 && level < 180) level = 3;
            else if(level >= 180 && level < 210) level = 4;
            else if(level >= 210) level = 5;
        }

        return level;

}

YCMD:skills(playerid, params[], help) {

// job 14
        skill = GetPlayerSkill2(playerid, 14);
        if(skill < 5) format(needp, 10, "%d", GetNeedPoints(playerid, 14));
        else needp = "-";
        format(string, sizeof(string), "* Trucker: %d (%d/%s)\n", GetPlayerSkill2(playerid, 14), PlayerInfo[playerid][pTruckerSkill], needp);
        strcat(szDialog, string);

function UpdateJobStats(playerid) {

case 13: {
                if(GetPlayerSkill(playerid) == 5) {
                    format(string, sizeof(string), "Ai skill %d si ai muncit de %d ori.~n~Ai skill maxim la acest job.~n~Ai facut %d drumuri si ai castigat in total $%s.~n~Muncitori la datorie: %d",
                    GetPlayerSkill(i), PlayerInfo[i][pTruckerSkill], CurseFacute[i], FormatNumber(MoneyEarned[i]), GetJobWorkers(14));
                }
                else {                    
                    format(string, sizeof(string), "Ai skill %d si ai muncit de %d ori.~n~Pentru a avansa, ai nevoie de inca %d puncte.~n~Ai facut %d drumuri si ai castigat in total $%s.~n~Muncitori la datorie: %d",
                    GetPlayerSkill(i), PlayerInfo[i][pTruckerSkill], GetNeedPoints(i, PlayerInfo[i][pJob])-PlayerInfo[i][pTruckerSkill], CurseFacute[i], FormatNumber(MoneyEarned[i]), GetJobWorkers(14));
                }
                PlayerTextDrawSetString(i, JobTD, string);
                PlayerTextDrawShow(i, JobTD);
            }    

Ar trebui sa mearga, cred. Sper ca ti-am fost de ajutor.

Voi testa, multumesc de ajutor <3.

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.