Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- #define COLOR_RED 0xAA3333AA
- #define COLOR_GREEN 0x33AA33AA
- new Gate;
- new EnterCarTimer;
- new ExitCarTimer;
- new CloseParkTimer;
- new Ticket;
- forward ClosePark();
- forward EnterParkText();
- forward ExitParkText();
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- public OnFilterScriptInit()
- {
- print("\n=============== Filterscript ===============");
- print(" Los Santos Parkplatz - by Crypt");
- print("============================================\n");
- //Zaun etc.
- CreateObject(982, 1101.9345703125, -1764.2861328125, 13.20042514801, 0, 0, 0);
- CreateObject(982, 1089.10546875, -1777.107421875, 13.199911117554, 0, 0, 90);
- CreateObject(982, 1089.0148925781, -1735.7530517578, 13.417594909668, 0, 0, 90);
- CreateObject(982, 1071.4642333984, -1735.7451171875, 13.370635986328, 0, 0, 90);
- CreateObject(982, 1071.5245361328, -1777.1121826172, 13.200019836426, 0, 0, 90);
- CreateObject(982, 1058.69140625, -1764.2805175781, 13.251355171204, 0, 0, 0);
- CreateObject(982, 1058.6650390625, -1748.4953613281, 13.302135467529, 0, 0, 0);
- CreateObject(983, 1101.9666748047, -1749.9284667969, 13.22520160675, 0, 0, 0);
- CreateObject(4641, 1103.6424560547, -1747.7600097656, 14.262054443359, 0, 0, 180);
- //---
- CreateObject(970, 1085.2596435547, -1748.0795898438, 12.968771934509, 0, 0, 0);
- CreateObject(970, 1080.828125, -1748.0407714844, 12.979933738708, 0, 0, 0);
- CreateObject(970, 1076.4321289063, -1748.0556640625, 12.990538597107, 0, 0, 0);
- CreateObject(970, 1076.4425048828, -1752.8205566406, 12.95593547821, 0, 0, 0);
- CreateObject(970, 1085.2845458984, -1752.9266357422, 12.938941955566, 0, 0, 0);
- CreateObject(970, 1080.8505859375, -1752.9403076172, 12.945717811584, 0, 0, 0);
- CreateObject(970, 1087.3603515625, -1750.4136962891, 12.939476966858, 0, 0, 90);
- CreateObject(970, 1074.3697509766, -1750.4799804688, 12.974703788757, 0, 0, 90);
- //---
- CreateObject(1251, 1103.3505859375, -1741.0686035156, 12.592844009399, 0, 0, 0);
- //Schranke
- Gate = CreateObject(979, 1101.9207763672, -1741.2805175781, 13.345894813538, 0, 0, 270);
- EnterCarTimer = SetTimer("EnterParkText", 3000, 1);
- ExitCarTimer = SetTimer("ExitParkText",3000,1);
- CloseParkTimer = SetTimer("ClosePark",10000,1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(EnterCarTimer);
- KillTimer(ExitCarTimer);
- KillTimer(CloseParkTimer);
- return 1;
- }
- #else
- main()
- {
- print("\n=============== Filterscript ===============");
- print(" Parkplatz in LS - By Crypt ");
- print("============================================\n");
- }
- #endif
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- //Parkplatz reinfahren
- if(strcmp(cmdtext, "/openp", true) == 0)
- {
- if (PlayerToPoint(5.0, playerid, 1102.2005615234, -1741.8996582031, 13.353673934937))
- {
- MoveObject(Gate, 1102.2005615234, -1741.8996582031, 11.353673934937, 2.00);
- SendClientMessage(playerid, COLOR_GREEN, "[Parkplatz]Du hast dir erfolgreich ein Ticket gekauft.");
- SendClientMessage(playerid, COLOR_GREEN, "[Parkplatz]Gute Weiterfahrt!");
- GivePlayerMoney(playerid,-100);
- PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
- Ticket = 1;
- return 1;
- }
- }
- //Parkplatz verlassen
- if(strcmp(cmdtext, "/openp", true) == 0)
- {
- if (PlayerToPoint(5.0, playerid, 1102.2005615234, -1741.8996582031, 13.353673934937))
- {
- if (Ticket == 1)
- {
- SendClientMessage(playerid, COLOR_GREEN, "[Parkplatz]Du hast dein Ticket eingelöst.");
- SendClientMessage(playerid, COLOR_GREEN, "[Parkplatz]Bis bald!");
- PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
- MoveObject(Gate, 1102.2005615234, -1741.8996582031, 11.353673934937, 2.00);
- Ticket = 0;
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "[Parkplatz]Du hast kein Ticket erworben. Kaufe es an der Einfahrt!");
- return 1;
- }
- }
- }
- return 0;
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
- public EnterParkText()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- if (PlayerToPoint(5.0, i, 1103.2005615234, -1741.8996582031, 13.353673934937))
- {
- Create3DTextLabel("Los Santos Parkplatz | Kosten: 100$\n-----\tBenutze /openp",0xFFFFFFFF,1101.9207763672, -1741.2805175781, 13.345894813538,80,0,0);
- }
- }
- public ClosePark()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- if (!PlayerToPoint(1.5, i, 1102.2005615234, -1741.8996582031, 13.353673934937) || !PlayerToPoint(5.0, i, 1102.2005615234, -1741.8996582031, 13.353673934937))
- {
- MoveObject(Gate, 1102.2005615234, -1741.8996582031, 13.353673934937, 2.00);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment