Jump to content

[REZOLVAT] Job Goal cu procentaj


AleXw0w
 Share

Recommended Posts

Intrebare: Cum pot sa adaug procentaj la un Job Goal? 
Ai încercat să faci ceva înainte să postezi?: Da, am luat o "functie" de calcul de pe net, dar vad ca nu merge, apare mereu 0%, iar cand se umple goal-ul apare 100%, dar in rest nu se modifica...

 

ServerGoal = cat s-a strans. SERVER_GOAL = cat trebuie strans.
    new Float:percentamount = ServerGoal / SERVER_GOAL * 100;
    PlayerTextDrawShow(i, ServerGoalPTD[0]);
    PlayerTextDrawShow(i, ServerGoalPTD[1]);
    format(string, sizeof(string), "Server Goal (%.0f%s)", percentamount, "%");
    PlayerTextDrawSetString(i, ServerGoalPTD[0], string);
    format(string, sizeof(string), "~g~$%s~w~ out of ~y~$%s", FormatNumber(ServerGoal), FormatNumber(SERVER_GOAL));
    PlayerTextDrawSetString(i, ServerGoalPTD[1], string);

 
POZA: image.thumb.png.8b9ea7da593f197cb1239c00259060d6.png

W0W

Link to comment
Share on other sites

Acum 5 ore, Wildo a spus:

Pune-i  un timer de 5-10 secunde ca sa se actualizeze textdraw-ul sau introdu-l unde ai un timer de 1 secunda ca sa testezi sa vezi daca ai facut totul ok.

    if(PlayerInfo[pShowGoal] != 0) {
    new Float:percentamount = ServerGoal / SERVER_GOAL * 100;
    PlayerTextDrawShow(i, ServerGoalPTD[0]);
    PlayerTextDrawShow(i, ServerGoalPTD[1]);
    format(string, sizeof(string), "Server Goal (%.0f%s)", percentamount, "%");
    PlayerTextDrawSetString(i, ServerGoalPTD[0], string);
    format(string, sizeof(string), "~g~$%s~w~ out of ~y~$%s", FormatNumber(ServerGoal), FormatNumber(SERVER_GOAL));
    PlayerTextDrawSetString(i, ServerGoalPTD[1], string);
    updatesvgoal(i);
    }

Este deja la functia Timers si tot degeaba

W0W

Link to comment
Share on other sites

Incearca:

 

if(PlayerInfo[pShowGoal] != 0) {
    PlayerTextDrawShow(i, ServerGoalPTD[0]);
    PlayerTextDrawShow(i, ServerGoalPTD[1]);
    format(string, sizeof(string), "Server Goal (%.2f%%)", ((float(ServerGoal) / float(SERVER_GOAL)) * 100));
    PlayerTextDrawSetString(i, ServerGoalPTD[0], string);
    format(string, sizeof(string), "~g~$%s~w~ out of ~y~$%s", FormatNumber(ServerGoal), FormatNumber(SERVER_GOAL));
    PlayerTextDrawSetString(i, ServerGoalPTD[1], string);
    updatesvgoal(i);
}

Link to comment
Share on other sites

Acum 11 minute, SorinGamerYT a spus:

Incearca:

 

if(PlayerInfo[pShowGoal] != 0) {
    PlayerTextDrawShow(i, ServerGoalPTD[0]);
    PlayerTextDrawShow(i, ServerGoalPTD[1]);
    format(string, sizeof(string), "Server Goal (%.2f%%)", ((float(ServerGoal) / float(SERVER_GOAL)) * 100));
    PlayerTextDrawSetString(i, ServerGoalPTD[0], string);
    format(string, sizeof(string), "~g~$%s~w~ out of ~y~$%s", FormatNumber(ServerGoal), FormatNumber(SERVER_GOAL));
    PlayerTextDrawSetString(i, ServerGoalPTD[1], string);
    updatesvgoal(i);
}

Tot asa...

W0W

Link to comment
Share on other sites

35 minutes ago, AlexRoRp said:

Tot asa...

Incearca atunci asta

 


if(PlayerInfo[pShowGoal] != 0) {
    format(string, sizeof(string), "Server Goal (%.2f%%)", ((float(ServerGoal) / float(SERVER_GOAL)) * 100));
    PlayerTextDrawSetString(i, ServerGoalPTD[0], string);
    format(string, sizeof(string), "~g~$%s~w~ out of ~y~$%s", FormatNumber(ServerGoal), FormatNumber(SERVER_GOAL));
    PlayerTextDrawSetString(i, ServerGoalPTD[1], string);

    PlayerTextDrawShow(i, ServerGoalPTD[0]);
    PlayerTextDrawShow(i, ServerGoalPTD[1]);
    
    updatesvgoal(i);
}

Link to comment
Share on other sites

Acum 9 minute, SorinGamerYT a spus:

Incearca atunci asta

 


if(PlayerInfo[pShowGoal] != 0) {
    format(string, sizeof(string), "Server Goal (%.2f%%)", ((float(ServerGoal) / float(SERVER_GOAL)) * 100));
    PlayerTextDrawSetString(i, ServerGoalPTD[0], string);
    format(string, sizeof(string), "~g~$%s~w~ out of ~y~$%s", FormatNumber(ServerGoal), FormatNumber(SERVER_GOAL));
    PlayerTextDrawSetString(i, ServerGoalPTD[1], string);

    PlayerTextDrawShow(i, ServerGoalPTD[0]);
    PlayerTextDrawShow(i, ServerGoalPTD[1]);
    
    updatesvgoal(i);
}

Nu merge.

W0W

Link to comment
Share on other sites

1 oră în urmă, SorinGamerYT a spus:

Incearca atunci asta

 


if(PlayerInfo[pShowGoal] != 0) {
    format(string, sizeof(string), "Server Goal (%.2f%%)", ((float(ServerGoal) / float(SERVER_GOAL)) * 100));
    PlayerTextDrawSetString(i, ServerGoalPTD[0], string);
    format(string, sizeof(string), "~g~$%s~w~ out of ~y~$%s", FormatNumber(ServerGoal), FormatNumber(SERVER_GOAL));
    PlayerTextDrawSetString(i, ServerGoalPTD[1], string);

    PlayerTextDrawShow(i, ServerGoalPTD[0]);
    PlayerTextDrawShow(i, ServerGoalPTD[1]);
    
    updatesvgoal(i);
}

Gata, am mai modificat niste chestii, am pus ce mi-ai dat tu si acum merge, ms >3

W0W

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...