SA-MP Forums Archive
[DUDA/AYUDA]Con FilterScript - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [DUDA/AYUDA]Con FilterScript (/showthread.php?tid=487533)



[DUDA/AYUDA]Con FilterScript - yesid001 - 13.01.2014

Buenas loque pasa esque tengo este filterscript que descargue:

PHP код:
/*------------------------------------------------------------------------------
 *
 *   [FS] Sistema de Recompensas
 *
 *      Por Ari3l
 *
-*----------------------------------------------------------------------------*/
#include <a_samp>
#include <zcmd>     // Por Zeex
#include <sscanf2>  // Por ******
/*----------------------------------------------------------------------------*/
new Cantidad[MAX_PLAYERS];
/*----------------------------------------------------------------------------*/
public OnFilterScriptInit()
{
    new 
dma[3],
        
hms[3];
    
getdate(dma[2], dma[1], dma[0]);
    
gettime(hms[0], hms[1], hms[2]);
    
// ---------------------------------
    
print("\n---------------------------------------------------"   );
    print(  
" [FS]Sistema de Recompensas - Encendido - Por Ari3l"   );
    print(  
"---------------------------------------------------"   );
    
printf" Fecha: %i-%i-%i Hora: %i:%i:%i",dma[0], dma[1], dma[2], hms[0], hms[1], hms[2]);
    print(  
"---------------------------------------------------\n" );
    
// ---------------------------------
    
    
new playerid;
    for(
playerid 0playerid GetMaxPlayers(); playerid++)
    {
        
Cantidad[playerid] = 0;
    }
    return 
1;
}
/*----------------------------------------------------------------------------*/
public OnFilterScriptExit()
{
    new 
dma[3],
        
hms[3];
    
getdate(dma[2], dma[1], dma[0]);
    
gettime(hms[0], hms[1], hms[2]);
    
// ---------------------------------
    
print("\n---------------------------------------------------"   );
     print(  
" [FS]Sistema de Recompensas - Encendido - Por Ari3l"   );
    print(  
"---------------------------------------------------"   );
    
printf" Fecha: %i-%i-%i Hora: %i:%i:%i",dma[0], dma[1], dma[2], hms[0], hms[1], hms[2]);
    print(  
"---------------------------------------------------\n" );
    
// ---------------------------------
    
return 1;
}
/*----------------------------------------------------------------------------*/
public OnPlayerDeath(playeridkilleridreason)
{
    if(
killerid != INVALID_PLAYER_ID)
    {
        if(
Cantidad[playerid] > && killerid != playerid)
        {
            new 
string[128];
            
// ---------------------------------
            
format(stringsizeof(string), "[RECOMPENSA] %s ah Recibido la recompensa de $%i por Matar ah %s"pNombre(killerid), Cantidad[playerid], pNombre(playerid));
            
SendClientMessageToAll( -string);
            
GivePlayerMoney(killeridCantidad[playerid]);
            
Cantidad[playerid] = 0;
        }
        else
        {
            return 
0;
        }
    }
    return 
1;
}
/*----------------------------------------------------------------------------*/
CMD:recompensa(playeridparams[])
{
    new 
ID,
        
Recompensa;
    
// ----------------------------
    
if( unformatparams"ii"IDRecompensa))
    {
        
SendClientMessageplayerid, -1"Uso: /recompensa [playerid] [recompensa]");
        
SendClientMessageplayerid, -1"Info: Pon recompensa por la cabeza de otro player.");
        return 
1;
    }
    else
    {
    if (
ID || ID GetMaxPlayers())
    {
        
SendClientMessageplayerid, -1"ERROR: ID invalida");
        return 
1;
    }
    if (!
IsPlayerConnected(ID))
    {
        
SendClientMessageplayerid, -1"ERROR: PlayerID no conectado");
        return 
1;
    }
    if(
Recompensa <= || Recompensa GetPlayerMoney(playerid))
    {
        
SendClientMessageplayerid, -1"ERROR: Recompensa Invalida");
        return 
1;
    }
    new 
string[128];
    
// ----------------------------
    
Cantidad[ID] += Recompensa;
    
GivePlayerMoney(playerid, -Recompensa);
    
// ----------------------------
    
format(string,sizeof(string),"[RECOMPENSA] - %s ah Puesto $%i de Recompensa  por la Cabeza de %s. [Total: $%i]"pNombre(playerid), RecompensapNombre(ID), Cantidad[ID]);
    
