DetonaSampOficial

comando para adm apenas

Feb 23rd, 2016
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.79 KB | None | 0 0
  1. if(strcmp(cmd, "/qderby", true) == 0)
  2.     {
  3. if(pAdmin[playerid] >= 1)// tua variavel de admin 1 = nivel de adm que poder abrir >= maior ou igual a nivel 1
  4. {
  5. return SenClientMessage(-1,playerid, voce nao è um administrador);//aviso para o player que tento o comando
  6.         if(qderbyplaying == 1)
  7.         {
  8.             SendClientMessage(playerid, 0xB4B5B7AA, "O derby já começou");
  9.             return 1;
  10.         }
  11.         if(playerinminigame[playerid] == 1)
  12.         {
  13.             SendClientMessage(playerid, 0xB4B5B7AA, "Voce já esta em um minigame");
  14.             return 1;
  15.         }
  16.         new pname[256];
  17.         GetPlayerName(playerid, pname, 256);
  18.         if(qderbyon == 0)
  19.         {
  20.             Respawnqbloodrings();
  21.             qderbyon = 1;
  22.             playerinminigame[playerid] = 1;
  23.             playerinqderby[playerid] = 1;
  24.             qderbyrank = 1;
  25.             SetPlayerInterior(playerid,0);
  26.             SetPlayerVirtualWorld(playerid,7);
  27.             SetVehicleVirtualWorld(qbloodring[0],7);
  28.             qbloodringfull[0] = 1;
  29.             PutPlayerInVehicle(playerid, qbloodring[0], 0);
  30.             playerinqbloodring[playerid] = 0;
  31.             TogglePlayerControllable(playerid, 0);
  32.             startvar[3] = 1;
  33.             qdtimer = SetTimer("StartqDerby", 60000, 0);
  34.             format(string, sizeof(string), "%s iniciou um derby pedreira, você tem um minuto para digitar, /qderby e juntar-se", pname);//
  35.             SendClientMessageToAll(0x33AA33AA,string);
  36.             return 1;
  37.         } else if(qderbyon == 1 && qderbyrank < 15) {
  38.             playerinminigame[playerid] = 1;
  39.             playerinqderby[playerid] = 1;
  40.             qderbyrank++;
  41.             SetPlayerInterior(playerid,0);
  42.             for(new i=0; i<15; i++)
  43.             {
  44.                 if(qbloodringfull[i] == 0)
  45.                 {
  46.                     SetPlayerVirtualWorld(playerid,7);
  47.                     SetVehicleVirtualWorld(qbloodring[i],7);
  48.                     qbloodringfull[i] = 1;
  49.                     PutPlayerInVehicle(playerid, qbloodring[i], 0);
  50.                     TogglePlayerControllable(playerid, 0);
  51.                     playerinqbloodring[playerid] = i;
  52.                     format(string, sizeof(string), "%s foi ao derby pedreira", pname);//
  53.                     SendClientMessageToAll(0x33AA33AA,string);
  54.                     return 1;
  55.                 }
  56.             }
  57.         } else if(qderbyon == 1 && qderbyrank >= 15) {
  58.             format(string, sizeof(string), "O derby pedreira está cheio, espere a próxima rodada", pname);//
  59.             SendClientMessage(playerid,0x33AA33AA,string);
  60. }// chave fechada da variavel adm
  61.             return 1;
  62.         }
  63.     }
  64.  
  65. CMD:abrigame(playerid)
  66. {
  67.     if(pAdmin[playerid] >= 1) return SendClientMessage(playerid,0xFF0000,"Erro: Você não tem permissão para usar este comando.");
  68.     if(eventogame == 1) return SendClientMessage(playerid, 0xFF0000,"ERRO: o minigame ja esta Aberto");
  69.     eventogame = 1;
  70.     SendClientMessageToAll(0x228B22FF , "[INFO] o minigamefoi aberto!");
  71.     SendClientMessage(playerid, -1, "|| ATENÇÃO ADM! Feche o Evento com /fecharminigame");
  72.     return 1;}
  73.     CMD:fechargame(playerid)
  74. {
  75.     if(pAdmin[playerid] >= 1) return SendClientMessage(playerid,0xFF0000,"Erro: Você não tem permissão para usar este comando.");
  76.     if(eventogame == 0) return SendClientMessage(playerid,0xFF0000,"ERRO: o mini game ja esta fehado");
  77.     eventogame = 0;
  78.     return 1;}
  79.    
  80.     if(eventogame == 0) return SendClientMessage(playerid,0xFF0000,"ERRO: o mini game esta fechado");
  81.     if(eventogame[playerid] == 1) return SendClientMessage(playerid,0xFF0000,"ERRO: Você ja crio o minigame !");
  82.     return 1;}
  83.      //e coloca isso no onplayeconn pra evita algum bug '-' eventogame [playerid] = 0
  84. // nao sei se è o certo mas coloca isso no ongamemodeinit() pra fechar qnd o gm e ligado ! // nao sei se e fs ou gm ent // '-'
  85. //eventogame= 0;
  86.    
  87.     //utilize o eventogame = 0 para fechado entao use ele no comando
  88.     // mude a variavel eventogame para a sua do seu comando
  89. // eu utilizei a varaivel padmin mas mude para a no ladmin que n sei qual è '-'
Advertisement
Add Comment
Please, Sign In to add comment