Advertisement
OtaconEvil

[FS] Mini Sistema de Telefonos Moviles (BASE) By OTACON

Nov 20th, 2013
1,199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.37 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.  
  36. // MINI SISTEMA DE TELEFONO MOVIL (BASE) by OTACON
  37. #include <a_samp>
  38. #include <zcmd>
  39. #include <sscanf2>
  40.  
  41. //variables generales
  42. #define MAX_CREDITOS (10) //10 llamadas disponibles
  43. new bool:NumeroOcupado[MAX_PLAYERS],
  44. NumeroTelefono[MAX_PLAYERS],
  45. bool:TelefonoComprado[MAX_PLAYERS],
  46. NumeroTelefonoEntrante[MAX_PLAYERS],
  47. CreditosTelefono[MAX_PLAYERS];
  48.  
  49. //cargar creditos al movil
  50. CMD:creditos(playerid, params[]) {
  51.     if(TelefonoComprado[playerid] == false) return SendClientMessage(playerid,-1,"no tienes un movil");
  52.     if(NumeroOcupado[playerid] == true) return SendClientMessage(playerid,-1,"estas en una llamada");
  53.     if(CreditosTelefono[playerid] >= MAX_CREDITOS) return SendClientMessage(playerid,-1,"el movil ya tiene creditos suficientes ");
  54.     if(CreditosTelefono[playerid] >= 1) return SendClientMessage(playerid,-1,"el movil aun tiene creditos");
  55.     CreditosTelefono[playerid] = MAX_CREDITOS;
  56.     SendClientMessage(playerid,-1,"haz cargado creditos al telefono movil");
  57.     return true;
  58. }
  59. //hablar por el movil
  60. CMD:hablar(playerid, params[]) {
  61.     new dataphone[100];
  62.     if(NumeroOcupado[playerid] == false) return SendClientMessage(playerid,-1,"no estas en una llamada");
  63.     if(sscanf(params, "s[100]", params[0])) return SendClientMessage(playerid, -1, "Utiliza: /habrar [texto]");
  64.     for(new player, user = GetMaxPlayers(); player != user; player++) {
  65.         if(!IsPlayerConnected(player)) continue;
  66.         if(NumeroTelefono[player] == NumeroTelefonoEntrante[playerid] && NumeroTelefono[player] != NumeroTelefono[playerid]) {
  67.             format(dataphone,sizeof(dataphone),"mensaje enviado %s, numero: %d", params[0], NumeroTelefonoEntrante[playerid]);
  68.             SendClientMessage(player,-1,dataphone);
  69.             format(dataphone,sizeof(dataphone),"mensaje enviado %s, numero: %d", params[0], NumeroTelefonoEntrante[playerid]);
  70.             SendClientMessage(playerid,-1,dataphone);
  71.         }
  72.     }
  73.     return true;
  74. }
  75. //para cortar la llamada
  76. CMD:colgar(playerid, params[]) {
  77.     if(NumeroOcupado[playerid] == false) return SendClientMessage(playerid,-1,"no estas en una llamada");
  78.     NumeroOcupado[playerid] = false;
  79.     NumeroTelefonoEntrante[playerid] = -1;
  80.     SendClientMessage(playerid,-1,"colgaste la llamada!.");
  81.     return true;
  82. }
  83. //para iniciar la llamada
  84. CMD:llamar(playerid, params[]) {
  85.     new dataphone[100];
  86.     if(TelefonoComprado[playerid] == false) return SendClientMessage(playerid,-1,"no tienes un movil");
  87.     if(NumeroOcupado[playerid] == true) return SendClientMessage(playerid,-1,"ya estas en una llamada");
  88.     if(CreditosTelefono[playerid] <= 0) return SendClientMessage(playerid,-1,"el movil no tiene creditos");
  89.     if(sscanf(params, "ds[100]", params[0], params[1])) return SendClientMessage(playerid, -1, "Utiliza: /llamar [numero] [texto]");
  90.     for(new player, user = GetMaxPlayers(); player != user; player++) {
  91.         if(!IsPlayerConnected(player)) continue;
  92.         if(NumeroTelefono[player] != params[0] && NumeroOcupado[player] == true && (NumeroTelefono[playerid] == params[0])) {
  93.             SendClientMessage(playerid,-1,"numero no localizado o ocupado!.");
  94.         } else {
  95.             SendClientMessage(playerid,-1,"numero si localizado!.");
  96.             SendClientMessage(playerid,-1,"mensaje enviado!.");
  97.             format(dataphone,sizeof(dataphone),"haz llamado al numero: %d., mensaje enviado: %s", NumeroTelefono[player], params[1]);
  98.             SendClientMessage(playerid,-1,dataphone);
  99.             format(dataphone,sizeof(dataphone),"el numero: %d te ha lladado, mensaje enviado: %s", NumeroTelefono[playerid], params[1]);
  100.             SendClientMessage(player,-1,dataphone);
  101.             NumeroOcupado[playerid] = true;
  102.             NumeroOcupado[player] = true;
  103.             NumeroTelefonoEntrante[player] = NumeroTelefono[playerid];
  104.             CreditosTelefono[playerid] --;
  105.             SendClientMessage(player,-1,"usa  el ocmando /hablar para responder!.");
  106.         }
  107.     }
  108.     return true;
  109. }
  110. //para comprar el movil
  111. CMD:telefono(playerid, params[]) {
  112.     new dataphone[100];
  113.     if(TelefonoComprado[playerid] == true) return SendClientMessage(playerid,-1,"ya tienes un movil");
  114.     new telefonocomprado = random(999999999);
  115.     for(new player, user = GetMaxPlayers(); player != user; player++) {
  116.         if(!IsPlayerConnected(player)) continue;
  117.         if(NumeroTelefono[player] == telefonocomprado && (player == playerid)) continue;
  118.         NumeroTelefono[playerid] = telefonocomprado;
  119.         TelefonoComprado[playerid] = true; break;
  120.     }
  121.     format(dataphone,sizeof(dataphone),"haz comprado un telefono movil con el numero: %d",NumeroTelefono[playerid]);
  122.     SendClientMessage(playerid,-1,dataphone);
  123.     return true;
  124. }
  125. // MINI SISTEMA DE TELEFONO MOVIL (BASE) by OTACON
  126.  
  127. /*
  128.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  129.     *
  130.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  131.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  132.     *
  133.     * Codigo Creado Por OTACON
  134.     *
  135.     * CREDITOS:
  136.     *     OTACON: Realizacion y Idea de creacion del code.
  137.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  138.     *
  139.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  140.     *
  141.     *                Prohibido TOTALMENTE el Robo de Créditos o la
  142.     *                  Publicación de este FILTERSCRIPT sin Mi Permiso.
  143. */
  144. /*
  145.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  146.     *
  147.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  148.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  149.     *
  150.     * Code Created By OTACON
  151.     *
  152.     * CREDITS:
  153.     *     OTACON: Idea Making and code creation.
  154.     *     YOUR: Modification freely respecting the above ;).
  155.     *
  156.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  157.     *
  158.     *                        FULLY spaces Theft Credit or
  159.     *                 Publication of this FILTERSCRIPT without my permission.
  160. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement