[Ajuda] Comando que deu errado
#1

Alguem ajuda ae.. fiz um comando que qnd digito apenas ele ele funciona, qnd adiciono o necessбrio nгo..
Tem algum bug que n sei qual й..

Код:
	if(strcmp(cmdtext, "/perseguir", true) == 0)
	{
	if(PlayerInfo[ playerid ][pCorregedor] == 1 || PlayerInfo[ playerid ][pProfissao] == Policia_Civil || PlayerInfo[ playerid ][pProfissao] == Policia_Federal || PlayerInfo[ playerid ][pProfissao] == Interpol || PlayerInfo[ playerid ][pProfissao] == Delegado || PlayerInfo[ playerid ][pProfissao] == Bope
    || PlayerInfo[ playerid ][pProfissao] == Swat || PlayerInfo[ playerid ][pProfissao] == Narcoticos ||PlayerInfo[ playerid ][pProfissao] == Policia_Militar || PlayerInfo[ playerid ][pProfissao] == FBI || PlayerInfo[ playerid ][pProfissao] == Policia_Rodoviaria)
 	{
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp))
	{
	SendClientMessage(playerid, ERRO, "| ERRO | /perseguir [ id ] [motivo]");
	return 1;
	}
	new id = strval(tmp);
	new MSG[128];
	MSG = strrest(cmdtext, idx);
	if(!strlen(MSG))
	{
	SendClientMessage(playerid, ERRO, "| ERRO | /perseguir [ id ] [motivo]");
	return 1;
	}
	if(!IsPlayerConnected( id ))
	{
	SendClientMessage(playerid, ERRO, "| ERRO | Jogador nгo estб conectado!");
	return 1;
 	}
 	if(Algemado[ id ] == true)
   	{
	SendClientMessage(playerid, ERRO, "| ERRO | O Jogador Estб Algemado!");
	return 1;
 	}
    if(playerid == id)
   	{
	SendClientMessage(playerid, ERRO, "| ERRO | Vocк nгo pode perseguir vocк mesmo!");
	return 1;
	}
	if(Perseguindo[playerid] == 1)
	{
	SendClientMessage(playerid, ERRO, "| ERRO | Vocк ja estб perseguindo alguйm!");
	return 1;
 	}
	if(Perseguindo[playerid] == 0)
	{
	Perseguindo[playerid] = 1;
	Perseguido[id] = 1;
	new sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
    localizado[ playerid ] = 1;
  	new str[128],nick[24];
   	GetPlayerName(strval(tmp),nick,24);
    format(str,128,"Perseguiзгo ao alvo: %s ( %d )",nick,id);
    SendClientMessage(playerid, 0xB389B3FF, str);
	SendClientMessage(playerid, AmareloClaro, "| INFO | Jogador localizado com sucesso, siga o ponto Vermelho no mapa para chegar atй ele!");
	LocalizarID[ playerid ] = id;
	TimerLocalizar[ playerid ] = SetTimerEx("GPSUpdate", 1000, true, "ii", playerid,id);

	SendClientMessage(playerid, 0x5882FAFF, "O player perseguido nгo pode utilizar de comandos para seu benefнcio.");
	SendClientMessage(playerid, 0x5882FAFF, "| INFO | Vocк tem 3 minutos para perseguir o jogador.");
	format(string, sizeof(string), "{FF0000}| INFO | O Policial %s estб te perseguindo e vocк nгo pode usar comandos para seu benefнcio", sendername);
	SendClientMessage(id, ERRO, string);
	SetTimer("TempoPersegue", 180000, false);
	SetTimer("TempoPerseguir", 300000, false);//jhih


	format(string, sizeof(string),"{FF00FF}| Corregedoria | O Policial %s ( %d ) estб perseguindo %s ( %d ) ( Motivo: %s )", sendername,playerid,giveplayer,id,MSG);
	Comandosp(Roxo,string,1);
	return 1;
	}
	}
	else
	{
 	SendClientMessage(playerid, ERRO, "| ERRO | Vocк nгo tem permissгo!");
	}
	return 1;
	}
