Advertisement
OtaconEvil

[FS] Mini Sistema 'DUDAS' (BASE) By OTACON

Nov 30th, 2013
983
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.56 KB | None | 0 0
  1. /*
  2.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  3.     *
  4.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  5.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  6.     *
  7.     * Codigo Creado Por OTACON
  8.     *
  9.     * CREDITOS:
  10.     *     OTACON: Realizacion y Idea de creacion del code.
  11.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  12.     *
  13.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  14.     *
  15.     *                Prohibido TOTALMENTE el Robo de Créditos o la
  16.     *                  Publicación de este FILTERSCRIPT sin Mi Permiso.
  17. */
  18. /*
  19.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  20.     *
  21.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  22.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  23.     *
  24.     * Code Created By OTACON
  25.     *
  26.     * CREDITS:
  27.     *     OTACON: Idea Making and code creation.
  28.     *     YOUR: Modification freely respecting the above ;).
  29.     *
  30.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  31.     *
  32.     *                        FULLY spaces Theft Credit or
  33.     *                 Publication of this FILTERSCRIPT without my permission.
  34. */
  35. #include <a_samp>
  36. #include <sscanf2> //http://forum.sa-mp.com/showthread.php?t=120356
  37. #include <zcmd> //http://forum.sa-mp.com/showthread.php?t=91354
  38.  
  39. //variable global para activar el canal
  40. new bool:ActivarCanalGlobal;
  41.  
  42. //variable global para activar la visualizacion del canal por jugador
  43. new bool:ActivarCanalPlayer[MAX_PLAYERS];
  44.  
  45. COMMAND:duda(playerid, params[]){
  46.     new data[128],nombre[MAX_PLAYER_NAME+1], rango[50];
  47.    
  48.     //obtiene el nombre del jugador con la id correspondiente.
  49.     GetPlayerName(playerid, nombre, sizeof(nombre));
  50.    
  51.     //verifica si no escribiste ningun texto con el comando y le dara el mensaje.
  52.     if(sscanf(params, "s[128]", params[0])) return SendClientMessage(playerid, -1, "Escribe: /duda (texto)");
  53.  
  54.     //verifica si el canal esta desactivado y el jugador no es administrador y le dara el mensaje.
  55.     //CAMBIAR VariableADMIN por la variable del administador de tu sistema.
  56.     if(ActivarCanalGlobal==false && !VariableADMIN) return SendClientMessage(playerid, -1, "el canal esta desactivado y no eres admministrador!.");
  57.  
  58.     switch(VariableADMIN){ //CAMBIAR VariableADMIN por la variable del administador de tu sistema.
  59.         case 1: rango = "nombre del rango 1"; //CAMBIAR por el nombre del rango de tu sistema.
  60.         case 2: rango = "nombre del rango 2"; //ETC...
  61.         case 3: rango = "nombre del rango 3"; //ETC...
  62.         case 4: rango = "nombre del rango 4"; //ETC...
  63.         case 5: rango = "nombre del rango 5"; //ETC...
  64.         case 6: rango = "nombre del rango 6";//ETC...
  65.         //ETC...
  66.     }
  67.     //CAMBIAR VariableADMIN por la variable del administador de tu sistema.
  68.     if(VariableADMIN){ //es administrador
  69.         format(data, sizeof(data), "[RANGO ADMIN:%s] [NOMBRE:%s] [TEXTO:%s]", rango, nombre, params[0]);
  70.         MensajesCanal(data, -1);
  71.     }else{ //es jugador normal
  72.         format(data, sizeof(data), "[NIVEL:%d] [NOMBRE:%s] [ID:%d] [TEXTO:%s]", GetPlayerScore(playerid), nombre, playerid, params[0]);
  73.         MensajesCanal(data, -1);
  74.     }
  75.     return true;
  76. }
  77.  
  78. COMMAND:canalplayer(playerid, params[]){
  79.     if(!ActivarCanalPlayer[playerid]){ //canal desactivado, no es visualizado
  80.         ActivarCanalPlayer[playerid]=true; //activa el canal
  81.     }else{ //canal activado, es visualizado
  82.         ActivarCanalPlayer[playerid]=false; //desactiva el canal
  83.     }
  84.     return true;
  85. }
  86.  
  87. COMMAND:canalglobal(playerid, params[]){
  88.      //CAMBIAR VariableADMIN por la variable del administador de tu sistema.
  89.     if(VariableADMIN){ //es administrador
  90.         if(ActivarCanalGlobal){ //canal desactivado
  91.             ActivarCanalGlobal=true; //activa el canal
  92.             for(new player, user = GetMaxPlayers(); player != user; player++){
  93.                 if(!IsPlayerConnected(player)) continue;
  94.                 if(player==playerid) continue;
  95.                 ActivarCanalPlayer[player]=true; //le activa el canal a todos los jugadores para ser visualizado
  96.             }
  97.         }else{ //canal activado
  98.             ActivarCanalGlobal=false; //desactiva el canal
  99.             for(new player, user = GetMaxPlayers(); player != user; player++){
  100.                 if(!IsPlayerConnected(player)) continue;
  101.                 if(player==playerid) continue;
  102.                 ActivarCanalPlayer[player]=false; //le desactiva el canal a todos los jugadores para no ser visualizado
  103.             }
  104.         }
  105.     }else{ //es jugador normal
  106.         SendClientMessage(playerid, -1, "usted no es administrador!.");
  107.     }
  108.     return true;
  109. }
  110.  
  111.  
  112. stock MensajesCanal(const texto[], color) {
  113.     if(ActivarCanalGlobal==false) return false; //verifica que el canal este en false (desactivado) asi dejara la  funcion nula.
  114.     for(new player, user = GetMaxPlayers(); player != user; player++){ //verifica todos los jugadores que se encuentran comectados.
  115.         if(!IsPlayerConnected(player)) continue; //verifica si el jugador esta desconectado continuara co nel siguiente.
  116.         if(ActivarCanalPlayer[player]==true){ //verifica si el player tiene el canal activado
  117.             SendClientMessage(player, color, texto); //manda el mensaje correspondiente al todos los jugadores con el canal activado.
  118.         }
  119.     } return true;
  120. }
  121. /*
  122.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  123.     *
  124.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  125.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  126.     *
  127.     * Codigo Creado Por OTACON
  128.     *
  129.     * CREDITOS:
  130.     *     OTACON: Realizacion y Idea de creacion del code.
  131.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  132.     *
  133.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  134.     *
  135.     *                Prohibido TOTALMENTE el Robo de Créditos o la
  136.     *                  Publicación de este FILTERSCRIPT sin Mi Permiso.
  137. */
  138. /*
  139.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  140.     *
  141.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  142.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  143.     *
  144.     * Code Created By OTACON
  145.     *
  146.     * CREDITS:
  147.     *     OTACON: Idea Making and code creation.
  148.     *     YOUR: Modification freely respecting the above ;).
  149.     *
  150.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  151.     *
  152.     *                        FULLY spaces Theft Credit or
  153.     *                 Publication of this FILTERSCRIPT without my permission.
  154. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement