pawn Код:
dcmd_readpm(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(ReadingPM[playerid] == 1)
{
SendClientMessage(playerid, 0xFF0000FF, "You is already reading the PM's");
return 1;
}
else
{
ReadingPM[playerid] = 1;
SendClientMessage(playerid, 0xFF0000FF, "You is now reading the PM's");
for(new i = 0; i < MAX_PLAYERS; i++)
{
new pName [MAX_PLAYER_NAME], tName [MAX_PLAYER_NAME], PMstring[128], targetid, message[64];
GetPlayerName(i, pName, MAX_PLAYER_NAME);
GetPlayerName(targetid, tName, MAX_PLAYER_NAME);
format(PMstring, sizeof(PMstring), "pm from %s(%d): %s to %s(%d)", pName, i, message, tName, targetid);
SendClientMessage(targetid, COLOR_PM, PMstring);
return 1;
}
}
}
return 0;
}
dcmd_readpmoff(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
if(ReadingPM[playerid] == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "You is not reading the PM's");
return 1;
}
else
{
ReadingPM[playerid] = 0;
SendClientMessage(playerid, 0xFF0000FF, "You dont read the PM's anymore");
return 1;
}
}
return 0;
}