[Ajuda] Bug's -
Vitor_Marfioso - 06.01.2012
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 ?
Re: [Duvida] Bug's -
felipe_mr - 06.01.2012
tenta assim:
PHP код:
//----------------------------------[cnn]-----------------------------------------------
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)
{
MSGPLAYER(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))
{
MSGPLAYER(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 && admhide[playerid] == 1)
{
format(string, sizeof(string), "~b~felipe_mr: ~w~%s",result);
}
else
{
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
{
MSGPLAYER(playerid, COLOR_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(cmdtext, idx);
new txtid;
if(!strlen(tmp))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /cnnn <Digite> ");
return 1;
}
txtid = strval(tmp);
if(txtid == 2)
{
MSGPLAYER(playerid, COLOR_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(playerid, COLOR_GRAD2, "USE: /cnnn <Digite> [cnnc formato ~n~=NovaLinha ~r~=Vermelho ~g~=Verde ~b~=Azul ~w~=Branco ~y~=Amarelo ~l~=Preto]");
return 1;
}
format(string, sizeof(string), "~w~%s",result);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
GameTextForPlayer(i, string, 5000, txtid);
}
}
return 1;
}
else
{
MSGPLAYER(playerid, COLOR_GRAD1, " Vocк nгo esta autorizado a usar este comando!");
return 1;
}
}
return 1;
}
Re: [Duvida] Bug's -
Vitor_Marfioso - 06.01.2012
Felipe jб te adicionei no Msn entra lб.
Re: [Duvida] Bug's -
Ricop522 - 06.01.2012
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;
}