SA-MP Forums Archive
[Ajuda] Olhar OFF nгo pega - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Olhar OFF nгo pega (/showthread.php?tid=497769)



Olhar OFF nгo pega - RafaScripter - 28.02.2014

quando eu do /olhar id pega mais depois quando digita /olhar off nгo pega alguem pode me ajudar ?

Code:
CMD:olhar(playerid, params[])
{
	new specid;
    if(PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid, Vermelho, "Erro: Vocк nгo pode usar esse comando.");
	if(PlayerInfo[playerid][Trabalhando] == false) return SendClientMessage(playerid, Vermelho, "Erro: Vocк nгo estб em modo de trabalho, use /trabalhar.");
	if(strcmp(String, "off", true)==0)
	{
		 	if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
		 	{
		 	    StopSpectate(playerid);
				return 1;
			}
			else
			{
			    return SendClientMessage(playerid, Vermelho, "Erro: Vocк nгo estб espectando ninguйm.");
			}
	}
	if(sscanf(params, "u", specid)) return SendClientMessage(playerid, Vermelho, "Use: /olhar [id/off]");
	if(!IsPlayerConnected(specid)) return SendClientMessage(playerid, Vermelho, "Erro: ID invalido");
	if(specid== playerid)
	{
    SendClientMessage(playerid, Vermelho, "Erro: Vocк nгo pode olhar vocк mesmo.");
	return 1;
	}
	if(GetPlayerState(specid) == PLAYER_STATE_SPECTATING && PlayerInfo[specid][gSpectateID] != INVALID_PLAYER_ID)
	{
			SendClientMessage(playerid, Vermelho, "Erro: Jogador escolhido jб estб espectando alguйm.");
			return 1;
	}
    if(GetPlayerState(specid) != 1 && GetPlayerState(specid) != 2 && GetPlayerState(specid) != 3)
    {
	 		SendClientMessage(playerid, Vermelho, "Erro: O jogador nгo estб jogando.");
			return 1;
	}
	if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
    {
	       	SaveVariables(playerid);
			SendClientMessage(playerid, Vermelho, "Info: Vocк entrou no modo espectador, para sair digite /olhar off.");
            StartSpectate(playerid, specid);
			return 1;
	}
	return 1;
}



Re: Olhar OFF nгo pega - Kmatsu - 28.02.2014

Tenta trocar
pawn Code:
if(strcmp(String, "off", true)==0)
para
pawn Code:
if(strcmp(params, "off", true)==0)



Re: Olhar OFF nгo pega - GWMPT - 28.02.2014

Quote:
Originally Posted by Kmatsu
View Post
Tenta trocar
pawn Code:
if(strcmp(String, "off", true)==0)
para
pawn Code:
if(strcmp(params, "off", true)==0)
lol, isso nгo tкm nada a haver com o problema.


O
pawn Code:
if(sscanf(params, "u", specid)) return SendClientMessage(playerid, Vermelho, "Use: /olhar [id/off]");
estб a ler o ID do jogador, nгo uma string.
Esse й o problema.


Re: Olhar OFF nгo pega - LuanBr - 28.02.2014

/pararolha