SA-MP Forums Archive
[FilterScript] MRSH rank system with prefix - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] MRSH rank system with prefix (/showthread.php?tid=499936)



MRSH: ShRank System [with prefix] - mrsh - 10.03.2014


MRSH SYSTEMS
Name: ShRank System [with prefix]
A simple rank system with prefix!

Download: http://pastebin.com/rRMN7UUT

you cant access pastebin? here you are!
pawn Код:
#include <a_samp>

stock GetName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
        GetPlayerName(playerid, Name, sizeof(Name));
    }
    return Name;
}
public OnPlayerText(playerid, text[])
{
    if((GetPlayerScore(playerid) >= 0) && (GetPlayerScore(playerid) <= 100))
    {
        new string[175];
        format(string,sizeof(string), "{F5E618}[Corporal]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
        SendClientMessageToAll(-1, string);
        return 0;
    }
    if((GetPlayerScore(playerid) >= 100) && (GetPlayerScore(playerid) <= 300))
    {
        new string[175];
        format(string,sizeof(string), "{F5E618}[Lieutenant]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
        SendClientMessageToAll(-1, string);
        return 0;
    }
    if((GetPlayerScore(playerid) >= 300) && (GetPlayerScore(playerid) <= 500))
    {
        new string[175];
        format(string,sizeof(string), "{F5E618}[Major]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
        SendClientMessageToAll(-1, string);
        return 0;
    }
    if((GetPlayerScore(playerid) >= 500) && (GetPlayerScore(playerid) <= 1000))
    {
        new string[175];
        format(string,sizeof(string), "{F5E618}[Captain]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
        SendClientMessageToAll(-1, string);
        return 0;
    }
    if((GetPlayerScore(playerid) >= 1000) && (GetPlayerScore(playerid) <= 1500))
    {
        new string[175];
        format(string,sizeof(string), "{F5E618}[Commander]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
        SendClientMessageToAll(-1, string);
        return 0;
    }
    if((GetPlayerScore(playerid) >= 1500) && (GetPlayerScore(playerid) <= 2000))
    {
        new string[175];
        format(string,sizeof(string), "{F5E618}[General]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
        SendClientMessageToAll(-1, string);
        return 0;
    }
    if((GetPlayerScore(playerid) >= 2000) && (GetPlayerScore(playerid) <= 2500))
    {
        new string[175];
        format(string,sizeof(string), "{F5E618}[Brigadier]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
        SendClientMessageToAll(-1, string);
        return 0;
    }
    if((GetPlayerScore(playerid) >= 2500) && (GetPlayerScore(playerid) <= 5000))
    {
        new string[175];
        format(string,sizeof(string), "{F5E618}[Field Marshall]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
        SendClientMessageToAll(-1, string);
        return 0;
    }
    if((GetPlayerScore(playerid) >= 5000) && (GetPlayerScore(playerid) <= 10000))
    {
        new string[175];
        format(string,sizeof(string), "{F5E618}[Master of Wars]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
        SendClientMessageToAll(-1, string);
        return 0;
    }
    if((GetPlayerScore(playerid) >= 10000) && (GetPlayerScore(playerid) <= 9999999))
    {
        new string[175];
        format(string,sizeof(string), "{F5E618}[General of Army]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
        SendClientMessageToAll(-1, string);
        return 0;
    }
}



Re: MRSH rank system with prefix - Hax0rm - 10.03.2014

yea its good so hitting +rep


Re: MRSH rank system with prefix - Pottus - 10.03.2014

You could make this a lot less lines of code

pawn Код:
new string[175];

    if((GetPlayerScore(playerid) >= 0) && (GetPlayerScore(playerid) <= 100)) format(string,sizeof(string), "{F5E618}[Corporal]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
    else if((GetPlayerScore(playerid) >= 100) && (GetPlayerScore(playerid) <= 300)) format(string,sizeof(string), "{F5E618}[Lieutenant]{FFFFFF} %s: {FFFFFF}%s",GetName(playerid),text);
    .....
   
    SendClientMessageToAll(-1, string);
    return 0;
Why bother checking if the player is connected obviously they are if they just typed the message.

pawn Код:
stock GetName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    return Name;
}



Re: MRSH rank system with prefix - mrsh - 14.03.2014

Updated!


Re: MRSH rank system with prefix - amirab - 15.03.2014

in fact it's not a script
you can post it in Tutorials
script is something special


Re: MRSH rank system with prefix - mrsh - 15.03.2014

just code
Код:
#include <a_samp>
Deleted!
and i'm forget fix this!