Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <ZCMD>
- #include <sscanf>
- #define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0)
- #define Ban(%0) SetTimerEx("Bana", 100, false, "i", %0)
- //Forwards
- forward Kicka(p);
- forward Bana(p);
- public Kicka(p) {
- #undef Kick
- Kick(p);
- #define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0)
- return 1;
- }
- public Bana(p) {
- #undef Ban
- Ban(p);
- #define Ban(%0) SetTimerEx("Bana", 100, false, "i", %0)
- return 1;
- }
- //COMANDOS
- //========================== [KICK] =========================================//
- CMD:kick(playerid, params[]) {
- new ID, Motivo[48], string[174], pNomi[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Você não tem permissão para usar este comando!");
- if(sscanf(params, "us", ID, Motivo)) return SendClientMessage(playerid, -1, "{FF0000}USE :{FFFFFF}/kick [ID] [MOTIVO].");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Este jogador não se encontra online.");
- if(strlen(Motivo) > 48) return SendClientMessage(playerid, -1,"Use no máximo 48 caracteres no motivo!");
- GetPlayerName(ID, pNomi, sizeof(pNomi));
- GetPlayerName(playerid, aname, sizeof(aname));
- Kick(ID);
- format(string, sizeof(string),"{FF0000}-| O Administrador %s [ID:%d] kickou o jogador %s [ID:%d]. Motivo : %s |-", aname, playerid, pNomi, ID, Motivo);
- SendClientMessageToAll(-1,string);
- return 1;
- }
- //========================= [BAN] ==========================================//
- CMD:ban(playerid, params[]) {
- new ID, Motivo[48], string[174], pNomi[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Você não tem permissão para usar este comando!");
- if(sscanf(params, "us", ID, Motivo)) return SendClientMessage(playerid, -1, "{FF0000}USE :{FFFFFF}/ban [ID] [MOTIVO] .");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Este jogador não se encontra online.");
- if(strlen(Motivo) > 48) return SendClientMessage(playerid, -1,"Use no máximo 48 caracteres no motivo!");
- GetPlayerName(playerid, pNomi, sizeof(pNomi));
- GetPlayerName(ID, aname, sizeof(aname));
- Ban(ID);
- format(string, sizeof(string),"{FF0000}-| O Administrador %s [ID:%d] baniu o jogador %s [ID:%d]. Motivo : %s |-", pNomi, ID, aname, ID, Motivo);
- SendClientMessageToAll(-1,string);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment