27.03.2012, 14:32
(
Last edited by sniperwars; 21/04/2012 at 09:05 AM.
)
Hi guys,
Some people have been asking me how to add random messages into your gamemode because
they can't do it. So I'm going to show you how to add it in your script step by step.
You can define any of the below colors into your script.
Then you will need to forward the Random Messages function.
We will be defining the random messages in this function.
Then we will need to set a timer for the Random Messages and the timer will
be placed below the public OnGameModeInit() function:
You will need to find an empty place in your script to add this callback.
This will get the Random Messages from above and send them as a client message.
If this works for you, please feel free to rep me.
- Sean aka Sniperwars
Some people have been asking me how to add random messages into your gamemode because
they can't do it. So I'm going to show you how to add it in your script step by step.
You can define any of the below colors into your script.
pawn Code:
#define COLOR_GREEN 0x33AA33AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xCC0000AA
pawn Code:
//Forwards//
forward RandomMessages();
pawn Code:
//Random Messages//
new RandomMessages[][] =
{
"Message 1 (Change this)",
"Message 2 (Change this)",
"Message 3 (Change this)"
};
be placed below the public OnGameModeInit() function:
pawn Code:
public OnGameModeInit()
{
SetTimer("RandomMessages",95000,1);
return 1;
}
This will get the Random Messages from above and send them as a client message.
pawn Code:
public RandomMessages()
{
SendClientMessageToAll(COLOR_GREEN, RandomMessages[random(sizeof(RandomMessages))];
return 1;
}
- Sean aka Sniperwars