[Ajuda] if (strcmp(tmp
#1

Olб, estou com um problema, aqui eu digito o comando /radio off buga, em vez de desligar o radio mostra assim: "** Coronel Nome: off, cвmbio." eu fiz o cуdigo abaixo, alguйm pode me ajudar com a soluзгo por favor?

PHP код:
    if (strcmp(cmd"/radio"true) == || strcmp(cmd"/r"true) == 0)
    {
        if (
AccountData[playerid][pRadio] == 1) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк nгo possui um rбdio.");
        new 
length strlen(cmdtext);
        while ((
idx length) && (cmdtext[idx] <= ' ')) idx++;
        new 
offset idxresult[64];
        while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
        {
            
result[idx offset] = cmdtext[idx];
            
idx++;
        }
        
result[idx offset] = EOS;
         if (
strcmp(tmp"on"true)) //aqui
         
{
             if (
AccountData[playerid][pRadioStats] == 0) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Seu rбdio jб estб ligado.");
             
AccountData[playerid][pRadioStats] = 0;
             if (
AccountData[playerid][pMascarause] == 1format(stringsizeof(string), "** Nгo identificбvel ligou o seu rбdio.");
             else 
format(stringsizeof(string), "** %s ligou o seu rбdio."GetPlayerNameRP(playerid));
             
ProxDetector(15.0playeridstringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
             return 
1;
         }
         if (
strcmp(tmp"off"true)) //aqui
         
{
             if (
AccountData[playerid][pRadioStats] == 1) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Seu rбdio jб estб desligado.");
             
AccountData[playerid][pRadioStats] = 1;
             if (
AccountData[playerid][pMascarause] == 1format(stringsizeof(string), "** Nгo identificбvel desligou o seu rбdio.");
             else 
format(stringsizeof(string), "** %s desligou o seu rбdio."GetPlayerNameRP(playerid));
             
ProxDetector(15.0playeridstringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
             return 
1;
         }
        if (!
strlen(result)) return 1;
        if (
AccountData[playerid][pMuted] == 1) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Vocк estб impossibilitado de executar estб aзгo.");
        if (
AccountData[playerid][pRadioStats] == 1) return SendClientMessage(playeridCOLOR_GRAD1"ERRO: Seu rбdio estб desligado.");
        if (
GetPlayerOrg(playerid) == 1)
        {
            if (
AccountData[playerid][pCargo] == 9format(stringsizeof(string), "** Coronel %s: %s, cвmbio. **"GetPlayerNameRP(playerid), result);
            else if (
AccountData[playerid][pCargo] == 8format(stringsizeof(string), "** Tenente-Coronel %s: %s, cвmbio. **"GetPlayerNameRP(playerid), result);
            else if (
AccountData[playerid][pCargo] == 7format(stringsizeof(string), "** Capitгo %s: %s, cвmbio. **"GetPlayerNameRP(playerid), result);
            else if (
AccountData[playerid][pCargo] == 6format(stringsizeof(string), "** Tenente %s: %s, cвmbio. **"GetPlayerNameRP(playerid), result);
            else if (
AccountData[playerid][pCargo] == 5format(stringsizeof(string), "** Aspirante %s: %s, cвmbio. **"GetPlayerNameRP(playerid), result);
            else if (
AccountData[playerid][pCargo] == 4format(stringsizeof(string), "** Subtenente %s: %s, cвmbio. **"GetPlayerNameRP(playerid), result);
            else if (
AccountData[playerid][pCargo] == 3format(stringsizeof(string), "** Sargento %s: %s, cвmbio. **"GetPlayerNameRP(playerid), result);
            else if (
AccountData[playerid][pCargo] == 2format(stringsizeof(string), "** Cabo %s: %s, cвmbio. **"GetPlayerNameRP(playerid), result);
            else if (
AccountData[playerid][pCargo] == 1format(stringsizeof(string), "** Soldado %s: %s, cвmbio. **"GetPlayerNameRP(playerid), result);
            else 
format(stringsizeof(string), "** Soldado %s: %s, cвmbio. **"GetPlayerNameRP(playerid), result);
            
SendRadioMessage(1TEAM_BLUE_COLORstring);
            
printf("%s"string);
            if (
AccountData[playerid][pMascarause] == 1format(stringsizeof(string), "Nгo identificбvel (Rбdio): %s"result);
            else 
format(stringsizeof(string), "%s diz (Rбdio): %s, cвmbio."GetPlayerNameRP(playerid), result);
            
ProxDetector(10.0playeridstringCOLOR_FADE1COLOR_FADE2COLOR_FADE3COLOR_FADE4COLOR_FADE5);
            return 
1;
        }
//.........

Reply


Messages In This Thread
if (strcmp(tmp - by SukMathcuck - 07.07.2015, 01:23
Re: if (strcmp(tmp - by RafaelOsio - 07.07.2015, 01:30
Re: if (strcmp(tmp - by SukMathcuck - 07.07.2015, 21:40

Forum Jump:


Users browsing this thread: 2 Guest(s)