13.09.2011, 14:28
(
Последний раз редактировалось Geso; 13.09.2011 в 16:00.
)
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:
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
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; } }
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