Suleee

Untitled

Mar 7th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. // Kicks a player with a reason
  2. COMMAND:kikaj(playerid, params[])
  3. {
  4. new PlayerToKick, Reason[128], ReasonMsg[128], Name[24], AdminName[24];
  5.  
  6. // Send the command to all admins so they can see it
  7. SendAdminText(playerid, "/kikaj", params);
  8.  
  9. // Check if the player has logged in
  10. if(APlayerData[playerid][LoggedIn] == true)
  11. {
  12. // Check if the player's admin-level is at least 1
  13. if(APlayerData[playerid][PlayerLevel] >= 1)
  14. {
  15. // if(APlayerData[playerid][onDuty] == 1)
  16. // {
  17. if (sscanf(params, "us[128]", PlayerToKick, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Koristenje: \"/kikaj <Igrac> <Razlog>\"");
  18. if (IsPlayerConnected(PlayerToKick)) // If the player is a valid playerid (he's connected)
  19. {
  20. // Get the name of the player who warned the player
  21. GetPlayerName(playerid, AdminName, sizeof(AdminName));
  22. GetPlayerName(PlayerToKick, Name, sizeof(Name));
  23. // Send the warned player a message who kicked him and why he's been kicked
  24. format(ReasonMsg, 128, "Izbacen si sa servera od %s %s", AdminLevelName[APlayerData[playerid][PlayerLevel]], AdminName);
  25. SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
  26. format(ReasonMsg, 128, "Razlog: %s", Reason);
  27. SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
  28. format(ReasonMsg, 128, "{FF0033}[KICK] {FFFFFF}Igrac %s je kikan od strane administratora. {FF0033}Razlog:{FFFFFF} %s", Name, Reason);
  29. SendClientMessageToAll(0xFFFFFFFF, ReasonMsg);
  30. // Kick the player
  31. Kick_(PlayerToKick);
  32. }
  33. else SendClientMessage(playerid, 0xFF0000FF, "Upisani igrac nije online na serveru.");
  34. // }
  35. // else SendClientMessage(playerid, 0xFF0000FF, "Niste na staff duznosti!");
  36. }
  37. else
  38. return 0;
  39. }
  40. else return 0;
  41.  
  42. // Let the server know that this was a valid command
  43. return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment