03.02.2017, 08:09
(
Последний раз редактировалось JesterlJoker; 03.02.2017 в 08:11.
Причина: Wrong info
)
Quote:
I removed public OnFilterScriptInit()
and public OnFilterScriptExit() and put all those AddRandomMessage in public OnGameModeInit() But it says now : error 017: undefined symbol "AddRandomMessage" |
Try this
Код:
//add this somewhere above your ongamemodeinit #define AUTO_MESSAGE_TIME a // Change "a" to a specific time you want i.e 5 new AutoMessages[][] = { // Write Your messages here i.e Hey cheating is not allowed on my server }; //Now you'll need to forward it so that it can be timed on OnGameModeInit() forward AutoMessage(); public AutoMessage() { new string[128]; format(string, sizeof(string), "%s", AutoMessages[random(sizeof(AutoMessages))]); SendClientMessageToAll("YOUR COLOR HERE", string); return 1; } public OnGameModeInit() { SetTimer("AutoMessage",60*1000*AUTO_MESSAGE_TIME,1); return 1; }
You can also random the colors like this
Код:
forward AutoMessage(); public AutoMessage() { new string[128]; format(string, sizeof(string), "%s", AutoMessages[random(sizeof(AutoMessages))]); new colors = random(5)+1; new color; switch(colors) { case 1: { color = COLOR_FORSTATS; } case 2: { color = COLOR_PURPLE; } case 3: { color = COLOR_LIGHTRED; } case 4: { color = COLOR_GREEN; } case 5: { color = COLOR_CYAN; } } SendClientMessageToAll(color, string); return 1; }