[Ajuda] Por pra funcionar o motivo!!
#1

Alguem pode me ajudar porfavor, sou novato em pawno e estou com bastante dificuldades com isso, estou a horas tentando fazer isso kkkk, eu queria por o "motivo" para funcionar tipo /darprocurado 0 desacato pro player poder escrever o motivo sacou?

Код:
if(strcmp(cmd,"/darprocurado", true)==0)
{
    new aname[MAX_PLAYER_NAME];
    if(pAdmin[playerid] == 4 || pAdmin[playerid] == 5)
    {
        new tmp[256], plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, Vermelho, "Digite: /Darprocurado [id] [motivo]");

        plid = strval(tmp);
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(plid, pname, MAX_PLAYER_NAME);
        if(IsPlayerConnected(plid))
        {
            dini_IntSet(file2, "procurado", 1);
            SetPlayerWantedLevel(playerid, 1);
            GetPlayerName(plid, pname, MAX_PLAYER_NAME);
            
            format(string, sizeof(string), "%s Deu 1 estrela de procurado para %s motivo: %s)", pname, aname);
            SendClientMessageToAll(LARANJA, string);
        }
        else
        {
            format(string, sizeof(string), "ID %d nгo й vбlido!", plid);
            SendClientMessage(playerid, Vermelho, string);
        }
    }
    return 1;
}
Quem poder ajudar eu agradeзo!
Reply
#2

Primeiro Baixe ZCMD ou YCMD segundo estude ZCMD && SSCANF2 ou YCMD && SSCANF2 dps crie.

STRCMP nгo й um processador de comandos e sim um comparador de strings.
Reply
#3

Produzi o comando pra vocк. Adicione essa funзгo, caso nгo tenha a include <zcmd> e <sscanf>, baixe-as. (Ajudei? +REP)
PHP код:
CMD:darprocurado(playeridparams[])
{
    new 
idmotivo[120], str[199], procurado[MAX_PLAYER_NAME];
    if(
sscanf(params"us"idmotivo))
        return 
SendClientMessage(playerid, -1"Uso correto: /procurado [id] [motivo]");
    
GetPlayerName(idprocuradosizeof(procurado));
    if(!
IsPlayerConnected(id)) return SendClientMessage(playerid, -1"[FX] - Este jogador nгo estб online.");
    
format(strsizeof(str), "[FX] - O Player %s estб sendo procurado pelo motivo %s"procuradomotivo);
    
SendClientMessageToAll(-1str);
    
SetPlayerWantedLevel(id1);
    return 
1;

Reply
#4

O problema й que minha gm й strcmp
Reply
#5

Quote:
Originally Posted by RianRBS
Посмотреть сообщение
O problema й que minha gm й strcmp
Vai convertendo aos poucos, nгo sou apto a mexer em strcmp.
Reply
#6

Nгo compilei e nгo optimizei o comando. Sу botei pra funcionar

Код:
if(strcmp(cmd,"/darprocurado", true)==0)
{
    if(pAdmin[playerid] == 4 || pAdmin[playerid] == 5)
    {
        new tmp[256], plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, Vermelho, "Digite: /Darprocurado [id] [motivo]");
        plid = strval(tmp);

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, Vermelho, "Digite: /Darprocurado [id] [motivo]");
        

        new pname[MAX_PLAYER_NAME];
        GetPlayerName(plid, pname, MAX_PLAYER_NAME);
        if(IsPlayerConnected(plid))
        {
            dini_IntSet(file2, "procurado", 1);
            SetPlayerWantedLevel(playerid, 1);
            GetPlayerName(plid, pname, MAX_PLAYER_NAME);
            
            format(string, sizeof(string), "%s Deu 1 estrela de procurado para %s motivo: %s)", pname, tmp);
            SendClientMessageToAll(LARANJA, string);
        }
        else
        {
            format(string, sizeof(string), "ID %d nгo й vбlido!", plid);
            SendClientMessage(playerid, Vermelho, string);
        }
    }
    return 1;
}
Reply
#7

Obrigado Kamper! e fxckshzt por tentar.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)