SA-MP Forums Archive
[Ajuda] Portao - 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] Portao (/showthread.php?tid=246536)



[Ajuda] Portao - Pedro_Teixeira - 04.04.2011

Oi gente eu acabei de criar um portao, ele funciona e tudo, mas so funciona por comando.
Se eu buzinar, ele nгo abre.
if(strcmp(cmd, "/pc1", true) == 0)
{
if ((PlayerInfo[playerid][pMembro] == 17 || PlayerInfo[playerid][pLider] == 17) && PlayerToPoint(15.0, playerid, 1760.5360, -1696.0157, 13.4273)) { //GateGaragem
MoveObject( gatepc, 1760.63867188, -1697.37597656, 6.88107014,3);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s Abriu Este Portao!", sendername);
ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GameTextForPlayer(playerid, "~g~Aberto", 5000, 3);
SetTimer("PCClosed", 5000, false);
} else {
SendClientMessage(playerid, COLOR_RED, "*** Tu esta pertos do portao ou nao es da PC ***");
}
return 1;
}

Esta ai o que eu fiz, alguem sabe me dizer porque que ele nгo abre com a buzina?
Respondam pf


Re: [DUV] - steki. - 04.04.2011

https://sampforum.blast.hk/showthread.php?tid=244880


Re: [DUV] - Pedro_Teixeira - 04.04.2011

affz, cara eu ja sei criar um portao, e tou contente como ele esta so quero que ele me abra com buzina por isso obrigado que esteja tentando ajudar mas por favor me responda a minha pergunta =s


Re: [DUV] - []Fabricio[] - 04.04.2011

Apenas um exemplo:

Em OnPlayerKeyStateChange

pawn Код:
if( (newkeys == 2 && IsPlayerInAnyVehicle(playerid)) )
{
    OnPlayerCommandText(playerid,"/pc1");
    return 1;
}



Re: [Ajuda] Portao - LuxurioN™ - 04.04.2011

Quote:
Originally Posted by Pedro_Teixeira
Посмотреть сообщение
Oi gente eu acabei de criar um portao, ele funciona e tudo, mas so funciona por comando.
...
Esta ai o que eu fiz, alguem sabe me dizer porque que ele nгo abre com a buzina?
Respondam pf
Код:
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
	if( newkeys == KEY_CROUCH )
	{
		if( IsPlayerInAnyVehicle( playerid ) && IsPlayerInRangeOfPoint( playerid, 15.0, 1760.5360, -1696.0157, 13.4273 ) )
		{
			if ((  !PlayerInfo[playerid][pMembro] == 17 || !PlayerInfo[playerid][pLider] == 17 ) )
			return SendClientMessage(playerid, COLOR_RED, "*** Tu esta pertos do portao ou nao es da PC ***" );
			
			MoveObject( gatepc, 1760.63867188, -1697.37597656, 6.88107014,3);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s Abriu Este Portao!", sendername );
			ProxDetector( 4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE );
			GameTextForPlayer(playerid, "~g~Aberto" , 5000, 3 );
			return SetTimer( "PCClosed", 5000, false );
		}
	}
	return 1;
}



Re: [Ajuda] Portao - Power_GamerX - 05.04.2011

Quote:
Originally Posted by LuxurioN™
Посмотреть сообщение
Код:
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
	if( newkeys == KEY_CROUCH )
	{
		if( IsPlayerInAnyVehicle( playerid ) && IsPlayerInRangeOfPoint( playerid, 15.0, 1760.5360, -1696.0157, 13.4273 ) )
		{
			if ((  !PlayerInfo[playerid][pMembro] == 17 || !PlayerInfo[playerid][pLider] == 17 ) )
			return SendClientMessage(playerid, COLOR_RED, "*** Tu esta pertos do portao ou nao es da PC ***" );
			
			MoveObject( gatepc, 1760.63867188, -1697.37597656, 6.88107014,3);
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s Abriu Este Portao!", sendername );
			ProxDetector( 4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE );
			GameTextForPlayer(p layerid, "~g~Aberto" , 5000, 3 );
			return SetTimer( "PCClosed", 5000, false );
		}
	}
	return 1;
}
GameTextForPlayer(p layerid, "~g~Aberto" , 5000, 3 );

?
nao seria: playerid enves de p layerid


Re: [Ajuda] Portao - LuxurioN™ - 05.04.2011

Quote:
Originally Posted by Power_GamerX
Посмотреть сообщение
GameTextForPlayer(p layerid, "~g~Aberto" , 5000, 3 );

?
nao seria: playerid enves de p layerid
Apenas um espaзo a mais que passou despercebido ao editar "BBCode".