Announce command help -
iFiras - 07.10.2013
Hay guys, i need some help in this /announce CMD
Code:
dcmd_ann(playerid,params[])
{
#pragma unused params
new string[128], message[128];
if(PlayerInfo[playerid][Level] < 3) return SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR] {FFFFFF}You don't have an appropriate administration level to use this command.");
if(sscanf(params, "u", message)) return SendClientMessage(playerid,COLOR_WHITE,""COL_ORANGE"[USAGE] {FFFFFF}/ann(ounce) [MESSAGE]");
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(string,sizeof(string),"%s",message);
GameTextForPlayer(playerid,params,4000,4);
}
}
return 1;
}
The command works but it shows me this style with this colour
But i need to get it with white colour
Help please in it
Re: Announce command help -
MAFIAWARS - 07.10.2013
pawn Code:
dcmd_ann(playerid,params[])
{
#pragma unused params
new string[128], message[128];
if(PlayerInfo[playerid][Level] < 3) return SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR] {FFFFFF}You don't have an appropriate administration level to use this command.");
if(sscanf(params, "u", message)) return SendClientMessage(playerid,COLOR_WHITE,""COL_ORANGE"[USAGE] {FFFFFF}/ann(ounce) [MESSAGE]");
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(string,sizeof(string),"%s",message);
GameTextForPlayer(playerid,params,4000,5);
}
}
return 1;
}
Try Now.
Re: Announce command help -
TomatoRage - 07.10.2013
Remove pragma
pawn Code:
GameTextForPlayer(playerid,params,4000,5);
Its white and the same font as type 4
Re: Announce command help -
iFiras - 08.10.2013
Guys, i want same style;
Gametextstyle 5 is not as 4
I want style 4 but with color white
Re: Announce command help -
jueix - 08.10.2013
pawn Code:
dcmd_ann(playerid,params[])
{
#pragma unused params
new string[128], message[128];
if(PlayerInfo[playerid][Level] < 3) return SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR] {FFFFFF}You don't have an appropriate administration level to use this command.");
if(sscanf(params, "u", message)) return SendClientMessage(playerid,COLOR_WHITE,""COL_ORANGE"[USAGE] {FFFFFF}/ann(ounce) [MESSAGE]");
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(string,sizeof(string),"~w~%s",message);
GameTextForPlayer(playerid,params,4000,5);
}
}
return 1;
}
Re: Announce command help -
iFiras - 08.10.2013
Doesn't work
Any more replies?
Re: Announce command help -
Konstantinos - 08.10.2013
pawn Code:
#if !defined isnull
#define isnull(%1) \
((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
params was used, u specifier is for players' and NPCs' ID/part of name. The for loop is unnecessary.
Using ~w~ will change the color to white.
pawn Code:
dcmd_ann(playerid,params[])
{
if(PlayerInfo[playerid][Level] < 3) return SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR] {FFFFFF}You don't have an appropriate administration level to use this command.");
if(isnull(params)) return SendClientMessage(playerid,COLOR_WHITE,""COL_ORANGE"[USAGE] {FFFFFF}/ann(ounce) [MESSAGE]");
new message[128];
format(message, sizeof(message), "~w~%s", params);
GameTextForAll(message, 4000, 4 );
return 1;
}
Re: Announce command help -
jueix - 08.10.2013
https://sampwiki.blast.hk/wiki/GameTextStyle it says there that this ~w~ is the colour white so put it before the %s in GameTextForPlayer
Re: Announce command help -
iFiras - 08.10.2013
WOW man! It fully worked! Thanks bro
+Rep
Re: Announce command help -
Mattakil - 08.10.2013
use color codes like ~w~ and ~r~ in your string