SendClientMessageToAll( -1string);
    }
    return 
1;
}
// ---------------------------------
CMD:recompensas(playeridparams[])
{
    new 
string[256], icount;
    for (
0GetMaxPlayers(); i++)
    {
        if (
IsPlayerConnected(i))
        {
            if (
Cantidad[i] > 0count ++;
            {
                if (
count >= 1)
                {
                    
formatstringsizeof(string),"- %s - Total [$%i]\n"pNombre(i), Cantidad[i]);
                    
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"Recompensas",string"Aceptar","");
                }
                else
                {
                    
SendClientMessage(playerid, -1"No hay Recompensas.");
                }
            }
        }
    }
    return 
1;
}
    
/*----------------------------------------------------------------------------*/
stock pNombre(playerid)
{
    new 
Nombre[MAX_PLAYER_NAME];
    
GetPlayerName(playeridNombresizeof(Nombre));
    return 
Nombre;
}
/*----------------------------------------------------------------------------*/ 
Y El Problema esque al entrar al juego y usar los comandos, me sale que el comando no existe... :C

Ya intente, pasandolos a otro procesador de comandos, y no, tampoco... ayuda que le pasa ?

Porfavor lo necesito Urgente Osino me podrian pasar alguno que sirva?

Please Es Urgente!

Gracias De AnteMano.


Respuesta: [DUDA/AYUDA]Con FilterScript - OTACON - 13.01.2014

es que los comandos tienen un espacio cuando terminan el texto del comando.


Respuesta: [DUDA/AYUDA]Con FilterScript - yesid001 - 13.01.2014

Quote:
Originally Posted by OTACON
Посмотреть сообщение
es que los comandos tienen un espacio cuando terminan el texto del comando.
Como Asi ? Me Podrias Explicar? PLEASE


Respuesta: [DUDA/AYUDA]Con FilterScript - OTACON - 13.01.2014

CMD:recompensa (playerid, params[])

ves el espacion que haci en tre la ultima letra y el parentesis?.. los espacion se cuantan como caracteres osea deberias borralo o poner le comando con los espacios esos

al escribir recompensa como comando te dira que no existe ya ke faltanc caracteres que serian lso espacios.

saludos.


Respuesta: [DUDA/AYUDA]Con FilterScript - yesid001 - 13.01.2014

Quote:
Originally Posted by OTACON
Посмотреть сообщение
CMD:recompensa (playerid, params[])

ves el espacion que haci en tre la ultima letra y el parentesis?.. los espacion se cuantan como caracteres osea deberias borralo o poner le comando con los espacios esos

al escribir recompensa como comando te dira que no existe ya ke faltanc caracteres que serian lso espacios.

saludos.
No Amigo, Ya Borre Los Espacios, Y Probe Y No Funciona Aъn, Igual me Dice Que El Comando No Existe... :C

Sera Que Falta Algo ?

Ayudame Telo Ruego...! Necesito Ese Sistema Urgente :C

Desde Ya Gracias!


Respuesta: [DUDA/AYUDA]Con FilterScript - Swedky - 13.01.2014

Tenнas sscanf al pedo .

pawn Код:
/*------------------------------------------------------------------------------
 *
 *   [FS] Sistema de Recompensas
 *
 *      Por Ari3l
 *
-*----------------------------------------------------------------------------*/


#include <a_samp>
#include <zcmd>     // Por Zeex
#include <sscanf2>  // Por ******

/*----------------------------------------------------------------------------*/

new Cantidad[MAX_PLAYERS];

/*----------------------------------------------------------------------------*/

public OnFilterScriptInit()
{
    new dma[3], hms[3];
    getdate(dma[2], dma[1], dma[0]);
    gettime(hms[0], hms[1], hms[2]);
   
    print("\n---------------------------------------------------"   );
    print(  " [FS]Sistema de Recompensas - Encendido - Por Ari3l"   );
    print(  "---------------------------------------------------"   );
    printf( " Fecha: %i-%i-%i Hora: %i:%i:%i", dma[0], dma[1], dma[2], hms[0], hms[1], hms[2]);
    print(  "---------------------------------------------------\n" );

    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        Cantidad[i] = 0;
    }
    return 1;
}

/*----------------------------------------------------------------------------*/

