Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Text: Rang[MAX_PLAYERS][3],
- Text: Stars[MAX_PLAYERS][14];
- public OnPlayerConnect(playerid)
- {
- Rang[playerid][0] = TextDrawCreate(142.000000, 378.000000, " ");
- TextDrawBackgroundColor(Rang[playerid][0], 0x00000033);
- TextDrawFont(Rang[playerid][0], 2);
- TextDrawLetterSize(Rang[playerid][0], 0.2499, 1.2999);
- TextDrawColor(Rang[playerid][0], -1);
- TextDrawSetOutline(Rang[playerid][0], 1);
- TextDrawSetProportional(Rang[playerid][0], 1);
- Rang[playerid][1] = TextDrawCreate(139.000000, 390.000000, " ");
- TextDrawBackgroundColor(Rang[playerid][1], 0x00000033);
- TextDrawFont(Rang[playerid][1], 2);
- TextDrawLetterSize(Rang[playerid][1], 0.2499, 1.2999);
- TextDrawColor(Rang[playerid][1], -1);
- TextDrawSetOutline(Rang[playerid][1], 1);
- TextDrawSetProportional(Rang[playerid][1], 1);
- Rang[playerid][2] = TextDrawCreate(155.000000, 351.000000, " ");
- TextDrawFont(Rang[playerid][2], 2);
- TextDrawLetterSize(Rang[playerid][2], 0.410000, 2.000000);
- TextDrawColor(Rang[playerid][2], -1);
- TextDrawSetProportional(Rang[playerid][2], 1);
- TextDrawSetShadow(Rang[playerid][2], 0);
- Stars[playerid][0] = TextDrawCreate(83.000000, 327.000000, "]");
- Stars[playerid][1] = TextDrawCreate(97.000000, 328.000000, "]");
- Stars[playerid][2] = TextDrawCreate(110.000000, 333.000000, "]");
- Stars[playerid][3] = TextDrawCreate(123.000000, 341.000000, "]");
- Stars[playerid][4] = TextDrawCreate(133.000000, 351.000000, "]");
- Stars[playerid][5] = TextDrawCreate(139.000000, 364.000000, "]");
- Stars[playerid][6] = TextDrawCreate(23.000000, 377.000000, "]");
- Stars[playerid][7] = TextDrawCreate(68.000000, 328.000000, "]");
- Stars[playerid][8] = TextDrawCreate(54.000000, 332.000000, "]");
- Stars[playerid][9] = TextDrawCreate(41.000000, 339.000000, "]");
- Stars[playerid][10] = TextDrawCreate(31.000000, 350.000000, "]");
- Stars[playerid][11] = TextDrawCreate(25.000000, 362.000000, "]");
- Stars[playerid][12] = TextDrawCreate(25.000000, 392.000000, "]");
- Stars[playerid][13] = TextDrawCreate(31.000000, 405.000000, "]");
- for(new i; i != sizeof(Stars); i ++)
- {
- TextDrawBackgroundColor(Stars[playerid][i], 0x00000000);
- TextDrawFont(Stars[playerid][i], 2);
- TextDrawLetterSize(Stars[playerid][i], 0.300000, 1.100000);
- TextDrawColor(Stars[playerid][i], 0xFFFFFF33);
- TextDrawSetOutline(Stars[playerid][i], 1);
- TextDrawSetProportional(Stars[playerid][i], 1);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForPlayer(playerid, Rang[playerid][0]);
- TextDrawShowForPlayer(playerid, Rang[playerid][1]);
- TextDrawShowForPlayer(playerid, Rang[playerid][2]);
- TextDrawShowForPlayer(playerid, Stars[playerid][0]);
- TextDrawShowForPlayer(playerid, Stars[playerid][1]);
- TextDrawShowForPlayer(playerid, Stars[playerid][2]);
- TextDrawShowForPlayer(playerid, Stars[playerid][3]);
- TextDrawShowForPlayer(playerid, Stars[playerid][4]);
- TextDrawShowForPlayer(playerid, Stars[playerid][5]);
- TextDrawShowForPlayer(playerid, Stars[playerid][6]);
- TextDrawShowForPlayer(playerid, Stars[playerid][7]);
- TextDrawShowForPlayer(playerid, Stars[playerid][8]);
- TextDrawShowForPlayer(playerid, Stars[playerid][9]);
- TextDrawShowForPlayer(playerid, Stars[playerid][10]);
- TextDrawShowForPlayer(playerid, Stars[playerid][11]);
- TextDrawShowForPlayer(playerid, Stars[playerid][12]);
- TextDrawShowForPlayer(playerid, Stars[playerid][13]);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- SetPlayerStarRang(playerid);
- GetPlayerRang(playerid);
- return 1;
- }
- stock SetPlayerStarRang(playerid)
- {
- switch (GetPlayerScore(playerid))
- {
- case 0..49 :
- {
- TextDrawColor(Stars[playerid][13], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][13], 0x00000033);
- TextDrawColor(Stars[playerid][12], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][12], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][13]), TextDrawShowForPlayer(playerid, Stars[playerid][13]);
- TextDrawHideForPlayer(playerid, Stars[playerid][12]), TextDrawShowForPlayer(playerid, Stars[playerid][12]);
- TextDrawSetString(Rang[playerid][2], "7%");
- }
- case 50..99 :
- {
- TextDrawColor(Stars[playerid][6], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][6], 0x00000033);
- TextDrawColor(Stars[playerid][11], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][11], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][6]), TextDrawShowForPlayer(playerid, Stars[playerid][6]);
- TextDrawHideForPlayer(playerid, Stars[playerid][11]), TextDrawShowForPlayer(playerid, Stars[playerid][11]);
- TextDrawSetString(Rang[playerid][2], "18%");
- }
- case 100..499 :
- {
- TextDrawColor(Stars[playerid][10], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][10], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][10]), TextDrawShowForPlayer(playerid, Stars[playerid][10]);
- TextDrawSetString(Rang[playerid][2], "24%");
- }
- case 500..999 :
- {
- TextDrawColor(Stars[playerid][9], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][9], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][9]), TextDrawShowForPlayer(playerid, Stars[playerid][9]);
- TextDrawSetString(Rang[playerid][2], "38%");
- }
- case 1000..1499 :
- {
- TextDrawColor(Stars[playerid][8], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][8], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][8]), TextDrawShowForPlayer(playerid, Stars[playerid][8]);
- TextDrawSetString(Rang[playerid][2], "45%");
- }
- case 1500..1999 :
- {
- TextDrawColor(Stars[playerid][7], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][7], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][7]), TextDrawShowForPlayer(playerid, Stars[playerid][7]);
- TextDrawSetString(Rang[playerid][2], "59%");
- }
- case 2000..2999 :
- {
- TextDrawColor(Stars[playerid][0], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][0], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][0]), TextDrawShowForPlayer(playerid, Stars[playerid][0]);
- TextDrawSetString(Rang[playerid][2], "62%");
- }
- case 3000..3999 :
- {
- TextDrawColor(Stars[playerid][1], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][1], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][1]), TextDrawShowForPlayer(playerid, Stars[playerid][1]);
- TextDrawSetString(Rang[playerid][2], "73%");
- }
- case 4000..4999 :
- {
- TextDrawColor(Stars[playerid][2], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][2], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][2]), TextDrawShowForPlayer(playerid, Stars[playerid][2]);
- TextDrawSetString(Rang[playerid][2], "87%");
- }
- case 5000..8499 :
- {
- TextDrawColor(Stars[playerid][3], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][3], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][3]), TextDrawShowForPlayer(playerid, Stars[playerid][3]);
- TextDrawSetString(Rang[playerid][2], "94%");
- }
- case 8500..9999 :
- {
- TextDrawColor(Stars[playerid][4], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][4], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][4]), TextDrawShowForPlayer(playerid, Stars[playerid][4]);
- TextDrawSetString(Rang[playerid][2], "98%");
- }
- default:
- {
- TextDrawColor(Stars[playerid][5], 0x00FD22FF), TextDrawBackgroundColor(Stars[playerid][5], 0x00000033);
- TextDrawHideForPlayer(playerid, Stars[playerid][5]), TextDrawShowForPlayer(playerid, Stars[playerid][5]);
- TextDrawSetString(Rang[playerid][2], "100%");
- }
- }
- }
- stock GetPlayerRang(playerid)
- {
- new string[256];
- switch (GetPlayerScore(playerid))
- {
- case 0..49 : TextDrawSetString(Rang[playerid][0], "Rang: Noob");
- case 50..99 : TextDrawSetString(Rang[playerid][0], "Rang: Emigrant");
- case 100..499 : TextDrawSetString(Rang[playerid][0], "Rang: Bandit");
- case 500..999 : TextDrawSetString(Rang[playerid][0], "Rang: Killer");
- case 1000..1499 : TextDrawSetString(Rang[playerid][0], "Rang: Gangster");
- case 1500..1999 : TextDrawSetString(Rang[playerid][0], "Rang: Hitman");
- case 2000..2999 : TextDrawSetString(Rang[playerid][0], "Rang: Professional");
- case 3000..3999 : TextDrawSetString(Rang[playerid][0], "Rang: Terminator");
- case 4000..4999 : TextDrawSetString(Rang[playerid][0], "Rang: Maniac");
- case 5000..8499 : TextDrawSetString(Rang[playerid][0], "Rang: Baron");
- case 8500..9999 : TextDrawSetString(Rang[playerid][0], "Rang: Leader");
- default: TextDrawSetString(Rang[playerid][0], "Rang: Legenda");
- }
- switch (GetPlayerScore(playerid))
- {
- case 0..49 : format(string, sizeof(string), "Kills: %d/50", GetPlayerScore(playerid));
- case 50..99 : format(string, sizeof(string), "Kills: %d/100", GetPlayerScore(playerid));
- case 100..499 : format(string, sizeof(string), "Kills: %d/500", GetPlayerScore(playerid));
- case 500..999 : format(string, sizeof(string), "Kills: %d/1000", GetPlayerScore(playerid));
- case 1000..1499 : format(string, sizeof(string), "Kills: %d/1500", GetPlayerScore(playerid));
- case 1500..1999 : format(string, sizeof(string), "Kills: %d/2000", GetPlayerScore(playerid));
- case 2000..2999 : format(string, sizeof(string), "Kills: %d/3000", GetPlayerScore(playerid));
- case 3000..3999 : format(string, sizeof(string), "Kills: %d/4000", GetPlayerScore(playerid));
- case 4000..4999 : format(string, sizeof(string), "Kills: %d/5000", GetPlayerScore(playerid));
- case 5000..8499 : format(string, sizeof(string), "Kills: %d/8500", GetPlayerScore(playerid));
- case 8500..9999 : format(string, sizeof(string), "Kills: %d/10000", GetPlayerScore(playerid));
- default: format(string, sizeof(string), "Kills: %d/%d", GetPlayerScore(playerid), GetPlayerScore(playerid));
- }
- TextDrawSetString(Rang[playerid][1], string);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement