SA-MP Forums Archive
Chat Message - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Chat Message (/showthread.php?tid=627010)



Chat Message - DerickClark - 22.01.2017

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;
}



Re: Chat Message - DerickClark - 22.01.2017

anyone know how to do it?


Re: Chat Message - Abagail - 22.01.2017

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


Re: Chat Message - DerickClark - 22.01.2017

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.


Re: Chat Message - Stones - 22.01.2017

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.


Re: Chat Message - DerickClark - 22.01.2017

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.