[FilterScript] KACC Gates (0.3d)
#1

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
Reply
#2

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

Very creative ! Nice filterscript

Quote:

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

Reply
#4

Good job
Reply
#5

Nice job.
Reply
#6

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.
Reply
#7

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.
Reply
#8

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
Reply
#9

ppc
Reply
#10

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;
}
Reply
#11

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

Kacc gate ? ss pls
Reply
#13

yeah 0.3d :S
Reply
#14

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.
Reply
#15

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
Reply
#16

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)