How to?
#1

Hey guys I would like to to change the color of the text on 1 line, like this:
/pm [playerid] [text]
Here is the code:
Код:
if(strcmp(cmd, "/pm", true) == 0) // By CuervO_NegrO
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet!");
	            return 1;
	        }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /pm");SendClientMessage(playerid, COLOR_WHITE, " [playerid] [text]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        if(HidePM[giveplayerid] > 0)
			        {
			            SendClientMessage(playerid, COLOR_GREY, "** That player is blocking messages!");
			            return 1;
			        }
           			if(PlayerInfo[playerid][pMuted] == 1)
					{
						SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
						return 1;
					}
					GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
					new Float:x, Float:y, Float:z;
					GetPlayerPos(playerid, x,y,z);
					new h, mi, s;
					new y1, m, d;
					gettime(h,mi,s);
					getdate(y1, m, d);
					if(giveplayerid == playerid)
					{
						format(string, sizeof(string), "* %s mutters something to himself.", sendername);
						ProxDetector(5.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
					}
					new length = strlen(cmdtext);
					while ((idx < length) && (cmdtext[idx] <= ' '))
					{
						idx++;
					}
					new offset = idx;
					new result[128];
					while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
					{
						result[idx - offset] = cmdtext[idx];
						idx++;
					}
					result[idx - offset] = EOS;
					if(!strlen(result))
					{
						SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/pm) [playerid/PartOfName] [text]");
						return 1;
					}
					format(string, sizeof(string), "* PM From %s (%d): %s", sendername, playerid, (result));
					SendClientMessage(giveplayerid, 0xE5C43EAA, string);
					PlayerPlaySound(giveplayerid, 1055, x,y,z);
					format(string, sizeof(string), "* PM Sent to %s (%d): %s", giveplayer, giveplayerid, (result));
					SendClientMessage(playerid, 0xBBA033AA, string);
					format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [PM] to %s: (%s)",d,m,y1,h,mi,s, sendername,giveplayer, result);
					PMLog(string);
					for(new i=0; i < MAX_PLAYERS; i++)
					{
						if(IsPlayerConnected(i))
						{
							if(PlayerInfo[i][pViewPms] == 1 && PlayerInfo[i][pAdmin] >= 1)
							{
		                        format(string, sizeof(string), "[ADMIN]: %s (%d) Has sent a PM to %s (%d) - (%s)",sendername, playerid, giveplayer, giveplayerid, (result));
		                        SendClientMessage(i, COLOR_LIGHTRED, string);
							}
						}
					}
					return 1;
				}
			}
			else
			{
					format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
					SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
Reply
#2

Код:
SendClientMessage(playerid, COLOR_GREY, "USAGE: /pm {FF0000}[playerid] [text]");
Reply
#3

SendClientMessage(playerid, COLOR_GREY, "/pm {FF0000}[playerid] [text]");
Reply
#4

pawn Код:
SendClientMessage(playerid, COLOR_GREY, "[USAGE]: /pm {FF0000}[playerid] [text]");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)