You can use this, it will allow a player to type their own personal message with a cmd. It will get saved in scriptfiles with the player name and inside the file it will be like this
And when they connect the message will display
You will need zcmd, sscanf(plugin) & dini.
Or you could just convert the cmd to strcmp and change sscanf to strtok
pawn Код:
// by xir, enjoy
public OnPlayerConnect(playerid)
{
new file[128], pName[MAX_PLAYER_NAME], Message[256], string[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(file, sizeof(file), "%s.ini", pName);
Message = dini_Get(file, "Message");
format(string, sizeof(string), "Welcome to the server %s. Your Message: %s", pName, Message);
SendClientMessage(playerid, -1, string);
return 1;
}
COMMAND:joinmessage(playerid, params[])
{
new string[128], file[128], pName[MAX_PLAYER_NAME];
if(sscanf(params, "s[128]", params[0])) return SendClientMessage(playerid, -1, "Usage: /joinmessage <message>");
format(string, sizeof(string), "You have set your Join Message to: %s", params[0]);
SendClientMessage(playerid, -1, string);
GetPlayerName(playerid, pName, sizeof(pName));
format(file, sizeof(file), "%s.ini", pName);
dini_Create(file);
dini_Set(file, "Message", params[0]);
return 1;
}
Enjoy