Getting the color
#1

When i do /setmessage {FF0000}Hello. it don't set as that color. When i do it from the database it do set the color.
but not the command do.
Код:
CMD:setmessage(playerid,params[])
{
	new SetMessage[128], string[128];
        if(sscanf(params,"s[128]",SetMessage)) return SendClientMessage(playerid, -1, "Usage: /setmessage [custom message]");
        
   	format(string, sizeof(string), "You have set your message as: %s", SetMessage);
	SendClientMessage(playerid, -1, string);
	format(PlayerInfo[playerid][SetMessage], 128, "%s", SetMessage);

	return 1;
}
Reply
#2

Код:
CMD:setmessage(playerid,params[])
{
	new SetMessage[8], string[128];
        if(sscanf(params,"s[8]",SetMessage)) return SendClientMessage(playerid, -1, "Usage: /setmessage [custom message]");
        
   	format(string, sizeof(string), "You have set your message as: %s", SetMessage);
	SendClientMessage(playerid, -1, string);
	format(PlayerInfo[playerid][SetMessage], 8, SetMessage);

	return 1;
}
Try this.
Reply
#3

Quote:
Originally Posted by SmoW
Посмотреть сообщение
Код:
CMD:setmessage(playerid,params[])
{
	new SetMessage[8], string[128];
        if(sscanf(params,"s[8]",SetMessage)) return SendClientMessage(playerid, -1, "Usage: /setmessage [custom message]");
        
   	format(string, sizeof(string), "You have set your message as: %s", SetMessage);
	SendClientMessage(playerid, -1, string);
	format(PlayerInfo[playerid][SetMessage], 8, SetMessage);

	return 1;
}
Try this.
The code you gave me, didn't set the color.
Reply
#4

Quote:
Originally Posted by Ryan50
Посмотреть сообщение
The code you gave me, didn't set the color.
Does this returns the color code? ( eg. You have set your message as: {FF0000} )

Код:
format(string, sizeof(string), "You have set your message as: %s", SetMessage);
SendClientMessage(playerid, -1, string);
Reply
#5

Quote:
Originally Posted by SmoW
Посмотреть сообщение
Does this returns the color code? ( eg. You have set your message as: {FF0000} )

Код:
format(string, sizeof(string), "You have set your message as: %s", SetMessage);
SendClientMessage(playerid, -1, string);
It don't show the color code,
Код:
You have set your message as: Test
Reply
#6

Код:
CMD:setmessage(playerid,params[])
{
	new SetMessage[8], string[128];
        if(sscanf(params,"s[8]",SetMessage)) return SendClientMessage(playerid, -1, "Usage: /setmessage [custom message]");
        
   	format(string, sizeof(string), "You have set your message as: {%06x}",SetMessage >>> 8););
	SendClientMessage(playerid, -1, string);
	format(PlayerInfo[playerid][SetMessage], 8, SetMessage);

	return 1;
}
Maybe this?
Reply
#7

Can I see where you defined the PersonalMessage variable?
Reply
#8

Quote:
Originally Posted by SmoW
Посмотреть сообщение
Can I see where you defined the PersonalMessage variable?
i updated the post, check again.
Reply
#9

Код:
CMD:setmessage(playerid,params[])
{
	new SetMessage[128], string[128];
        if(sscanf(params,"s[128]",SetMessage)) return SendClientMessage(playerid, -1, "Usage: /setmessage [custom message]");

        format(PlayerInfo[playerid][SetMessage], 128, SetMessage);
   	format(string, sizeof(string), "You have set your message as: {%06x}",PlayerInfo[playerid][SetMessage] >>> 8);
	SendClientMessage(playerid, -1, string);
	

	return 1;
}
Reply
#10

Quote:
Originally Posted by SmoW
Посмотреть сообщение
Код:
CMD:setmessage(playerid,params[])
{
	new SetMessage[128], string[128];
        if(sscanf(params,"s[128]",SetMessage)) return SendClientMessage(playerid, -1, "Usage: /setmessage [custom message]");

        format(PlayerInfo[playerid][SetMessage], 128, SetMessage);
   	format(string, sizeof(string), "You have set your message as: {%06x}",PlayerInfo[playerid][SetMessage] >>> 8);
	SendClientMessage(playerid, -1, string);
	

	return 1;
}
Код:
    format(PlayerInfo[playerid][SetMessage], 128, SetMessage);
Код:
(3046) : error 033: array must be indexed (variable "SetMessage")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)