[Ayuda] Sistema de telefonos
#6

Quote:
Originally Posted by lanci112
Посмотреть сообщение
El cуdigo lleva hacia ninguna parte jaja, esta caнdo o algo asн.

no, anda perfecto, pero puede ser que sea uno de los que no pueden entrar por la causa que banean las ip de tal pais.
aca te deje el code.
saludos.

pawn Код:
/*
    * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
    *
    * Estи Simple FILTERSCRIPT esta hecho especialmente para http://www.forum.sa-mp.com
    * NO Publicar estи FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
    *
    * Codigo Creado Por OTACON
    *
    * CREDITOS:
    *     OTACON: Realizacion y Idea de creacion del code.
    *     TЩ: Modificacion libremente respetando lo mencionado ;).
    *
    *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
    *
    *                Prohibido TOTALMENTE el Robo de Crйditos o la
    *                  Publicaciуn de este FILTERSCRIPT sin Mi Permiso.
*/

/*
    * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
    *
    * This simple FILTERSCRIPT is made especially for http://www.forum.sa-mp.com
    * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
    *
    * Code Created By OTACON
    *
    * CREDITS:
    *     OTACON: Idea Making and code creation.
    *     YOUR: Modification freely respecting the above ;).
    *
    *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
    *
    *                        FULLY spaces Theft Credit or
    *                 Publication of this FILTERSCRIPT without my permission.
*/


// MINI SISTEMA DE TELEFONO MOVIL (BASE) by OTACON
#include <a_samp>
#include <zcmd>
#include <sscanf2>

//variables generales
#define MAX_CREDITOS (10) //10 llamadas disponibles
new bool:NumeroOcupado[MAX_PLAYERS],
NumeroTelefono[MAX_PLAYERS],
bool:TelefonoComprado[MAX_PLAYERS],
NumeroTelefonoEntrante[MAX_PLAYERS],
CreditosTelefono[MAX_PLAYERS];

