Chat Message
#1

How can i clear the chat when player connects then returns the chat messages

But my code Only Clear but won't return player chat messages when they login

Код:
public OnPlayerText(playerid, text[])
{
    new string[500];
    format(string,sizeof(string),"%s: {FFFFFF}%s", ReturnName(playerid), text);
    SendClientMessageToAll(GetPlayerColor(playerid), string);
	return 0;
}
Код:
public OnPlayerConnect(playerid)
{
    for( new i = 0; i <= 100; i ++ ) SendClientMessage(playerid, -1, "" );
}
Return message should go into this code?

Код:
forward OnAccountLoad(playerid);
public OnAccountLoad(playerid)
{
    cache_get_value_name_int(0, "Admin", PlayerInfo[playerid][pAdmin]);
    cache_get_value_name_int(0, "Score", PlayerInfo[playerid][Score]);
    cache_get_value_name_int(0, "Money", PlayerInfo[playerid][Money]);
    printf("%d | %d | %d | %d", PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][Score], PlayerInfo[playerid][Money]);
    GivePlayerMoney(playerid, PlayerInfo[playerid][Money]);
    SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
    
    new pname[MAX_PLAYER_NAME], string[250 + MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "{FFFF00}%s has joined the server", pname);
    SendClientMessageToAll(-1, string);

    new Message[250];
    format(Message,sizeof(Message), "Account ID: %i", PlayerInfo[playerid][ID]);
   	SendClientMessage(playerid, -1, Message);
    return true;
}
Reply
#2

anyone know how to do it?
Reply
#3

What exactly are you trying to do? You want to clear the chat when the player connects and then what?
Reply
#4

Quote:
Originally Posted by Abagail
Посмотреть сообщение
What exactly are you trying to do? You want to clear the chat when the player connects and then what?

1. When a player join the server.
2. I need it to be clear when the player didn't login.
3. If they login to their account want to return their chat.
Reply
#5

I think what he's trying to say is he wants the chat from when he /q'd to resume when they log back in.
Reply
#6

Quote:
Originally Posted by Stones
Посмотреть сообщение
I think what he's trying to say is he wants the chat from when he /q'd to resume when they log back in.
no.



If they don't login to their accounts. they won't see the chat but if they login to the account their chat will return the messages.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)