@shoru93 i will give you the /kick and /ban command.
pawn Код:
CMD:kick
(playerid, params
[]){ new pid;
if(PlayerInfo
[playerid
][pAdmin
] >= 2) { if(sscanf
(params,
"us[128]", pid, params
[2])) return SendClientMessage
(playerid,COLOR_RED,
"USAGE: /kick <playerid/name> <reason>");
if(!IsPlayerConnected
(pid
) && pid
!= INVALID_PLAYER_ID
&& pid
!= playerid
) { new adminname
[MAX_PLAYER_NAME
], paramname
[MAX_PLAYER_NAME
], string
[180];
GetPlayerName
(pid, paramname,
sizeof(paramname
));
GetPlayerName
(playerid, adminname,
sizeof(adminname
));
format(string,
sizeof(string
),
"Administrator %s has kicked %s <Reason: %s>",adminname,paramname, params
[2]);
SendClientMessageToAll
(COLOR_RED, string
);
format(string,
sizeof(string
),
"You have been kicked by Administrator %s <Reason: %s>", paramname, params
[2]);
SendClientMessage
(pid,COLOR_RED, string
);
format(string,
sizeof(string
),
"You kicked %s <Reason: %s>", paramname, params
[2]);
SendClientMessage
(playerid,COLOR_GREEN, string
);
Kick
(pid
);
format(string,
sizeof(string
),
"Administrator %s has kicked %s",adminname,paramname
);
SendToAdmins
(COLOR_GREY,string
);
} else return SendClientMessage
(playerid,COLOR_RED,
"ERROR: Player is not connected or its yourself.");
} else return SendClientMessage
(playerid,COLOR_RED,
"ERROR: You must be Administrator Level 2 to use this command");
return 1;
}CMD:ban
(playerid, params
[]){ new pid;
if(PlayerInfo
[playerid
][pAdmin
] >= 3) { if(sscanf
(params,
"us[128]", pid, params
[2])) return SendClientMessage
(playerid,COLOR_RED,
"USAGE: /ban <playerid/name> <reason>");
if(!IsPlayerConnected
(pid
) && pid
!= INVALID_PLAYER_ID
&& pid
!= playerid
) { new adminname
[MAX_PLAYER_NAME
], paramname
[MAX_PLAYER_NAME
], string
[180];
new year,month,day;
getdate(year, month, day
);
new hour,minuite,second;
gettime(hour,minuite,second
);
GetPlayerName
(pid, paramname,
sizeof(paramname
));
GetPlayerName
(playerid, adminname,
sizeof(adminname
));
format(string,
sizeof(string
),
"Administrator %s has ban %s <Reason: %s> <Date: %d/%d/%d> <Time: %d:%d>",adminname,paramname, params
[2],day,month,year,hour,minuite
);
SendClientMessageToAll
(COLOR_RED, string
);
format(string,
sizeof(string
),
"You have been ban by Administrator %s <Reason: %s>", paramname, params
[2]);
SendClientMessage
(pid,COLOR_RED, string
);
SendClientMessage
(pid,COLOR_WHITE,
"====Xtreme Gangwar 0.3c Ban Details====");
format(string,
sizeof(string
),
"You have been ban by Administrator %s <Reason: %s>", paramname, params
[2]);
SendClientMessage
(pid,COLOR_RED, string
);
SendClientMessage
(pid,COLOR_RED,
"Make unban appeal at our forums. www.server.com");
SendClientMessage
(pid,COLOR_RED,
"Dont Try To Ban Evade or You will be range banned!");
format(string,
sizeof(string
),
"You ban %s <Reason: %s>", paramname, params
[2]);
SendClientMessage
(playerid,COLOR_GREEN, string
);
SaveIn
("BanLog",string
);
Kick
(pid
);
format(string,
sizeof(string
),
"Administrator %s has banned %s",adminname,paramname
);
SendToAdmins
(COLOR_GREY,string
);
} else return SendClientMessage
(playerid,COLOR_RED,
"ERROR: Player is not connected or its yourself.");
} else return SendClientMessage
(playerid,COLOR_RED,
"ERROR: You must be Administrator Level 2 to use this command");
return 1;
}