Announce command help
#1

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
Reply
#2

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.
Reply
#3

Remove pragma

pawn Code:
GameTextForPlayer(playerid,params,4000,5);
Its white and the same font as type 4
Reply
#4

Guys, i want same style;
Gametextstyle 5 is not as 4
I want style 4 but with color white
Reply
#5

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;
}
Reply
#6

Doesn't work
Any more replies?
Reply
#7

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;
}
Reply
#8

https://sampwiki.blast.hk/wiki/GameTextStyle it says there that this ~w~ is the colour white so put it before the %s in GameTextForPlayer
Reply
#9

WOW man! It fully worked! Thanks bro
+Rep
Reply
#10

use color codes like ~w~ and ~r~ in your string
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)