[Ajuda] [ERRO]
#1

Bom Criei um Comando com zcmd e sscanf

pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

new texto;
new nome[MAX_PLAYER_NAME];
new Str[128];
new id;

CMD:mp(playerid, params[])
{
    if(sscanf(params, "us",id,texto))
    {
        SendClientMessage(playerid,-1,"Use: /mp [id] [texto]");
    }
    else
    {
        if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este jogador nгo estб conectado");
        format(Str, sizeof(Str), "Mensagem Privada de %s: %s", nome, texto);
        SendClientMessage(id,-1,Str);
    }
    return true;
}

Quando digito /mp, retorna "Comando Invбlido"
Reply
#2

Quote:
Originally Posted by Equipe
Посмотреть сообщение
Bom Criei um Comando com zcmd e sscanf

pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

new texto;
new nome[MAX_PLAYER_NAME];
new Str[128];
new id;

CMD:mp(playerid, params[])
{
    if(sscanf(params, "us",id,texto))
    {
        SendClientMessage(playerid,-1,"Use: /mp [id] [texto]");
    }
    else
    {
        if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este jogador nгo estб conectado");
        format(Str, sizeof(Str), "Mensagem Privada de %s: %s", nome, texto);
        SendClientMessage(id,-1,Str);
    }
    return true;
}

Quando digito /mp, retorna "Comando Invбlido"
pawn Код:
#include a_samp
#include zcmd
#include sscanf2

new
    texto[50],
    nome[MAX_PLAYER_NAME],
    new Str[128],
    new id;

CMD:mp(playerid, params[]) {

    if(sscanf(params, "us[50]",id,texto)) return SendClientMessage(playerid,-1,"Use: /mp [id] [texto]");

    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este jogador nгo estб conectado");
   
    format(Str, sizeof(Str), "Mensagem Privada de %s: %s", nome, texto);
   
    SendClientMessage(id,-1,Str);

    return true;
}
Reply
#3

pawn Код:
if(IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Este jogador nгo estб conectado");
se(o player estiver conectado) retorna "Este jogador nгo estб conectado"
Reply
#4

Bom copiei e tudo, Dai botei como FS, defini ele no server.cfg

dai vou testar ele e sempre aparece "Comando Invбlido"
Reply
#5

Adcione na filtar script:
pawn Код:
public OnFilterScriptIni()
    return print("Filter Script Ligada");
Se aparecer esta mensagem no sampserver й porque ta carregando corretamente.
Reply
#6

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!sucess) return SendClientMessage(playerid, 0xFF0000AA, "Comando invбlido.");
   
    return 0;
}
Talvez pare de aparecer Unknow Command
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)