[Ajuda] Erro denovo
#1

BOM GALERA QUERIA SABER PORQUE OS ERROS TOU CRIANDO UMA FS COM VARIAS FUNЗХES DESCULPE-ME POR CRIAR MAIS UM TУPICO POR CAUSA DE ERROS MAIS SOU NOVATO 1000 DESCULPAS :/

pawn Код:
/* Eae pessoal tudo blz??
bom essa filterscript foi criada por franklin_qaeda :D espero que a FS  te ajude em algumas coisas
acompanhe as atualizaзхes na SA-MP FORЪM :D
v0.1
*/


//VARIAVEIS FILTERSCRIPT
#include <a_samp>
#include sscanf2
#include dof2
#include zcmd
// FIM VARIAVEIS
// STRINGS
new Cachorro[ ] [] =
{
   "[BpL] Franklin",
   "[BpL] FILTERSCRIPT"
   };
// COMEЗANDO A FILTERSCRIPT
public OnFilterScriptInit()
 {
    print("-FILTER SCRIPT CRIADA POR FRANKLIN- INICIADA");
    return 1;
}
public OnFilterScriptExit()
 {
    print("-FILTERSCRIPT CRIADA POR FRANKLIN- UNLOADED");
    return 1;
}
public OnPlayerConnect(playerid)
{
    new string[128];
    new Nome[24];
    GetPlayerName(playerid, Nome, 24);
    new Dia,Mes,Ano,Hora,Minuto,Segundo;
    format(string, sizeof(string),"Jogador: %s Entrou no servidor. Data:[%d/%d/%d/] Hora:[%d/%d/%d]",Nome, Dia,Mes,Ano,  Hora,  Minuto,Segundo);
    SendClientMessageToAll(0xFFB400FF, string);
    return 1;
}
// quando o player desconecta do servidor :)
public OnPlayerDisconnect(playerid, reason)
{
    SendClientMessageToAll(0xFFB400FF, "Alguem desconectou");
    return 1;
   
}
// comeзando a area de comandos
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/salario", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid,0xFFB400FF, "[BpL] Todos player onlines receberam salбrio do mes ");
        GivePlayerMoney(playerid, 5000);
        new rand = random(sizeof(Cachorro));
        new string[128];
        format(string, sizeof(string),"[BpL] Todos player onlines receberam salбrio do mes ", Cachorro[rand]);
        SendClientMessage(playerid, 0xFFB400FF,string);
        return 1;
    }
    return 0;
 }
CMD:resetmoney(playerid,params[]) {
       ResetPlayerMoney(playerid);
       new id=strval(params);
       if(!strlen(params) || !IsNumeric(params)) {
       SendClientMessage(playerid,0xFFB400FF,"|INFO| /resetmoney [playerid]");
    }
       else if(!IsPlayerConnected(id))
    {
        return SendClientMessage(playerid,0xFFB400FF,"Esse player nгo й um ativo");
    }
    else if(IsPlayerConnected(id)){

        printf("ID: %d",id);
    }
    return 0;
}
ERRORS
Код:
C:\Users\Tecnoplay\Desktop\GAMEMODES\Brasil Play Legends D - Cуpia\filterscripts\gmedo.pwn(65) : error 017: undefined symbol "IsNumeric"
C:\Users\Tecnoplay\Desktop\GAMEMODES\Brasil Play Legends D - Cуpia\filterscripts\gmedo.pwn(72) : warning 217: loose indentation
C:\Users\Tecnoplay\Desktop\GAMEMODES\Brasil Play Legends D - Cуpia\filterscripts\gmedo.pwn(76) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

pawn Код:
IsNumeric(const string[])
{
        for (new i = 0, j = strlen(string); i < j; i++)
        {
                if (string[i] > '9' || string[i] < '0') return 0;
        }
        return 1;
}
By: Sacky
Reply
#3

Multi eu mudei o IsNumeric e continua dando erro
Reply
#4

Vocк tem que colocar no mesmo script, que estб estes comandos, e uma coisa nгo vai dar certo usar o processador de comandos junto de um comando que nгo utiliza o processador de comandos.

Se vocк perceber o erro se da pela falta da funзгo IsNumeric.
Reply
#5

pawn Код:
/* Eae pessoal tudo blz??
bom essa filterscript foi criada por franklin_qaeda :D espero que a FS  te ajude em algumas coisas
acompanhe as atualizaзхes na SA-MP FORЪM :D
v0.1
*/


//Includes FILTERSCRIPT
#include <a_samp>
#include sscanf2
#include dof2
#include zcmd

/*new Cachorro[ ] [] =
{
   "[BpL] Franklin",
   "[BpL] FILTERSCRIPT"
};*/


//Variбveis
new String[128];

