Colors -
hnlrasta - 08.10.2013
Hello!
How to add more many colors for this?:
Код:
/*
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>
CMD:rank(playerid, params[])
{
new string[256];
format(string, sizeof(string),"Pontjaid : %s | Rangod : %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] %s{007f9c}(%d): {ffffff}%s", GPR(playerid), pName(playerid), playerid, text);
SendClientMessageToAll(-1, szChat);
)
new
string[128],
rand,
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
rand = random(sizeof(color));
format(string,sizeof(string),"[%d] %s: %s",playerid,name,text);
SendClientMessageToAll(color[rand][0],string);
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),"Novice");
if(score >= 50 && score <= 99) format(str,sizeof(str),"Private");
if(score >= 100 && score <= 299) format(str,sizeof(str),"Corporal");
if(score >= 300 && score <= 599) format(str,sizeof(str),"Sergeant");
if(score >= 600 && score <= 799) format(str,sizeof(str),"Lieutenant");
if(score >= 800 && score <= 1999) format(str,sizeof(str),"Officer");
if(score >= 2000 && score <= 3999) format(str,sizeof(str),"Captain");
if(score >= 4000 && score <= 5999) format(str,sizeof(str),"Colonel");
if(score >= 7000 && score <= 8999) format(str,sizeof(str),"Major");
if(score >= 9000 && score <= 12999) format(str,sizeof(str),"Major General");
if(score >= 12000 && score <= 14999) format(str,sizeof(str),"General");
if(score >= 15000 && score <= 19999) format(str,sizeof(str),"General OF the Army");
if(score >= 20000) format(str,sizeof(str),"Master Of War");
return str;
}
Re: Colors -
iFiras - 08.10.2013
What you mean colours??
You mean colour defines for client message like this

for example: #define COLOR_RED 0xFF0000AA
Re: Colors -
[EnErGyS]KING - 08.10.2013
Hello, Hnlrasta.
Please explain where you want to put these colors ? and what colors(red,black...)
Re: Colors -
hnlrasta - 08.10.2013
i will random playername colors in the chat.
Now all is white.
Sry for my english
Re: Colors -
[EnErGyS]KING - 08.10.2013
If you codding
https://sampforum.blast.hk/showthread.php?tid=85117
Re: Colors -
hnlrasta - 08.10.2013
can u complete the code?
Re: Colors -
[EnErGyS]KING - 08.10.2013
i am just lazy just add
Код:
ServerColors[random(sizeof(ServerColors))]
here
Код:
format(string,sizeof(string),"[%d] %s: %s",playerid,name,text);
Re: Colors -
hnlrasta - 08.10.2013
i get errors
Re: Colors -
[EnErGyS]KING - 08.10.2013
What errors, post it ?
Re: Colors -
hnlrasta - 08.10.2013
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(29) : warning 217: loose indentation
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(29) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(29 -- 30) : warning 215: expression has no effect
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(30) : error 001: expected token: ";", but found "new"
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(30) : warning 217: loose indentation
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(36) : error 017: undefined symbol "color"
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(36) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(36) : warning 215: expression has no effect
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(37) : error 001: expected token: ";", but found "-identifier-"
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(3

: error 017: undefined symbol "color"
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(3

: warning 215: expression has no effect
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(3

: error 001: expected token: ";", but found "]"
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(3

: error 029: invalid expression, assumed zero
C:\Documents and Settings\Joe-PC\Asztal\scripts\rang.pwn(3

: fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
9 Errors.