Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (strcmp("/kick", cmdtext, true) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- new kickid[30],kickreason[30],kickername[30],kickedname[30];
- SSCANF(params,"ss",kickid,kickreason);
- GetPlayerName(playerid,kickername,sizeof(kickername));
- GetPlayerName(kickid,kickedname,sizeof(kickedname));
- if (IsPlayerConnected(kickid))
- {
- if (!IsPlayerAdmin(kickid))
- {
- if (kickid!=playerid)
- {
- new kickerstring[20];
- format(kickerstring,sizeof(kickerstring),"Administrator \"%s\" has kicked \"%s\". (Reason: %s)", kickername,kickedname,kickreason);
- SendClientMessageToAll(red,kickerstring);
- Kick(kickid);
- } else { SendClientMessage(playerid,red,"Error: You can't kick yourself!"); }
- } else {
- new kickerrorstring1[40], kickerrorstring2[40];
- format(kickerrorstring1,sizeof(kickerrorstring1),"You can't kick administrator \"%s\"! Message sent for him / her about your attempt.", kickedname);
- format(kickerrorstring2,sizeof(kickerrorstring2), "%s has just tried to kick you, but failed.",kickername);
- SendClientMessage(playerid,red,kickerrorstring1);
- SendClientMessage(id,orange,kickerrorstring2);
- }
- } else { SendClientMessage(playerid,red,"Player is not connected."); }
- }
- if (strcmp("/ban", cmdtext, true) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- new banid[30],banreason[30],bannername[30],bannedname[30];
- SSCANF(params,"ss",banid,reason);
- GetPlayerName(playerid,bannername,sizeof(bannername));
- GetPlayerName(banid,bannedname,sizeof(bannedname));
- if (IsPlayerConnected(id))
- {
- if (!IsPlayerAdmin(banid))
- {
- if (banid!=playerid)
- {
- new bannerstring[20];
- format(bannerstring,sizeof(bannerstring),"Administrator \"%s\" has banned \"%s\". (Reason: %s)", bannername,bannedname,banreason);
- SendClientMessageToAll(red,bannerstring);
- Ban(banid);
- } else { SendClientMessage(playerid,red,"Error: You can't ban yourself!"); }
- } else {
- new errorstring1[40], errorstring2[40];
- format(banerrorstring1,sizeof(banerrorstring1),"You can't ban administrator \"%s\"! Message sent for him / her about your attempt.", bannedname);
- format(banerrorstring2,sizeof(banerrorstring2), "%s has just tried to ban you, but failed.",bannername);
- SendClientMessage(playerid,red,banerrorstring1);
- SendClientMessage(id,orange,banerrorstring2);
- }
- } else { SendClientMessage(playerid,red,"Player is not connected."); }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement