07.01.2011, 10:15
This cmd asking for help doesnt really work, when you type long words it will show to the admins, but the reason wont be shown
also when someone disconnects, get banned, gets kicked, or crashes, the leave messages doesnt work
Here is the code
pawn Код:
dcmd_#(playerid, params[])
{
new pid, string[210];
if(sscanf(params, "us", pid, params[2])) return SendClientMessage(playerid, Yellow, "Usage: /# <message>");
new help[MAX_PLAYER_NAME];
GetPlayerName(playerid, help, sizeof(help));
format(string, sizeof(string), "( # ) %s(ID: %i)",help, playerid, pid, params[2]);
MessageToAdmins(AdminColor, string);
SendClientMessage(playerid, Yellow, "Your message has been sent to admins.");
return 1;
}
Here is the code
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);
}
{
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
}
gPlayerLogged[playerid] = 0;
return 1;
}