Help - AutoMessage
#1

How do I make a random message | automatically with format?
I want to write the time the message ..
Here is my code:
pawn Код:
new RandomMessages[][] = {
   "{FFEE00}[Auto Message]: {00F7FF}/HelpMe цшйк тжшд ? дчщ",
   "{FFEE00}[Auto Message]: {00F7FF}/DM шецд мдймзн чцъ ? дчщ",
   "{FFEE00}[Auto Message]: {00F7FF}/TDM шецд мдймзн бчбецеъ ? дчщ",
   "{FFEE00}[Auto Message]: {00F7FF}/Zombie шецд мдймзн рвг жеобйн ? дчщ",
   "{FFEE00}[Auto Message]: {00F7FF}.щйоше тм зечй дщшъ ббчщд",
   "{FFEE00}[Auto Message]: {FF0000}! жлше, айп мдщъощ бц'йийн",
   "{FFEE00}[Auto Message]: {FF0000}! жлше, айп мрцм бавйн мойрйдн",
   "{FFEE00}[Auto Message]: {00F7FF}! дощк ощзч одрд",
   "{FFEE00}[Auto Message]: {00FF7B}*******.** {00F7FF}бчше бфешен щмре"
};
pawn Код:
forward Help();
public Help(){
new AutoM = random(sizeof(RandomMessages));
SendClientMessageToAll(-1,RandomMessages[AutoM]);
return 1;}
pawn Код:
SetTimer("Help",600010,1); // OnGameModeInit
I tried this:
pawn Код:
"{FFEE00}[Auto Message]: {00F7FF}/HelpMe цшйк тжшд ? дчщ",GetTimeEx,
Error:
pawn Код:
C:\Documents and Settings\User\Desktop\server\gamemodes\Dark.pwn(91) : error 017: undefined symbol "GetTimeEx"
C:\Documents and Settings\User\Desktop\server\gamemodes\Dark.pwn(100) : error 010: invalid function or declaration
C:\Documents and Settings\User\Desktop\server\gamemodes\Dark.pwn(920) : warning 203: symbol is never used: ""
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase




2 Errors.
Reply
#2

There is no GetTimeEx function its SetTimeEx


https://sampwiki.blast.hk/wiki/Random_Messages
Reply
#3

Quote:
Originally Posted by doreto
Посмотреть сообщение
I know that there is one function I created it ..
pawn Код:
stock GetDatimeEx(bool:dt)
{
    new str[12], td[3];
    if(!dt) gettime(td[0],td[1],td[2]); else getdate(td[2],td[1],td[0]);
    format(str, sizeof(str), !dt? ("%02d:%02d:%02d") : ("%02d/%02d/%d"), td[0], td[1], td[2]);
    return str;
}
pawn Код:
#define GetTimeEx() GetDatimeEx(false)
#define GetDateEx() GetDatimeEx(true)
Reply
#4

I assume what you want to do is append a timestamp to the random message so it looks something like this:
"{FFEE00}[Auto Message]: {00F7FF}/HelpMe цшйк тжшд ? дчщ | 12:33"
Then you'll have to use format indeed, I suggest you try out something like this:
pawn Код:
new string[128], hour, minute, second;
gettime(hour, minute, second);
format(string, sizeof(string), "%s | %02d:%02d", RandomMessages[random(sizeof(RandomMessages))], hour, minute);
SendClientMessageToAll(-1, string);
Reply
#5

Quote:
Originally Posted by AndreT
Посмотреть сообщение
I assume what you want to do is append a timestamp to the random message so it looks something like this:
"{FFEE00}[Auto Message]: {00F7FF}/HelpMe цшйк тжшд ? дчщ | 12:33"
Then you'll have to use format indeed, I suggest you try out something like this:
pawn Код:
new string[128], hour, minute, second;
gettime(hour, minute, second);
format(string, sizeof(string), "%s | %02d:%02d", RandomMessages[random(sizeof(RandomMessages))], hour, minute);
SendClientMessageToAll(-1, string);
ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)