[Ajuda] strcmp para zcmd
#1

Eae galerinha bem hj eu estava alterando um comando de strcmp para zcmd.. mais ocorreu uns erros...

PHP код:
CMD:f(playerid)
    {
        if(
C[2] == || cmdtext[2] == 32)
        {
            if(
cmdtext[2] != 32 || (cmdtext[3] == && cmdtext[2] == 32))   return SendClientMessage(playeridCOLOR_BRANCO"Digite: /f [texto]");
            new 
Float:Coord[3];
            new 
NickName[25];
            
GetPlayerPos(playeridCoord[0], Coord[1], Coord[2]);
            
GetPlayerName(playeridNickName25);
            
format(cmdtext128"{CD00CD}%s fala: %s"NickNamecmdtext[3]);
            for(new 
0GetMaxPlayers(); != yx++)
            {
                if(!
IsPlayerInRangeOfPoint(x10.0Coord[0], Coord[1], Coord[2])) continue;
                
SendClientMessage(x0xFFFFFFAAcmdtext);
            }
            return 
1;
        }
    } 
Os erros ocorrem nas linhas que tem escrito cmdtext, a duvida й seguinte pelo o que devo substituir o cmdtext ?
Reply
#2

pawn Код:
CMD:f(playerid)
{
    new Float:Coord[3];
    new NickName[25];
    if(C[2] == 0 || strcmp[2] == 32)
    {
        if(strcmp[2] != 32 || (strcmp[3] == 0 && strcmp[2] == 32))   return SendClientMessage(playerid, COLOR_BRANCO, "Digite: /f [texto]");
        GetPlayerPos(playerid, Coord[0], Coord[1], Coord[2]);
        GetPlayerName(playerid, NickName, 25);
        format(strcmp, 128, "{CD00CD}%s fala: %s", NickName, strcmp[3]);
    }
    for(new x = 0, y = GetMaxPlayers(); x != y; x++)
    {
        if(!IsPlayerInRangeOfPoint(x, 10.0, Coord[0], Coord[1], Coord[2])) continue;
        SendClientMessage(x, 0xFFFFFFAA, strcmp);
    }
    return 1;
}
Tente!, substituir por strcmp.
Reply
#3

PHP код:
BTV.pwn(675) : error 017undefined symbol "C"
BTV.pwn(675) : warning 215expression has no effect
BTV
.pwn(675) : error 001expected token";"but found "]"
BTV.pwn(675) : error 029invalid expressionassumed zero
BTV
.pwn(675) : fatal error 107too many error messages on one line 
Linha 675 >> linha if(C[2] == 0 || strcmp[2] == 32)
Reply
#4

Esse C, й uma variбvel e, em comandos, vc a defini, vc neste caso, estб verificando. if, quer dizer condiзгo.

Exemplo:

pawn Код:
//topo do gm
new ex[500];

//no cmd
ex[playerid] = 1

//para verificar
if(ex[playerid] == 1)
Reply
#5

Arrumei o comando para vocк :


pawn Код:
CMD:f(playerid, params[])
{
    if(isnull(params))   return SendClientMessage(playerid, 0xFFFFFFAA, "Digite: /f [texto]");
    new Float:Coord[3];
    new NickName[25];
    GetPlayerPos(playerid, Coord[0], Coord[1], Coord[2]);
    GetPlayerName(playerid, NickName, 25);
    format(params, 128, "{CD00CD}%s fala: %s", NickName, params);
    for(new x = 0, y = GetMaxPlayers(); x != y; x++)
    {
        if(!IsPlayerInRangeOfPoint(x, 10.0, Coord[0], Coord[1], Coord[2])) continue;
        SendClientMessage(x, 0xFFFFFFAA, params);
    }
    return 1;
}


Espero ter ajudado .
Reply
#6

@EDIT

Ken jб lhe respondeu acima.
Reply
#7

obs use o do RJJJ eu mesmo testei aki em meu gm e funciono pode usar perfeito sem erros!
Reply
#8

Obrigado a todos que se interessarem em ajudar @Closed
Reply
#9

Use sscanf2.
pawn Код:
CMD:f(playerid,params[])
{
    static texto[128],nome[25],Float:cord[3],string[128];
    if(sscanf(params,"s[128]",texto)) return SendClientMessage(playerid,-1,"/a [texto]  ");
    GetPlayerPos(playerid, cord[0],cord[1],cord[2]);
    GetPlayerName(playerid, nome, 25);
    format(string, 128,"{CD00CD}%s fala: %s", nome,texto);
    for(for new i = 0; i != MAX_PLAYERS;++i) {
        if(!IsPlayerInRangeOfPoint(x, 10.0,cord[0],cord[1],cord[2])) continue;
        SendClientMessage(x, 0xFFFFFFAA, string);
    }
    return 1;
}
@ixi pqp fui lento pakas, tive que esperar 120 segundos q.q
Reply
#10

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
Use sscanf2.
pawn Код:
CMD:f(playerid,params[])
{
    static texto[128],nome[25],Float:cord[3],string[128];
    if(sscanf(params,"s[128]",texto)) return SendClientMessage(playerid,-1,"/a [texto]  ");
    GetPlayerPos(playerid, cord[0],cord[1],cord[2]);
    GetPlayerName(playerid, nome, 25);
    format(string, 128,"{CD00CD}%s fala: %s", nome,texto);
    for(for new i = 0; i != MAX_PLAYERS;++i) {
        if(!IsPlayerInRangeOfPoint(x, 10.0,cord[0],cord[1],cord[2])) continue;
        SendClientMessage(x, 0xFFFFFFAA, string);
    }
    return 1;
}
Nгo й necessбrio sscanf ai
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)