[TIME] CHAT
#5

You do this by using gettime, and storing it into variables.
Then, under OnPlayerText, format the string with the variables, and return 0;

Example
pawn Код:
public OnPlayerText(playerid, text[])
{
    new
        hours, // Variable for hours
        minutes, // Variable for minutes
        seconds, // Variable for seconds
        string[128], // String
        name[MAX_PLAYER_NAME] // String for name
    ;
    GetPlayerName(playerid,name,sizeof(name)); // Get the typer's name
    gettime(hours, minutes, seconds); // Get the time and store it into the variables above
    format(string,sizeof(string),"[%d:%d:%d] %s says: %s",hours,minutes,seconds,name,text); // Formats the text with the time variables
    SendClientMessageToAll( -1, string); // Send the message to all
    return 0; // Returning 0 will disable the traditional SAMP chat.
}



EDIT:

Forgot about timestamp...I'm an idiot.
Reply


Messages In This Thread
[TIME] CHAT - by Gooday - 11.04.2012, 19:59
Re: [TIME] CHAT - by 3RoR - 11.04.2012, 20:00
Re: [TIME] CHAT - by Gooday - 11.04.2012, 20:02
Re: [TIME] CHAT - by DBan - 11.04.2012, 20:04
Re: [TIME] CHAT - by ReneG - 11.04.2012, 20:07
Re: [TIME] CHAT - by elhanan - 22.06.2016, 09:28
Re: [TIME] CHAT - by Luicy. - 22.06.2016, 09:51

Forum Jump:


Users browsing this thread: 1 Guest(s)