06.07.2012, 01:12
pawn Код:
CMD:ban (playerid, params[])
{
new Motivo[48];
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, C_ERRO, "Vocк nгo tem autorizaзгo para utilizar este comando");
if(sscanf(params, "us[47]", playerid, Motivo)) return SendClientMessage(playerid, -1, "Use: /Ban [{FF0000}ID{C0C0C0}] [{FF0000}Motivo{C0C0C0}]");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, C_ERRO, "Este {FF0000}ID{C0C0C0}/{FF0000}Nome{C0C0C0} estб Offline");
SendClientMessageToAll(C_ADMIN, "{FFFFFFF}__________| {FE019F}ADMINISTRAЗГO INFORMA {FFFFFF}|__________");
format(String, sizeof(String), "{FFFFFF}%s{FF000000} Foi Banido pelo Administrador {FFFFFF}%s.{FF000000} Motivo: {FFFFFF}%s");
SendClientMessageToAll(C_VERMELHO, String);
new
d,
m,
y;
getdate(y, m, d);
format(Conta, sizeof(Conta), "Contas/Ban/%s.ini", NomeDoPlayer(playerid));
if(DOF2_FileExists(Conta)) { DOF2_CreateFile(Conta); }
DOF2_SetString(Conta, "Adm", NomeDoPlayer(playerid));
DOF2_SetString(Conta, "Motivo", Motivo);
DOF2_SetInt(Conta, "Dia", d);
DOF2_SetInt(Conta, "Mкs", m);
DOF2_SetInt(Conta, "Ano", y);
Kick(playerid);
return true;
}
#EDIT
Veja:
https://sampforum.blast.hk/showthread.php?tid=274028
Para resolver basta:
pawn Код:
CMD:tv(playerid, params[])
{
new userid;
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, C_ERRO, "Vocк nгo tem autorizaзгo para utilizar este comando");
new bool: TVPlayer[MAX_PLAYERS], ID;
if(!TVPlayer[playerid])
{
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "Use: /TV [{FF0000}ID{C0C0C0}]");
TogglePlayerSpectating(playerid, 1);
if(IsPlayerInAnyVehicle(ID)) return PlayerSpectateVehicle(playerid, GetPlayerVehicleID(ID));
PlayerSpectatePlayer(playerid, userid);
format(String, sizeof(String), "Vocк estб de TV em: %s", NomeDoPlayer(playerid));
SendClientMessage(playerid, C_ERRO, String);
TVPlayer[playerid] = true;
}
else
{
TogglePlayerSpectating(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TVPlayer[playerid] = false;
}
return true;
}