SA-MP Forums Archive
[FilterScript] KACC Gates (0.3d) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] KACC Gates (0.3d) (/showthread.php?tid=283045)



KACC Gates (0.3d) - Geso - 13.09.2011

It has been mentioned in many suggestion-posts before. And now it's possible! This script/snippet makes the gates at KACC Military Fuels openable.

Also thanks to Hiddos for tweaking it a little.

It was pretty easy to make, but for the ones who don't have the time to make it, this can be useful.

As I don't think screenshots are needed, here's the code:

Код:
#include <a_samp>
new gate[2];
new bool:kaccopen = false;
new gatetimer;
public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" KACC Gates by Geso (SA-MP 0.3d) (Small tweak by Hiddos)");
	print("--------------------------------------\n");
	for(new i=0;i<MAX_PLAYERS;i++)
	{
		RemoveBuildingForPlayer(i, 985, 2497.36523438, 2777.06933594, 11.55891800, 40.0);
    	RemoveBuildingForPlayer(i, 2497.35888672, 2769.11181641, 11.55891800, 40.0);
    }
	gate[0] = CreateObject(985,2497.36523438,2777.06933594,11.55891800,0.00000000,0.00000000,90.00000000);
	gate[1] = CreateObject(986,2497.35888672,2769.11181641,11.55891800,0.00000000,0.00000000,90.00000000);
	gatetimer = SetTimer("GateCheck", 800, 1);
	return 1;
}

public OnFilterScriptExit()
{
	KillTimer(gatetimer);
	DestroyObject(gate[0]);
	DestroyObject(gate[1]);
	return 1;
}

public OnPlayerConnect(playerid)
{
    RemoveBuildingForPlayer(playerid, 985, 2497.36523438, 2777.06933594, 11.55891800, 40.0);
    RemoveBuildingForPlayer(playerid, 986, 2497.35888672, 2769.11181641, 11.55891800, 40.0);
	return 1;
}

forward GateCheck();
public GateCheck()
{
	for(new i; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerInRangeOfPoint(i, 20.0, 2497.36523438, 2773.546, 11.55891800))
		{
			if(kaccopen == false)
			{
				MoveObject(gate[0],2497.36523438,2785.06933594,11.55891800, 3);
				MoveObject(gate[1],2497.36523438,2761.11181641,11.55891800, 3);
				kaccopen = true;
			}
			return;				
		}
	}
	if(kaccopen == true)
	{
		MoveObject(gate[0],2497.36523438,2777.06933594,11.55891800, 3);
		MoveObject(gate[1],2497.36523438,2769.11181641,11.55891800, 3);
		kaccopen = false;
	}
}
The gates will open autmatically if you go near. As easy as can be.

Also just a quick note for the people that don't like to read all the above, atleast read this:

It will only work for SA-MP 0.3d


Re: KACC Gates (0.3d) - WoodPecker - 13.09.2011

I was waiting for this one much time, but now i dont need the KACC place, thank you anyway, 3rep4you.


Re: KACC Gates (0.3d) - IstuntmanI - 13.09.2011

Very creative ! Nice filterscript

Quote:

This forum requires that you wait 120 seconds between posts. Please try again in 26 seconds.




Re: KACC Gates (0.3d) - David_Landon - 13.09.2011

Good job


Re: KACC Gates (0.3d) - X3nZ - 13.09.2011

Nice job.


Re: KACC Gates (0.3d) - Hiddos - 13.09.2011

Nice, but one minor bug: You're also deleting ALL gates around San Andreas which use the SAME object ID as the KACC gates (If any)

I made some untested code which has got automatic gate opening (If players are near it'll open) and a bit more 'local' RemoveBuildingForPlayer here. If you'd like me to take down the link, please tell me.


Re: KACC Gates (0.3d) - Geso - 13.09.2011

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
Nice, but one minor bug: You're also deleting ALL gates around San Andreas which use the SAME object ID as the KACC gates (If any)

I made some untested code which has got automatic gate opening (If players are near it'll open) and a bit more 'local' RemoveBuildingForPlayer here. If you'd like me to take down the link, please tell me.
Nah, you're right, ill change the link and give you credit for it.


Re: KACC Gates (0.3d) - Hiddos - 13.09.2011

Thanks . Also, I'm right now testing the script (my version), I'll tell you if it works

Edit: Yay it r work!

Edit edit: You still forgot to remove the 'use /kacc to open the gates' part beneath the code


Re: KACC Gates (0.3d) - Stepashka - 13.09.2011

ppc


Re: KACC Gates (0.3d) - StreetGT - 13.09.2011

thats bad, remember that a user use this FS when he start the server.
Use the function for remove onplayerspawn or onplayerconnect.
And when if server starts = 0 users in Server?


Edit: i didnte see this code ^^
pawn Код:
public OnPlayerConnect(playerid)
{
    RemoveBuildingForPlayer(playerid, 985, 2497.36523438, 2777.06933594, 11.55891800, 40.0);
    RemoveBuildingForPlayer(playerid, 986, 2497.35888672, 2769.11181641, 11.55891800, 40.0);
    return 1;
}



Re: KACC Gates (0.3d) - sherlock - 13.09.2011

can someone tell me where the hell 0.3d is?? ty


Re: KACC Gates (0.3d) - VendenTTa - 13.09.2011

Kacc gate ? ss pls


Re: KACC Gates (0.3d) - dylanando - 14.09.2011

yeah 0.3d :S


Re: KACC Gates (0.3d) - uprp - 14.09.2011

dnt use 0.3d, it's bugged .. Talking about the client ofcourse... Wait for a higher release.

This forum requires that you wait 120 seconds between posts. Please try again in 21 seconds.


Re: KACC Gates (0.3d) - [GTA]AmericanGangster - 14.09.2011

oh nice!
EDIT: i have put a GM from sa-mp 0.2.2 to sa-mp 0.3c works! and this will don't work for sa-mp 0.3c? :P


Re: KACC Gates (0.3d) - Geso - 14.09.2011

Quote:
Originally Posted by uprp
Посмотреть сообщение
dnt use 0.3d, it's bugged .. Talking about the client ofcourse... Wait for a higher release.

This forum requires that you wait 120 seconds between posts. Please try again in 21 seconds.
It's a beta, no wonder there are still some bugs. But scripters can already develop new things with the new functions, so they can use it when 0.3d is officially released.

And no, it won't work 0.3c.