07.01.2011, 10:27
pawn Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '#')
{
new pid, string[128]; // MAX string is 128! You can also calculate how big string you need...
new help[MAX_PLAYER_NAME];
GetPlayerName(playerid, help, 24);
format(string, 128, "( # ) %s(ID: %i)",help, playerid, pid, text);
MessageToAdmins(AdminColor, string);
SendClientMessage(playerid, Yellow, "Your message has been sent to admins.");
return 0;
}
}
And the second problem:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged[playerid] == 1)
if(playerid == g_DuelingID1 || playerid == g_DuelingID2)
g_DuelInProgress = 0;
GetPlayerName(playerid, name, sizeof(name));
new string[64];
switch(reason)
{
case 0: format(string, sizeof(string), "%s has left the server (Timedout)", name);
case 1: format(string, sizeof(string), "%s has left the server (Leaving)", name);
case 2: format(string, sizeof(string), "%s has left the server (Kicked)", name);
}
SendClientMessageToAll(Yellow, string);
{
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
}
gPlayerLogged[playerid] = 0;
return 1;
}