prefixes
#1

Код:
/*
		M3HR4N 's Rank System
Version 1 :
/rank cmd for your rank
/ranks for know all ranks

What Will Be Add :
/getplayerrank(gpr) [id] shows other players rank

seen any bug / had any suggestions ? tell me on forums by posting or pm
*/

#include <a_samp>
#include <zcmd>

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("M3HR4N 's Rank System V1.0");
	print("--------------------------------------\n");
	return 1;
}

CMD:rank(playerid, params[])
{
	new string[256];
	format(string, sizeof(string),"Your Score Is : %s | And Your Rank Is : %s", GetPlayerScore(playerid), GPR(playerid));
	SendClientMessage(playerid, 0x00FFFFFF, string);
	return 1;
}
CMD:ranks(playerid, params[])
{
   ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX,"{00FFFF}Ranks","Rank 0-Novice-0 Score\nRank 1-Private-50 Scores\nRank 2-Corporal-100 Scores\nRank 3-Sergeant-300 Scores\nRank 4-Lieutenant-Scores:600\nRank 5-Officer-Scores:800\nRank 6-Captain-Scores:2000\nRank 7-Colonel-Scores:4000\nRank 8-Major-Scores:7000\nRank 9-Major General-Scores:9000\nRank 10-General-Scores: 12000\nRank 11-General OF the Army-15000 Scores\nRank 12-Master Of War-20000 Scores","Ok","Close");
   return 1;
}

public OnPlayerText(playerid,text[]) {
    new szChat[144];
        if(Novice..../) format(szChat,sizeof (szChat),"[Novice]{%06x}%s{007f9c}(%d): {ffffff}%s", GetPlayerColor(playerid) >>> 8, pName(playerid), playerid, text);
        else {
        if(/Private.../) format(szChat,sizeof (szChat),"[Private]{%06x}%s{007f9c}(%d): {ffffff}%s", GetPlayerColor(playerid) >>> 8, pName(playerid), playerid, text);
        else format(szChat,sizeof (szChat),"{%06x}%s{007f9c}(%d): {ffffff}%s", GetPlayerColor(playerid) >>> 8, pName(playerid), playerid, text);//
        }
        SendClientMessageToAll(-1, szChat);
        return 0;
}

stock pName(playerid) {
new name[24];
GetPlayerName(playerid,name,24);
return name;
}

stock GPR(playerid)
{
   new str[256];
   if(GetPlayerScore(playerid) >= 0) str = ("Rank 0 - Novice");
   if(GetPlayerScore(playerid) >= 50 && GetPlayerScore(playerid) <= 99) str = ("Rank 1 - Private");
   if(GetPlayerScore(playerid) >= 100 && GetPlayerScore(playerid) <= 299) str = ("Rank 2 - Corporal");
   if(GetPlayerScore(playerid) >= 300 && GetPlayerScore(playerid) <= 599) str = ("Rank 3 - Sergeant");
   if(GetPlayerScore(playerid) >= 600 && GetPlayerScore(playerid) <= 799) str = ("Rank 4 - Lieutenant");
   if(GetPlayerScore(playerid) >= 800 && GetPlayerScore(playerid) <= 1999) str = ("Rank 5 - Officer");
   if(GetPlayerScore(playerid) >= 2000 && GetPlayerScore(playerid) <= 3999) str = ("Rank 6 - Captain");
   if(GetPlayerScore(playerid) >= 4000 && GetPlayerScore(playerid) <= 5999) str = ("Rank 7 - Colonel");
   if(GetPlayerScore(playerid) >= 7000 && GetPlayerScore(playerid) <= 8999) str = ("Rank 8 - Major");
   if(GetPlayerScore(playerid) >= 9000 && GetPlayerScore(playerid) <= 12999) str = ("Rank 9 - Major General");
   if(GetPlayerScore(playerid) >= 12000 && GetPlayerScore(playerid) <= 14999) str = ("Rank 10 - General");
   if(GetPlayerScore(playerid) >= 15000 && GetPlayerScore(playerid) <= 19999) str = ("Rank 11 - General OF the Army");
   if(GetPlayerScore(playerid) >= 20000) str = ("Rank 12 - Master Of War");
   return 1;
}
I will prefix before the names. Help me please.
Reply
#2

So you want it to show the players rank at the beginning of the message?

Try this:

