01.01.2015, 17:38
Hello,
I'm trying to create that admin can read PM(s) but I didn't know to create it.
Regards,
ShadyX
I'm trying to create that admin can read PM(s) but I didn't know to create it.
Regards,
ShadyX
CMD:pm(playerid, params[]) { //code for(new adminid; adminid != MAX_PLAYERS; adminid++) { if(!IsPlayerConnected(adminid) || !IsPlayerAdmin(adminid)) continue; SendClientMessage(adminid, -1, message); } return 1; }
dcmd_pm(playerid,params[])
{
new string[128];
new ID;
new cmdreason[100];
if(sscanf(params, "us[100]", ID, cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /pm (Player Name/ID) (Message)");
return 1;
}
if(IsMuted[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You are muted. You can't use this command!");
return 1;
}
if(udb_Exists(PlayerName(playerid)) && !PLAYERLIST_authed[playerid])
{
SendClientMessage(playerid,COLOR_ERROR,"You must login before you can talk");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string, sizeof(string), "The Player ID (%d) is not connected to the server.",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
format(string, sizeof(string), "PM Sent to: %s(%d): %s",PlayerName(ID),ID,cmdreason);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string, sizeof(string), "PM From: %s(%d) %s",PlayerName(playerid),playerid,cmdreason);
SendClientMessage(ID,COLOR_YELLOW,string);
format(string, sizeof(string), "3[PM] From %s(%d) to %s(%d): %s",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason); // [0] <jacob> hi
IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
SpamStrings[playerid] ++;
PlayerPlaySound(ID,1085,0.0,0.0,0.0);
return 1;
}
dcmd_pm(playerid,params[])
{
new string[128];
new ID;
new cmdreason[100];
if(sscanf(params, "us[100]", ID, cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /pm (Player Name/ID) (Message)");
return 1;
}
if(IsMuted[playerid] == 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You are muted. You can't use this command!");
return 1;
}
if(udb_Exists(PlayerName(playerid)) && !PLAYERLIST_authed[playerid])
{
SendClientMessage(playerid,COLOR_ERROR,"You must login before you can talk");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string, sizeof(string), "The Player ID (%d) is not connected to the server.",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
format(string, sizeof(string), "PM Sent to: %s(%d): %s",PlayerName(ID),ID,cmdreason);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string, sizeof(string), "PM From: %s(%d) %s",PlayerName(playerid),playerid,cmdreason);
SendClientMessage(ID,COLOR_YELLOW,string);
format(string, sizeof(string), "3[PM] From %s(%d) to %s(%d): %s",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason); // [0] <jacob> hi
IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
format(string, sizeof(string), "[PM] From %s(%d) to %s(%d): %s",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason);
SendMessageToAdmins(COLOR_YELLOW, string);
SpamStrings[playerid] ++;
PlayerPlaySound(ID,1085,0.0,0.0,0.0);
return 1;
}
stock SendMessageToAdmins(color, message[]) // to send message to online admins
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (pInfo[i][Admin] >= 3)// put your enum here
SendClientMessage(i, color, message);
}
}
return 1;