//cargar creditos al movil
CMD:creditos(playerid, params[]) {
    if(TelefonoComprado[playerid] == false) return SendClientMessage(playerid,-1,"no tienes un movil");
    if(NumeroOcupado[playerid] == true) return SendClientMessage(playerid,-1,"estas en una llamada");
    if(CreditosTelefono[playerid] >= MAX_CREDITOS) return SendClientMessage(playerid,-1,"el movil ya tiene creditos suficientes ");
    if(CreditosTelefono[playerid] >= 1) return SendClientMessage(playerid,-1,"el movil aun tiene creditos");
    CreditosTelefono[playerid] = MAX_CREDITOS;
    SendClientMessage(playerid,-1,"haz cargado creditos al telefono movil");
    return true;
}
//hablar por el movil
CMD:hablar(playerid, params[]) {
    new dataphone[100];
    if(NumeroOcupado[playerid] == false) return SendClientMessage(playerid,-1,"no estas en una llamada");
    if(sscanf(params, "s[100]", params[0])) return SendClientMessage(playerid, -1, "Utiliza: /habrar [texto]");
    for(new player, user = GetMaxPlayers(); player != user; player++) {
        if(!IsPlayerConnected(player)) continue;
        if(NumeroTelefono[player] == NumeroTelefonoEntrante[playerid] && NumeroTelefono[player] != NumeroTelefono[playerid]) {
            format(dataphone,sizeof(dataphone),"mensaje enviado %s, numero: %d", params[0], NumeroTelefonoEntrante[playerid]);
            SendClientMessage(player,-1,dataphone);
            format(dataphone,sizeof(dataphone),"mensaje enviado %s, numero: %d", params[0], NumeroTelefonoEntrante[playerid]);
            SendClientMessage(playerid,-1,dataphone);
        }
    }
    return true;
}
//para cortar la llamada
CMD:colgar(playerid, params[]) {
    if(NumeroOcupado[playerid] == false) return SendClientMessage(playerid,-1,"no estas en una llamada");
    NumeroOcupado[playerid] = false;
    NumeroTelefonoEntrante[playerid] = -1;
    SendClientMessage(playerid,-1,"colgaste la llamada!.");
    return true;
}
//para iniciar la llamada
CMD:llamar(playerid, params[]) {
    new dataphone[100];
    if(TelefonoComprado[playerid] == false) return SendClientMessage(playerid,-1,"no tienes un movil");
    if(NumeroOcupado[playerid] == true) return SendClientMessage(playerid,-1,"ya estas en una llamada");
    if(CreditosTelefono[playerid] <= 0) return SendClientMessage(playerid,-1,"el movil no tiene creditos");
    if(sscanf(params, "ds[100]", params[0], params[1])) return SendClientMessage(playerid, -1, "Utiliza: /llamar [numero] [texto]");
    for(new player, user = GetMaxPlayers(); player != user; player++) {
        if(!IsPlayerConnected(player)) continue;
        if(NumeroTelefono[player] != params[0] && NumeroOcupado[player] == true && (NumeroTelefono[playerid] == params[0])) {
            SendClientMessage(playerid,-1,"numero no localizado o ocupado!.");
        } else {
            SendClientMessage(playerid,-1,"numero si localizado!.");
            SendClientMessage(playerid,-1,"mensaje enviado!.");
            format(dataphone,sizeof(dataphone),"haz llamado al numero: %d., mensaje enviado: %s", NumeroTelefono[player], params[1]);
            SendClientMessage(playerid,-1,dataphone);
            format(dataphone,sizeof(dataphone),"el numero: %d te ha lladado, mensaje enviado: %s", NumeroTelefono[playerid], params[1]);
            SendClientMessage(player,-1,dataphone);
            NumeroOcupado[playerid] = true;
            NumeroOcupado[player] = true;
            NumeroTelefonoEntrante[player] = NumeroTelefono[playerid];
            CreditosTelefono[playerid] --;
            SendClientMessage(player,-1,"usa  el ocmando /hablar para responder!.");
        }
    }
    return true;
}
//para comprar el movil
CMD:telefono(playerid, params[]) {
    new dataphone[100];
    if(TelefonoComprado[playerid] == true) return SendClientMessage(playerid,-1,"ya tienes un movil");
    new telefonocomprado = random(999999999);
    for(new player, user = GetMaxPlayers(); player != user; player++) {
        if(!IsPlayerConnected(player)) continue;
        if(NumeroTelefono[player] == telefonocomprado && (player == playerid)) continue;
        NumeroTelefono[playerid] = telefonocomprado;
        TelefonoComprado[playerid] = true; break;
    }
    format(dataphone,sizeof(dataphone),"haz comprado un telefono movil con el numero: %d",NumeroTelefono[playerid]);
    SendClientMessage(playerid,-1,dataphone);
    return true;
}
// MINI SISTEMA DE TELEFONO MOVIL (BASE) by OTACON

/*
    * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
    *
    * Estи Simple FILTERSCRIPT esta hecho especialmente para http://www.forum.sa-mp.com
    * NO Publicar estи FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
    *
    * Codigo Creado Por OTACON
    *
    * CREDITOS:
    *     OTACON: Realizacion y Idea de creacion del code.
    *     TЩ: Modificacion libremente respetando lo mencionado ;).
    *
    *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
    *
    *                Prohibido TOTALMENTE el Robo de Crйditos o la
    *                  Publicaciуn de este FILTERSCRIPT sin Mi Permiso.
*/

/*
    * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
    *
    * This simple FILTERSCRIPT is made especially for http://www.forum.sa-mp.com
    * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
    *
    * Code Created By OTACON
    *
    * CREDITS:
    *     OTACON: Idea Making and code creation.
    *     YOUR: Modification freely respecting the above ;).
    *
    *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
    *
    *                        FULLY spaces Theft Credit or
    *                 Publication of this FILTERSCRIPT without my permission.
*/
Reply


Messages In This Thread
[Ayuda] Sistema de telefonos - by lanci112 - 25.04.2014, 01:43
Respuesta: [Ayuda] Sistema de telefonos - by Braun - 25.04.2014, 11:42
Re: [Ayuda] Sistema de telefonos - by MpK - 25.04.2014, 12:09
Respuesta: [Ayuda] Sistema de telefonos - by OTACON - 25.04.2014, 22:10
Respuesta: [Ayuda] Sistema de telefonos - by lanci112 - 26.04.2014, 06:27
Respuesta: [Ayuda] Sistema de telefonos - by OTACON - 26.04.2014, 06:32

Forum Jump:


Users browsing this thread: 1 Guest(s)