Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Kicks a player with a reason
- COMMAND:kikaj(playerid, params[])
- {
- new PlayerToKick, Reason[128], ReasonMsg[128], Name[24], AdminName[24];
- // Send the command to all admins so they can see it
- SendAdminText(playerid, "/kikaj", params);
- // Check if the player has logged in
- if(APlayerData[playerid][LoggedIn] == true)
- {
- // Check if the player's admin-level is at least 1
- if(APlayerData[playerid][PlayerLevel] >= 1)
- {
- // if(APlayerData[playerid][onDuty] == 1)
- // {
- if (sscanf(params, "us[128]", PlayerToKick, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Koristenje: \"/kikaj <Igrac> <Razlog>\"");
- if (IsPlayerConnected(PlayerToKick)) // If the player is a valid playerid (he's connected)
- {
- // Get the name of the player who warned the player
- GetPlayerName(playerid, AdminName, sizeof(AdminName));
- GetPlayerName(PlayerToKick, Name, sizeof(Name));
- // Send the warned player a message who kicked him and why he's been kicked
- format(ReasonMsg, 128, "Izbacen si sa servera od %s %s", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName);
- SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
- format(ReasonMsg, 128, "Razlog: %s", Reason);
- SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
- format(ReasonMsg, 128, "{FF0033}[KICK] {FFFFFF}Igrac %s je kikan od strane administratora. {FF0033}Razlog:{FFFFFF} %s", Name, Reason);
- SendClientMessageToAll(0xFFFFFFFF, ReasonMsg);
- // Kick the player
- Kick_(PlayerToKick);
- }
- else SendClientMessage(playerid, 0xFF0000FF, "Upisani igrac nije online na serveru.");
- // }
- // else SendClientMessage(playerid, 0xFF0000FF, "Niste na staff duznosti!");
- }
- else
- return 0;
- }
- else return 0;
- // Let the server know that this was a valid command
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment