02.10.2012, 06:28
pawn Код:
#include <a_samp>
#define FILTERSCRIPT
#include <zcmd>
#include <sscanf>
#define MODERADOR 1
#define ADMINISTRADOR 2
new zAdmin[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" [FS] Sistema de Administraзгo");
print("--------------------------------------\n");
return 1;
}
public OnPlayerText(playerid, text[])
{
if(zAdmin[playerid] == MODERADOR)
{
new kNome[MAX_PLAYER_NAME], kString[128];
GetPlayerName(playerid, kNome, MAX_PLAYER_NAME);
format(kString,sizeof(kString),"%s {7FFFD4}[{FFD700}MOD{7FFFD4}][ID: {AFEEEE}%d{7FFFD4}]: {AFEEEE}%s", kNome, playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid), kString);
return 0;
}
else if(zAdmin[playerid] == ADMINISTRADOR)
{
new kNome[MAX_PLAYER_NAME], kString[128];
GetPlayerName(playerid, kNome, MAX_PLAYER_NAME);
format(kString,sizeof(kString),"%s {7FFFD4}[{FFD700}ADM{7FFFD4}][ID: {AFEEEE}%d{7FFFD4}]: {AFEEEE}%s", kNome, playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid), kString);
return 0;
}
return 1;
}
CMD:kick(playerid, params[])
{
if(zAdmin[playerid] == ADMINISTRADOR)
{
new ID, zString[128], Motivo[128], aName[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
if(sscanf(params, "us", ID, Motivo)) return SendClientMessage(playerid, -1, "USE: /kick [ID] [MOTIVO]");
GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
GetPlayerName(ID, pName, MAX_PLAYER_NAME);
format(zString,sizeof(zString),"{7FFFD4}O Administrador {AFEEEE}%s {7FFFD4}kickou o player {AFEEEE}%s{7FFFD4}, Motivo: {AFEEEE}%s", aName, pName, Motivo);
SendClientMessageToAll(-1, zString);
Kick(ID);
}
else
{
SendClientMessage(playerid, -1, "Vocк nгo tem permissгo!");
}
return 1;
}
Agora faz o resto....