Advertisement
Codeblocks

Untitled

Aug 4th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. COMMAND:hostname(playerid, params[]) {
  2. if (GetPVarInt(playerid, "Admin") < 9) return SendClientMessage(playerid, COLOR_WHITE, "Insufficient admin rank!");
  3. if (GetPVarInt(playerid, "Delay") > GetCount()) return SendClientMessage(playerid, COLOR_LIGHTRED, "You must wait before performing this command!");
  4. SetPVarInt(playerid, "Delay", GetCount()+2000);
  5. new text[124];
  6. if(sscanf(params, "s[124]", text)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /hostname [hostname]");
  7. else {
  8. if(strlen(text) > 124) return SendClientMessage(playerid, COLOR_WHITE, "Hostname too long. (124 characters max.)");
  9. new string[134]; //Padding for "hostname "
  10. format(string, sizeof(string), "hostname %s", text);
  11. SendRconCommand(string);
  12. }
  13. return 1;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement