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



[Ajuda] Portхes - FallenHtz - 22.12.2011

Entгo , sei fazer portхes mas somente com comandos para abrir , tipo /abrir e /fechar . e eles nгo fecham se nгo der o comando , queria saber um jeito de fazer com que ele abrisse com uma buzina ;s

Aqui estб o code pawn do portгo de comando , que sei fazer .

Код:
new Portao;

#define Vermelho 0xFF0000AA
#define Amarelo 0xFFFF00AA


public OnFilterScriptInit()
{
    Portao = CreateObject(980,  -1540.3406982422, 482.71173095703, 8.9530792236328, 0, 0, 0, 342.8113);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{

//----------------------------
	if (strcmp("/abrir", cmdtext, true, 10) == 0)
	{
		if(!IsPlayerAdmin(playerid))
	    {
			MoveObject(Portao, -1540.3406982422, 482.71173095703, 8.9530792236328, 5.0);
			SendClientMessage(playerid, Vermelho, "Portгo Aberto");
			return 1;
        }
	}
//----------------------------
	if (strcmp("/fechar", cmdtext, true, 10) == 0)
	{
		if(!IsPlayerAdmin(playerid))
        {
			MoveObject(Portao, -1531.1553955078, 482.18063354492, 8.9530792236328, 5.0);
			SendClientMessage(playerid, Vermelho, "Portгo Fechado");
			return 1;
        }
	}
	return 0;
}



Re: [Ajuda] Portхes - AW4Y - 22.12.2011

pawn Код:
//topo do gm
forward Portao1(playerid);

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_CROUCH && IsPlayerInRangeOfPoint(playerid, 6.0, -1540.3406982422, 482.71173095703, 8.9530792236328))
    {
    MoveObject(Portao, -1540.3406982422, 482.71173095703, 8.9530792236328, 5.0);
    SetTimer("Portao1", 7000, false);
    }
    return 1;
}

public Portao1(playerid)
{
MoveObject(Portao, -1531.1553955078, 482.18063354492, 8.9530792236328, 5);
return 1;
}
Acredito que funcione

Se funcionar da rep


Re: [Ajuda] Portхes - FallenHtz - 22.12.2011

Vou tentar *-* , obg desde ja .


Re: [Ajuda] Portхes - Detonador - 22.12.2011

Quote:

Acredito que funcione

kkkkkkkkk puta merda nem pensei no keystatechange huahauhuahuauahuahauh
de qualquer forma vai merecer a REP,pois foi mais rбpido kkkkkkkk


Re: [Ajuda] Portхes - FallenHtz - 22.12.2011

ONDE EU ADICIONO O OBJETO (PORTГO)
Em public OnFilterScriptInit() ?


Re: [Ajuda] Portхes - AW4Y - 22.12.2011

Quote:
Originally Posted by FallenHtz
Посмотреть сообщение
ONDE EU ADICIONO O OBJETO (PORTГO)
Em public OnFilterScriptInit() ?
OnGameModeInit.


Re: [Ajuda] Portхes - Hardware - 22.12.2011

Se for um FilterScript sim. Se for em um GameMode, na public OnGameModeInit();


Re: [Ajuda] Portхes - Detonador - 22.12.2011

Quote:

OnGameModeInit.

depende se ele quer no GM ou no FS


Re: [Ajuda] Portхes - AW4Y - 22.12.2011

Com certeza deve ser um GM...

Mas se nгo for, desculpa


Re: [Ajuda] Portхes - Hardware - 22.12.2011

Mas o cуdigo dele й de um FS.