19.12.2014, 12:01
This code of /ban and /Kick command doesn't show the SendClientMessage.. Why's this? Can anyone help me out?
Код:
CMD:kick(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id; new str[1000]; new reason[56]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, grey, "Usage:/kick (playerid/partofname) (reason)"); else { GetPlayerName(id, Target, sizeof(Target)); GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), ".: [{B4B5B7}Admin{FF6347}] ( {B4B5B7}%s {FF6347}) {B4B5B7}has kicked {FF6347}( {B4B5B7}%s {FF6347}){B4B5B7}, {FF6347}Reason; {B4B5B7}%s {FF6347}:.", AdminName, Target, reason); SendClientMessageToAll(lightred, str); SetTimerEx("DelayedKick", 500, false, "d", id); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; }
Код:
CMD:ban(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new id; new reason[128]; if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, grey, "Usage:/ban (playerid/partofname) (reason)"); if(PlayerInfo[playerid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant ban an Administrator!"); if(id == playerid) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant ban yourself!"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new year; new month; new day; new hour; new minuite; new second; new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; getdate(year, month, day); gettime(hour,minuite,second); GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}( %s ) Has [ BANNED ] {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}( %s ), {FF6347}Reason: {B4B5B7}%s :.", AdminName, Target, reason); SendClientMessageToAll(lightred, str); #define DIALOG_BAN 9706 format(str, sizeof(str), "{FF6347}Admin Name: {B4B5B7}%s .\n{FF6347}Date: {B4B5B7}%d{FF6347}/{B4B5B7}%d{FF6347}/{B4B5B7}%d .\n{FF6347}Time: {B4B5B7}%d{FF6347}:{B4B5B7}%d .\n{FF6347}Reason: {B4B5B7}%s .", AdminName, day, month, year, hour, minuite, reason); ShowPlayerDialog(id, DIALOG_BAN, DIALOG_STYLE_MSGBOX, "Ban Notice", str, "OK", ""); SetTimerEx("DelayedBan", 1000, false, "d", id); PlayerInfo[id][pBanned] = 1; } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; }