pawn Код:
/*
        M3HR4N 's Rank System
Version 1 :
/rank cmd for your rank
/ranks for know all ranks

What Will Be Add :
/getplayerrank(gpr) [id] shows other players rank

seen any bug / had any suggestions ? tell me on forums by posting or pm
*/


#include <a_samp>
#include <zcmd>

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("M3HR4N 's Rank System V1.0");
    print("--------------------------------------\n");
    return 1;
}

CMD:rank(playerid, params[])
{
    new string[256];
    format(string, sizeof(string),"Your Score Is : %s | And Your Rank Is : %s", GetPlayerScore(playerid), GPR(playerid));
    SendClientMessage(playerid, 0x00FFFFFF, string);
    return 1;
}
CMD:ranks(playerid, params[])
{
   ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX,"{00FFFF}Ranks","Rank 0-Novice-0 Score\nRank 1-Private-50 Scores\nRank 2-Corporal-100 Scores\nRank 3-Sergeant-300 Scores\nRank 4-Lieutenant-Scores:600\nRank 5-Officer-Scores:800\nRank 6-Captain-Scores:2000\nRank 7-Colonel-Scores:4000\nRank 8-Major-Scores:7000\nRank 9-Major General-Scores:9000\nRank 10-General-Scores: 12000\nRank 11-General OF the Army-15000 Scores\nRank 12-Master Of War-20000 Scores","Ok","Close");
   return 1;
}

public OnPlayerText(playerid,text[])
{
    new szChat[144];
    format(szChat,sizeof (szChat),"[%s]{%06x}%s{007f9c}(%d): {ffffff}%s", GPR(playerid), pName(playerid), playerid, text);
    SendClientMessageToAll(-1, szChat);
    return 0;
}

stock pName(playerid)
{
    new name[24];
    GetPlayerName(playerid,name,24);
    return name;
}

stock GPR(playerid)
{
   new str[50];
   new score = GetPlayerScore(playerid);
   
   if(score == 0) format(str,sizeof(str),"Rank 0 - Novice");
   if(score >= 50 && score <= 99) format(str,sizeof(str),"Rank 1 - Private");
   if(score >= 100 && score <= 299) format(str,sizeof(str),"Rank 2 - Corporal");
   if(score >= 300 && score <= 599) format(str,sizeof(str),"Rank 3 - Sergeant");
   if(score >= 600 && score <= 799) format(str,sizeof(str),"Rank 4 - Lieutenant");
   if(score >= 800 && score <= 1999) format(str,sizeof(str),"Rank 5 - Officer");
   if(score >= 2000 && score <= 3999) format(str,sizeof(str),"Rank 6 - Captain");
   if(score >= 4000 && score <= 5999) format(str,sizeof(str),"Rank 7 - Colonel");
   if(score >= 7000 && score <= 8999) format(str,sizeof(str),"Rank 8 - Major");
   if(score >= 9000 && score <= 12999) format(str,sizeof(str),"Rank 9 - Major General");
   if(score >= 12000 && score <= 14999) format(str,sizeof(str),"Rank 10 - General");
   if(score >= 15000 && score <= 19999) format(str,sizeof(str),"Rank 11 - General OF the Army");
   if(score >= 20000) format(str,sizeof(str),"Rank 12 - Master Of War");
   return str;
}
Reply
#3

Thanks your help.
Not work. I can't writing in the chat. And the 97 is not my id.

Reply
#4

Oktober xD.

Also what command did you type?
Reply
#5

Oh, what happens with this?

pawn Код:
public OnPlayerText(playerid,text[])
{
    new szChat[144];
    format(szChat,sizeof (szChat),"[%s] %s{007f9c}(%d): {ffffff}%s", GPR(playerid), pName(playerid), playerid, text);
    SendClientMessageToAll(-1, szChat);
    return 0;
}
EDIT: I won't be able to reply for around 30minutes.
Reply
#6

Hello,
Can You Help Me?
Quote:

C:\GTA\7447\filterscripts\tsw.pwn(39) : warning 217: loose indentation
C:\GTA\7447\filterscripts\tsw.pwn(39) : error 017: undefined symbol "Novice"
C:\GTA\7447\filterscripts\tsw.pwn(39) : error 029: invalid expression, assumed zero
C:\GTA\7447\filterscripts\tsw.pwn(39) : error 029: invalid expression, assumed zero
C:\GTA\7447\filterscripts\tsw.pwn(39) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)