public OnFilterScriptExit()
{
    new dma[3], hms[3];
    getdate(dma[2], dma[1], dma[0]);
    gettime(hms[0], hms[1], hms[2]);
   
    print("\n---------------------------------------------------"   );
    print(  " [FS]Sistema de Recompensas - Apagado - Por Ari3l"   );
    print(  "---------------------------------------------------"   );
    printf( " Fecha: %i-%i-%i Hora: %i:%i:%i",dma[0], dma[1], dma[2], hms[0], hms[1], hms[2]);
    print(  "---------------------------------------------------\n" );
    return 1;
}

/*----------------------------------------------------------------------------*/

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        if(Cantidad[playerid] > 0 && killerid != playerid)
        {
            new string[128];
            format(string, sizeof(string), "[RECOMPENSA] %s ah Recibido la recompensa de $%i por Matar ah %s", pNombre(killerid), Cantidad[playerid], pNombre(playerid));
            SendClientMessageToAll( -1 , string);
            GivePlayerMoney(killerid, Cantidad[playerid]);
            Cantidad[playerid] = 0;
        }
    }
    return 1;
}

/*----------------------------------------------------------------------------*/

CMD:recompensa(playerid, params[])
{
    if(sscanf(params, "di", params[0], params[1]))
    {
        SendClientMessage( playerid, -1, "Uso: /recompensa [playerid] [recompensa]");
        SendClientMessage( playerid, -1, "Info: Pon recompensa por la cabeza de otro player.");
    }
    else if(!IsPlayerConnected(params[0])) SendClientMessage(playerid, -1, "ERROR: PlayerID no conectado");
    else if(params[0] <= 0 || params[0] > GetPlayerMoney(playerid)) SendClientMessage( playerid, -1, "ERROR: Recompensa Invalida");
    else
    {
        new string[128];

        Cantidad[ID] += params[0];
        GivePlayerMoney(playerid, -Recompensa);
        format(string,sizeof(string),"[RECOMPENSA] - %s ah Puesto $%i de Recompensa  por la Cabeza de %s. [Total: $%i]", pNombre(playerid), Recompensa, pNombre(ID), Cantidad[ID]);
        SendClientMessageToAll( -1, string);
    }
    return 1;
}

// ---------------------------------

CMD:recompensas(playerid, params[])
{
    new string[256], count;
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            if(Cantidad[i] > 0)
            {
                count ++;
                if(count >= 1)
                {
                    format( string, sizeof(string),"- %s - Total [$%i]\n", pNombre(i), Cantidad[i]);
                    ShowPlayerDialog(playerid, 4526, DIALOG_STYLE_MSGBOX, "Recompensas", string, "Aceptar","");
                }
                else
                {
                    SendClientMessage(playerid, -1, "No hay Recompensas.");
                }
            }
        }
    }
    return 1;
}

/*----------------------------------------------------------------------------*/

stock pNombre(playerid)
{
    new Nombre[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nombre, sizeof(Nombre));
    return Nombre;
}



Respuesta: [DUDA/AYUDA]Con FilterScript - yesid001 - 13.01.2014

Quote:
Originally Posted by EnzoMetlc
Посмотреть сообщение
Tenнas sscanf al pedo .

pawn Код:
/*------------------------------------------------------------------------------
 *
 *   [FS] Sistema de Recompensas
 *
 *      Por Ari3l
 *
-*----------------------------------------------------------------------------*/


#include <a_samp>
#include <zcmd>     // Por Zeex
#include <sscanf2>  // Por ******

/*----------------------------------------------------------------------------*/

new Cantidad[MAX_PLAYERS];

/*----------------------------------------------------------------------------*/

public OnFilterScriptInit()
{
    new dma[3], hms[3];
    getdate(dma[2], dma[1], dma[0]);
    gettime(hms[0], hms[1], hms[2]);
   
    print("\n---------------------------------------------------"   );
    print(  " [FS]Sistema de Recompensas - Encendido - Por Ari3l"   );
    print(  "---------------------------------------------------"   );
    printf( " Fecha: %i-%i-%i Hora: %i:%i:%i", dma[0], dma[1], dma[2], hms[0], hms[1], hms[2]);
    print(  "---------------------------------------------------\n" );

    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        Cantidad[i] = 0;
    }
    return 1;
}

/*----------------------------------------------------------------------------*/