public OnFilterScriptInit()
{
    print("-FILTER SCRIPT CRIADA POR FRANKLIN- INICIADA");
    return 1;
}
public OnFilterScriptExit()
{
    print("-FILTERSCRIPT CRIADA POR FRANKLIN- UNLOADED");
    return 1;
}
public OnPlayerConnect(playerid)
{
    new Dia,Mes,Ano,Hora,Minuto,Segundo;
    gettime(Hora, Minuto, Segundo);
    getdate(Ano, Mes, Dia);
    format(String, sizeof(String),"Jogador: %s Entrou no servidor. Data:[%d/%d/%d/] Hora:[%d/%d/%d]", Nome(playerid), Dia,Mes,Ano,  Hora,  Minuto,Segundo);
    SendClientMessageToAll(0xFFB400FF, String);
    return 1;
}
// quando o player desconecta do servidor :)
public OnPlayerDisconnect(playerid, reason)
{
    format(String, sizeof(String), "O Jogador %s saiu do servidor.", Nome(playerid));
    SendClientMessageToAll(0xFFB400FF, String);
    return 1;

}

CMD:salario(playerid, params[])
{
    for(new i = 0, j = GetMaxPlayers(); i < j; i++)
    {
        if(IsPlayerConnected(i))
        {
            GivePlayerMoney(i, 5000);
            SendClientMessage(i, 0xFFB400FF, "[BpL]: Todos os Player online receberam o salбrio do mкs.");
        }
    }
    return 1;
}
CMD:resetmoney(playerid,params[])
{
    new id;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USO: /resetmoney [Playerid]");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Jogador Invбlido!");
    ResetPlayerMoney(id);
    return 1;
}

/*IsNumeric(const Linha[])
{
    for (new i = 0, j = strlen(Linha); i < j; i++)
    {
        if (Linha[i] > '9' || Linha[i] < '0')
        return 0;
    }
    return 1;
}*/

Nome(playerid)
{
    new Nomes[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nomes, sizeof(Nomes));
    return Nomes;
}
Modifiquei tudo que achei que estava errado, mas este que eu coloquei estб tudo certo, testa ai e ver.

Retirei coisas inъteis, e coloquei coisas ъteis, e tirei o strcmp para fazer comando, e coloquei em zCMD.

Arrumei quase tudo.

0 Erros e 0 Warnings.
Reply
#6

Quote:
Originally Posted by Dolpin
Посмотреть сообщение
pawn Код:
CMD:salario(playerid, params[])
{
    for(new i = 0, j = GetMaxPlayers(); i < j; i++)
    {
        if(IsPlayerConnected(i))
        {
            GivePlayerMoney(i, 5000);
            SendClientMessageToAll(0xFFB400FF, "[BpL]: Todos os Player online receberam o salбrio do mкs.");
        }
    }
    return 1;
}
A funзгo SendClientMessageToAll tem que estar fora da loop, pois vai enviar vбrias mensagens.
pawn Код:
for(new i = 0, j = GetMaxPlayers(); i < j; i++)
{
    if(IsPlayerConnected(i))
    {
        GivePlayerMoney(i, 5000);
    }
}
SendClientMessageToAll(0xFFB400FF, "[BpL]: Todos os Player online receberam o salбrio do mкs.");
Reply
#7

Obrigado tudo certo aqui mais tipo pra criar o comando й a mesma coisa que o strcmd CMD:resetmoney(playerid,params[]) nгi vai mudar algo tipo no
new string[128] й um exemplo muda algo do cmd do strcmd ??
Reply
#8

Quote:
Originally Posted by paulotuto
Посмотреть сообщение
Obrigado tudo certo aqui mais tipo pra criar o comando й a mesma coisa que o strcmd CMD:resetmoney(playerid,params[]) nгi vai mudar algo tipo no
new string[128] й um exemplo muda algo do cmd do strcmd ??
A Diferenзa й que strcmp й um comparador de strings, e o zCMD й um processador de comandos.

zCMD sу tem vantagem contra a strcmp.


#Multi Valeu por me corrigir, realmente errei.
Reply
#9

Eu coloquei oque o Multi falo nгo foi mudei a sendclientmessagetoall mais ta dando warning como eu posso fazer pra ele recer o dinheiro por taxa de horas onlines no servidor tipo 1 hr = 10 reais entendeu??

Bom obrigado
Reply
#10

Quote:
Originally Posted by paulotuto
Посмотреть сообщение
Eu coloquei oque o Multi falo nгo foi mudei a sendclientmessagetoall mais ta dando warning como eu posso fazer pra ele recer o dinheiro por taxa de horas onlines no servidor tipo 1 hr = 10 reais entendeu??

Bom obrigado
Mostre-me o que dб o warning.

Bom corrigindo
pawn Код:
CMD:salario(playerid, params[])
{
    for(new i = 0, j = GetMaxPlayers(); i < j; i++)
    {
        if(IsPlayerConnected(i))
        {
            GivePlayerMoney(i, 5000);
            SendClientMessage(i, 0xFFB400FF, "[BpL]: Todos os Player online receberam o salбrio do mкs.");
        }
    }
    return 1;
}

Ai vocк tem que pesquisar sobre gettime na wiki.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)