18.01.2015, 21:18
hey im trying to make a block/unblock cmd but i cant pls someone help me
Pm codes
Pm codes
PHP код:
COMMAND:pm(playerid, params[])
{
if(GetPVarInt(playerid, "togPM") == 1) return SendClientError(playerid, "You have private mesasges disables. Use /togpm to re-enable.");
new iPlayer, iText[ 128 ];
if( sscanf ( params, "us", iPlayer, iText)) return SCP(playerid, "[PlayerID/PartOfName] [message]");
if(PlayerTemp[playerid][muted]) return SendClientError(playerid, "You are muted!");
if(FindIP(iText))
{
KickReas("[SERVER]",playerid,"Attempting to advertise IP's!");
return 1;
}
if(GetPVarInt(iPlayer, "togPM") == 1 && !GetAdminLevel(playerid)) return SendClientError(playerid, "That player has blocked incoming private messages.");
format(iStr, sizeof(iStr), "(( %s(%d): %s ))", RPName(playerid), playerid, iText);
SendClientMessage(iPlayer, 0xFF66FFAA, iStr);
if(PlayerTemp[iPlayer][lastpm] == 666) SendClientMessage(iPlayer, -1, "{d9d9d5} You can use {b4b4b1}\"/re [message]\"{d9d9d5}to send a quick reply.");
format(iStr, sizeof(iStr), "(( PM sent %s(%d): %s ))", RPName(iPlayer), iPlayer, iText);
SendClientMessage(playerid, 0xFF66FFAA, iStr);
format( iStr, sizeof(iStr), "13[PM] (( %s(%d) to %s(%d): %s ))",PlayerName(playerid), playerid, PlayerName(iPlayer), iPlayer, iText);
iEcho( iStr );
PlayerLoop(i)
{
if(PlayerTemp[i][adminspy] == 1)
{
format(iStr, sizeof(iStr), "(/pm) %s to %s: %s", PlayerName(playerid), PlayerName(iPlayer), iText);
SendClientMessage(i, COLOR_LIGHTGREY, iStr);
}
}
PlayerTemp[iPlayer][lastpm] = playerid;
if(iAFKp[iPlayer] > 3)
{
format(iStr, sizeof(iStr),"%s is currently AFK",RPName(iPlayer));
SendClientMessage(playerid, COLOR_GREY, iStr);
}
return 1;
}