09.06.2016, 01:42
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 й..
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
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; }