public OnFilterScriptExit()
{
    new dma[3], hms[3];
    getdate(dma[2], dma[1], dma[0]);
    gettime(hms[0], hms[1], hms[2]);
   
    print("\n---------------------------------------------------"   );
    print(  " [FS]Sistema de Recompensas - Apagado - Por Ari3l"   );
    print(  "---------------------------------------------------"   );
    printf( " Fecha: %i-%i-%i Hora: %i:%i:%i",dma[0], dma[1], dma[2], hms[0], hms[1], hms[2]);
    print(  "---------------------------------------------------\n" );
    return 1;
}

/*----------------------------------------------------------------------------*/

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        if(Cantidad[playerid] > 0 && killerid != playerid)
        {
            new string[128];
            format(string, sizeof(string), "[RECOMPENSA] %s ah Recibido la recompensa de $%i por Matar ah %s", pNombre(killerid), Cantidad[playerid], pNombre(playerid));
            SendClientMessageToAll( -1 , string);
            GivePlayerMoney(killerid, Cantidad[playerid]);
            Cantidad[playerid] = 0;
        }
    }
    return 1;
}

/*----------------------------------------------------------------------------*/

CMD:recompensa(playerid, params[])
{
    if(sscanf(params, "di", params[0], params[1]))
    {
        SendClientMessage( playerid, -1, "Uso: /recompensa [playerid] [recompensa]");
        SendClientMessage( playerid, -1, "Info: Pon recompensa por la cabeza de otro player.");
    }
    else if(!IsPlayerConnected(params[0])) SendClientMessage(playerid, -1, "ERROR: PlayerID no conectado");
    else if(params[0] <= 0 || params[0] > GetPlayerMoney(playerid)) SendClientMessage( playerid, -1, "ERROR: Recompensa Invalida");
    else
    {
        new string[128];

        Cantidad[ID] += params[0];
        GivePlayerMoney(playerid, -Recompensa);
        format(string,sizeof(string),"[RECOMPENSA] - %s ah Puesto $%i de Recompensa  por la Cabeza de %s. [Total: $%i]", pNombre(playerid), Recompensa, pNombre(ID), Cantidad[ID]);
        SendClientMessageToAll( -1, string);
    }
    return 1;
}

// ---------------------------------

CMD:recompensas(playerid, params[])
{
    new string[256], count;
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            if(Cantidad[i] > 0)
            {
                count ++;
                if(count >= 1)
                {
                    format( string, sizeof(string),"- %s - Total [$%i]\n", pNombre(i), Cantidad[i]);
                    ShowPlayerDialog(playerid, 4526, DIALOG_STYLE_MSGBOX, "Recompensas", string, "Aceptar","");
                }
                else
                {
                    SendClientMessage(playerid, -1, "No hay Recompensas.");
                }
            }
        }
    }
    return 1;
}

/*----------------------------------------------------------------------------*/

stock pNombre(playerid)
{
    new Nombre[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nombre, sizeof(Nombre));
    return Nombre;
}

Ayudeneme!! Please Me Voy A Bolver Loco, Si No Encuentro La Solucion O El Ssitema

No Sirvio, Ya Use Elque Editaste Y No Sirvio... Pasa Lo Mismo, Dice Que El Comando No Existe... AYUDA Selos RUEGO

Selos Ruego, AYUDA


Respuesta: [DUDA/AYUDA]Con FilterScript - Swedky - 14.01.2014

Se los ruego *.

Al menos incluyes el plugin sscanf al iniciar la consola?



Respuesta: [DUDA/AYUDA]Con FilterScript - OTACON - 14.01.2014

estas poniendo el FilterScript en el archivo server.cfg ? o_O


Respuesta: [DUDA/AYUDA]Con FilterScript - yesid001 - 14.01.2014

Quote:
Originally Posted by EnzoMetlc
Посмотреть сообщение
Se los ruego *.

Al menos incluyes el plugin sscanf al iniciar la consola?
Exelente! Era Eso :3 Ya Tenia Pero El sscanf2 xDDDDDDDDDDDDDDDDDDDD

EDIT: Pero el sistema esta bgu NOOO :CCCCC, pongo el comando, me sale el uso y me dice que escoja otra cabeza, pongo alguna id, y l recompensa y sale lo mismo, lo pngo de cualquier manera y sale es el uso :C

ayuda, me podrian pasar alguno que sirva? gracias desde ya.