AlpayLewis

SecKey Setting Command

Aug 17th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.23 KB | None | 0 0
  1. CMD:setseckey(playerid, params[])
  2. {
  3.     if(PlayerInfo[playerid][pAdmin] >= 99999){
  4.         new giveplayerid, seckey;
  5.         if(!sscanf(params, "ui", giveplayerid, seckey)){
  6.             if(IsPlayerConnected(giveplayerid)){
  7.                 if(giveplayerid != INVALID_PLAYER_ID){
  8.                     if(PlayerInfo[giveplayerid][pAdmin] != 0){
  9.                         PlayerInfo[giveplayerid][pSecKey] = seckey;
  10.                         gAdminAuthorized[giveplayerid] = 1;
  11.                         format(string, sizeof(string), "   Admin %s has set your Security Key to %d! It will work after a relog.", PlayerRPName(playerid), seckey);
  12.                         SendClientMessage(giveplayerid, COLOR_GRAD1, string);
  13.                         format(string, sizeof(string), "   You have set %s's Security Key to %d !", PlayerRPName(giveplayerid), seckey);
  14.                         SendClientMessage(playerid, COLOR_GRAD1, string);
  15.                     }else
  16.                     {
  17.                         SendClientMessage(playerid, COLOR_GREY, "   That player is not an Admin !");
  18.                     }
  19.                 }
  20.             }else{
  21.                 SendClientMessage(playerid, COLOR_GREY, "   That player is Offline !");
  22.             }
  23.         }else{
  24.             SendClientMessage(playerid, COLOR_WHITE, "Dastoor: /setseckey [playerid] [security code]");
  25.         }
  26.     }else{
  27.         SendClientMessage(playerid, COLOR_GRAD1, "   Shoma dastresie kafi baraye anjame inkar ra nadarid !");
  28.     }
  29.     return 1;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment