[FilterScript] MRSH rank system with prefix
#1


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;
    }
}
Reply
#2

yea its good so hitting +rep
Reply
#3

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;
}
Reply
#4

Updated!
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)