[Ajuda] Bug's
#1

Bom o meu comando /cnn estб bugado, e eu nгo consegui o desbugar entгo podem me ajudar a desbuga-lo?
ta ai meu comando /cnn
pawn Код:
if(strcmp(cmd, "/cnn", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1340 && PlayerInfo[playerid][pAdmin] != 1341 && PlayerInfo[playerid][pAdmin] != 1342)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб Trabalhando. (/jogar)");
                    return 1;
                }
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[64];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if(!strlen(result))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USE: /cnn [cnn formato ~n~=NovaLinha ~r~=Vermelho ~g~=Verde ~b~=Azul ~w~=Branco ~y~=Amarelo ~l~=Preto]");
                    return 1;
                }
                if(admtrampando[playerid] == 1)
                {
                    format(string, sizeof(string), "~b~%s: ~w~%s",sendername,result);
                }
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        GameTextForPlayer(i, string, 5000, 3);
                    }
                }
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo estб autorizado a usar este comando.");
                return 1;
            }
        }
        return 1;
    }
E outra coisa, quando uma pessoa compra um carro da casa ele jб aparece na casa na quele instante, eu queria que ele aparece-se no proximo GMX entгo podem me ajudar tambйm ?
Reply
#2

tenta assim:
PHP код:
//----------------------------------[cnn]-----------------------------------------------
    
if(strcmp(cmd"/cnn"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if (
PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(
admtrampando[playerid] < && PlayerInfo[playerid][pAdmin] != 1340 && PlayerInfo[playerid][pAdmin] != 1341)
                {
                    
MSGPLAYER(playeridCOLOR_GRAD1"Vocк nгo estб trabalhando! (/jogar)");
                    return 
1;
                }
                
GetPlayerName(playeridsendernamesizeof(sendername));
                new 
length strlen(cmdtext);
                while ((
idx length) && (cmdtext[idx] <= ' '))
                {
                    
idx++;
                }
                new 
offset idx;
                new 
result[64];
                while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                {
                    
result[idx offset] = cmdtext[idx];
                    
idx++;
                }
                
result[idx offset] = EOS;
                if(!
strlen(result))
                {
                    
MSGPLAYER(playeridCOLOR_GRAD2"USE: /cnn [cnn formato ~n~=NovaLinha ~r~=Vermelho ~g~=Verde ~b~=Azul ~w~=Branco ~y~=Amarelo ~l~=Preto]");
                    return 
1;
                }
                if(
admtrampando[playerid] == && admhide[playerid] == 1)
                {
                    
format(stringsizeof(string), "~b~felipe_mr: ~w~%s",result);
                }
                else
                {
                    
format(stringsizeof(string), "~b~%s: ~w~%s",sendername,result);
                }
                for(new 
0MAX_PLAYERSi++)
                {
                    if(
IsPlayerConnected(i))
                    {
                        
GameTextForPlayer(istring50003);
                    }
                }
                return 
1;
            }
            else
            {
                
MSGPLAYER(playeridCOLOR_GRAD1"   Vocк nгo estб autorizado a usar este comando!");
                return 
1;
            }
        }
        return 
1;
    }
    if(
strcmp(cmd"/cnnn"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if (
PlayerInfo[playerid][pAdmin] >= 1337)
            {
                
tmp strtok(cmdtextidx);
                new 
txtid;
                if(!
strlen(tmp))
                {
                    
MSGPLAYER(playeridCOLOR_GRAD2"USE: /cnnn <Digite> ");
                    return 
1;
                }
                
txtid strval(tmp);
                if(
txtid == 2)
                {
                    
MSGPLAYER(playeridCOLOR_GRAD2"Nгo existe 2! sу 0,1,3,4!");
                    return 
1;
                }
                new 
length strlen(cmdtext);
                while ((
idx length) && (cmdtext[idx] <= ' '))
                {
                    
idx++;
                }
                new 
offset idx;
                new 
result[64];
                while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                {
                    
result[idx offset] = cmdtext[idx];
                    
idx++;
                }
                
result[idx offset] = EOS;
                if(!
strlen(result))
                {
                    
MSGPLAYER(playeridCOLOR_GRAD2"USE: /cnnn <Digite> [cnnc formato ~n~=NovaLinha ~r~=Vermelho ~g~=Verde ~b~=Azul ~w~=Branco ~y~=Amarelo ~l~=Preto]");
                    return 
1;
                }
                
format(stringsizeof(string), "~w~%s",result);
                for(new 
0MAX_PLAYERSi++)
                {
                    if(
IsPlayerConnected(i) == 1)
                    {
                        
GameTextForPlayer(istring5000txtid);
                    }
                }
                return 
1;
            }
            else
            {
                
MSGPLAYER(playeridCOLOR_GRAD1"   Vocк nгo esta autorizado a usar este comando!");
                return 
1;
            }
        }
        return 
1;
    } 
Reply
#3

Felipe jб te adicionei no Msn entra lб.
Reply
#4

pawn Код:
if(!strcmp(cmdtext, "/cnn", true, 4))
    {
        if(!cmdtext[4])return SendClientMessage(playerid, -1, "USAGE: /cnn [action]");
        if(!IsPlayerConnected(playerid)) return 1;
        if (!PlayerInfo[playerid][pAdmin]) return 1;
        if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1340 && PlayerInfo[playerid][pAdmin] != 1341 && PlayerInfo[playerid][pAdmin] != 1342)
            return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб Trabalhando. (/jogar)");
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "~b~%s: ~w~%s",sendername,cmdtext[5]);
        GameTextForAll(string, 5000, 3);
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)