A Parte principal eu acredito que estб certa, mais quando digito /perseguir ele diz: digite /perseguir id motivo, qnd digito o id e motivo ele diz comando inexistente.. Da uma ajudinha ae.. Vlw
Reply
#2

PHP код:
if(strcmp(cmdtext"/perseguir"true) == 0)
{
    if(
PlayerInfoplayerid ][pCorregedor] == || PlayerInfoplayerid ][pProfissao] == Policia_Civil || PlayerInfoplayerid ][pProfissao] == Policia_Federal || PlayerInfoplayerid ][pProfissao] == Interpol || PlayerInfoplayerid ][pProfissao] == Delegado || PlayerInfoplayerid ][pProfissao] == Bope
    
|| PlayerInfoplayerid ][pProfissao] == Swat || PlayerInfoplayerid ][pProfissao] == Narcoticos ||PlayerInfoplayerid ][pProfissao] == Policia_Militar || PlayerInfoplayerid ][pProfissao] == FBI || PlayerInfoplayerid ][pProfissao] == Policia_Rodoviaria)
     {
        new 
MSG[128], idstr[128], aname[MAX_PLAYER_NAME];
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp)) return SendClientMessage(playeridERRO"| ERRO | /perseguir [ id ] [motivo]");
        
id strval(tmp);
        
MSG strrest(cmdtextidx);
        if(!
strlen(MSG)) return SendClientMessage(playeridERRO"| ERRO | /perseguir [ id ] [motivo]");
        if(!
IsPlayerConnectedid )) return SendClientMessage(playeridERRO"| ERRO | Jogador nгo estб conectado!");
        if(
Algemadoid ] == true) return SendClientMessage(playeridERRO"| ERRO | O Jogador Estб Algemado!");
        if(
playerid == id) return SendClientMessage(playeridERRO"| ERRO | Vocк nгo pode perseguir vocк mesmo!");
        if(
Perseguindo[playerid] == 1) return SendClientMessage(playeridERRO"| ERRO | Vocк ja estб perseguindo alguйm!");
         else {
            
Perseguindo[playerid] = 1;
            
Perseguido[id] = 1;
            new 
sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
            
localizadoplayerid ] = 1;
               
GetPlayerName(idanamesizeof(aname));
            
format(str,128,"Perseguiзгo ao alvo: %s ( %d )"anameid);
            
SendClientMessage(playerid0xB389B3FFstr);
            
SendClientMessage(playeridAmareloClaro"| INFO | Jogador localizado com sucesso, siga o ponto Vermelho no mapa para chegar atй ele!");
            
LocalizarIDplayerid ] = id;
            
TimerLocalizarplayerid ] = SetTimerEx("GPSUpdate"1000true"ii"playerid,id);
            
SendClientMessage(playerid0x5882FAFF"O player perseguido nгo pode utilizar de comandos para seu benefнcio.");
            
SendClientMessage(playerid0x5882FAFF"| INFO | Vocк tem 3 minutos para perseguir o jogador.");
            
format(stringsizeof(string), "{FF0000}| INFO | O Policial %s estб te perseguindo e vocк nгo pode usar comandos para seu benefнcio"sendername);
            
SendClientMessage(idERROstring);
            
SetTimer("TempoPersegue"180000false);
            
SetTimer("TempoPerseguir"300000false);//jhih
            
format(stringsizeof(string),"{FF00FF}| Corregedoria | O Policial %s ( %d ) estб perseguindo %s ( %d ) ( Motivo: %s )"sendername,playerid,giveplayer,id,MSG);
            
Comandosp(Roxo,string,1);
            return 
1;
        }
    }
    else
    {
        
SendClientMessage(playeridERRO"| ERRO | Vocк nгo tem permissгo!");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)