Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_RED 0xFF0019FF
- #define COLOR_BLUE 0x00FFFAFF
- #define COLOR_GREEN 0xB9FF00FF
- #define COLOR_YELLOW 0xEBFF00FF
- #define COLOR_WHITE 0xFFFFFFAA
- #if defined FILTERSCRIPT
- new Text:Bootvorbereitung;
- new Text:Bootbox;
- new Text:Ladebalken;
- new Text:Ladeprozess[13];
- forward Updater();
- new Float:GuardPosis[][3] = {
- {-1613.7601,180.6174,-0.3910},
- {-1577.4668,193.7632,-0.3038},
- {-1534.9955,201.3559,-0.4279},
- {-1492.0182,210.6865,-0.4136},
- {-1461.6610,210.0977,-0.3842},
- {-1429.0758,199.8184,-0.4252},
- {-1376.1412,219.1274,-0.2256},
- {-1327.7606,262.5111,-0.2964},
- {-1271.2504,321.2814,-0.2797},
- {-1209.8439,384.3937,-0.3779},
- {-1162.0667,433.1101,-0.4589},
- {-1143.2809,482.1872,-0.2631},
- {-1157.0725,572.1703,-0.2441},
- {-1173.7074,659.5290,-0.3608},
- {-1208.4756,763.0780,-0.4036},
- {-1237.0261,847.3550,-0.4294},
- {-1260.8405,921.7414,-0.5126},
- {-1256.5515,973.7932,-0.2186},
- {-1262.9100,1033.9830,-0.3214},
- {-1304.1360,1102.2773,-0.4627},
- {-1368.3881,1211.2271,-0.3263},
- {-1424.3107,1304.4130,-0.2337},
- {-1510.6543,1417.7675,-0.2835},
- {-1591.3822,1492.1770,-0.1552},
- {-1672.7981,1569.1357,-0.3205},
- {-1739.5494,1606.3124,-0.3848},
- {-1781.2429,1601.8557,-0.4253},
- {-1823.3256,1603.0128,-0.1302},
- {-1873.6674,1572.8894,-0.4034},
- {-1865.6697,1451.8278,-0.3630}
- };
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Guardjob by Baba Haft");
- print("--------------------------------------\n");
- SetTimer("Updater",1000,true);
- Bootvorbereitung = TextDrawCreate(150.000000, 201.000000, "Dein Kontrollboot wird gerade vorbereitet...");
- TextDrawBackgroundColor(Bootvorbereitung, 255);
- TextDrawFont(Bootvorbereitung, 1);
- TextDrawLetterSize(Bootvorbereitung, 0.470000, 2.800000);
- TextDrawColor(Bootvorbereitung, -1);
- TextDrawSetOutline(Bootvorbereitung, 0);
- TextDrawSetProportional(Bootvorbereitung, 1);
- TextDrawSetShadow(Bootvorbereitung, 1);
- TextDrawUseBox(Bootvorbereitung, 1);
- TextDrawBoxColor(Bootvorbereitung, 255);
- TextDrawTextSize(Bootvorbereitung, 640.000000, 0.000000);
- Bootbox = TextDrawCreate(0.000000, -10.000000, "GUTEN TAG");
- TextDrawBackgroundColor(Bootbox, 255);
- TextDrawFont(Bootbox, 1);
- TextDrawLetterSize(Bootbox, 0.470000, 50.799999);
- TextDrawColor(Bootbox, 0);
- TextDrawSetOutline(Bootbox, 0);
- TextDrawSetProportional(Bootbox, 1);
- TextDrawSetShadow(Bootbox, 1);
- TextDrawUseBox(Bootbox, 1);
- TextDrawBoxColor(Bootbox, 255);
- TextDrawTextSize(Bootbox, 640.000000, 50.000000);
- Ladebalken = TextDrawCreate(575.000000, 412.000000, "Guardbonus");
- TextDrawBackgroundColor(Ladebalken, 255);
- TextDrawFont(Ladebalken, 2);
- TextDrawLetterSize(Ladebalken, 0.240000, 1.800000);
- TextDrawColor(Ladebalken, 16777215);
- TextDrawSetOutline(Ladebalken, 0);
- TextDrawSetProportional(Ladebalken, 1);
- TextDrawSetShadow(Ladebalken, 1);
- Ladeprozess[0] = TextDrawCreate(576.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[0], 16777215);
- TextDrawFont(Ladeprozess[0], 2);
- TextDrawLetterSize(Ladeprozess[0], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[0], 255);
- TextDrawSetOutline(Ladeprozess[0], 1);
- TextDrawSetProportional(Ladeprozess[0], 1);
- Ladeprozess[1] = TextDrawCreate(581.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[1], 16777215);
- TextDrawFont(Ladeprozess[1], 2);
- TextDrawLetterSize(Ladeprozess[1], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[1], 255);
- TextDrawSetOutline(Ladeprozess[1], 1);
- TextDrawSetProportional(Ladeprozess[1], 1);
- Ladeprozess[2] = TextDrawCreate(586.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[2], 16777215);
- TextDrawFont(Ladeprozess[2], 2);
- TextDrawLetterSize(Ladeprozess[2], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[2], 255);
- TextDrawSetOutline(Ladeprozess[2], 1);
- TextDrawSetProportional(Ladeprozess[2], 1);
- Ladeprozess[3] = TextDrawCreate(591.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[3], 16777215);
- TextDrawFont(Ladeprozess[3], 2);
- TextDrawLetterSize(Ladeprozess[3], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[3], 255);
- TextDrawSetOutline(Ladeprozess[3], 1);
- TextDrawSetProportional(Ladeprozess[3], 1);
- Ladeprozess[4] = TextDrawCreate(596.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[4], 16777215);
- TextDrawFont(Ladeprozess[4], 2);
- TextDrawLetterSize(Ladeprozess[4], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[4], 255);
- TextDrawSetOutline(Ladeprozess[4], 1);
- TextDrawSetProportional(Ladeprozess[4], 1);
- Ladeprozess[5] = TextDrawCreate(601.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[5], 16777215);
- TextDrawFont(Ladeprozess[5], 2);
- TextDrawLetterSize(Ladeprozess[5], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[5], 255);
- TextDrawSetOutline(Ladeprozess[5], 1);
- TextDrawSetProportional(Ladeprozess[5], 1);
- Ladeprozess[6] = TextDrawCreate(606.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[6], 16777215);
- TextDrawFont(Ladeprozess[6], 2);
- TextDrawLetterSize(Ladeprozess[6], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[6], 255);
- TextDrawSetOutline(Ladeprozess[6], 1);
- TextDrawSetProportional(Ladeprozess[6], 1);
- Ladeprozess[7] = TextDrawCreate(611.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[7], 16777215);
- TextDrawFont(Ladeprozess[7], 2);
- TextDrawLetterSize(Ladeprozess[7], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[7], 255);
- TextDrawSetOutline(Ladeprozess[7], 1);
- TextDrawSetProportional(Ladeprozess[7], 1);
- Ladeprozess[8] = TextDrawCreate(616.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[8], 16777215);
- TextDrawFont(Ladeprozess[8], 2);
- TextDrawLetterSize(Ladeprozess[8], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[8], 255);
- TextDrawSetOutline(Ladeprozess[8], 1);
- TextDrawSetProportional(Ladeprozess[8], 1);
- Ladeprozess[9] = TextDrawCreate(621.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[9], 16777215);
- TextDrawFont(Ladeprozess[9], 2);
- TextDrawLetterSize(Ladeprozess[9], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[9], 255);
- TextDrawSetOutline(Ladeprozess[9], 1);
- TextDrawSetProportional(Ladeprozess[9], 1);
- Ladeprozess[10] = TextDrawCreate(626.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[10], 16777215);
- TextDrawFont(Ladeprozess[10], 2);
- TextDrawLetterSize(Ladeprozess[10], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[10], 255);
- TextDrawSetOutline(Ladeprozess[10], 1);
- TextDrawSetProportional(Ladeprozess[10], 1);
- Ladeprozess[11] = TextDrawCreate(631.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[11], 16777215);
- TextDrawFont(Ladeprozess[11], 2);
- TextDrawLetterSize(Ladeprozess[11], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[11], 255);
- TextDrawSetOutline(Ladeprozess[11], 1);
- TextDrawSetProportional(Ladeprozess[11], 1);
- Ladeprozess[12] = TextDrawCreate(636.000000, 420.000000, "i");
- TextDrawBackgroundColor(Ladeprozess[12], 16777215);
- TextDrawFont(Ladeprozess[12], 2);
- TextDrawLetterSize(Ladeprozess[12], 0.300000, 3.200000);
- TextDrawColor(Ladeprozess[12], 255);
- TextDrawSetOutline(Ladeprozess[12], 1);
- TextDrawSetProportional(Ladeprozess[12], 1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SetPVarInt(playerid,"GuardingCP",-1);
- SetPVarInt(playerid,"Oldskin",-1);
- SetPVarInt(playerid,"Kontrollboot",-1);
- SetPVarInt(playerid,"CarNow",-1);
- SetPVarInt(playerid,"LadenProzess",-1);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext,"/guardbeach",true)==0)
- {
- if(IsPlayerInRangeOfPoint(playerid,1.0,-1624.0958,154.7776,3.5547))
- {
- if(GetPVarInt(playerid,"StartedGuarding")==1)return SendClientMessage(playerid, COLOR_GREY," Du bist schon dabei das Meer zu kontrollieren. ");
- SetPVarInt(playerid,"StartedGuarding",1);
- SetPVarInt(playerid,"KontrollbootVorbereitung",5);
- SendClientMessage(playerid, COLOR_RED," Dir wird ein Kontrollboot vorbereitet. Dies wird circa 5 Sekunden dauern. ");
- TextDrawShowForPlayer(playerid, Bootvorbereitung);
- TextDrawShowForPlayer(playerid, Bootbox);
- SetPlayerVirtualWorld(playerid, 2);
- SetPVarInt(playerid,"Oldskin",GetPlayerSkin(playerid));
- SetPlayerSkin(playerid, 261);
- }
- else SendClientMessage(playerid, COLOR_GREY," Du befindest dich nicht an der Guard-Position. Benutze /guardposition um die Position auf der Karte zu markieren. ");
- return 1;
- }
- if(strcmp(cmdtext,"/guardposition",true)==0)
- {
- SendClientMessage(playerid, COLOR_WHITE, " Ziel gesetzt. Fahre dorthin und gebe /guardbeach ein um die Meerkontrolle zu starten. ");
- SetPlayerCheckpoint(playerid, -1624.0958,154.7776,3.5547, 1.0);
- SetPlayerPos(playerid,-1624.0958,154.7776,3.5547);
- return 1;
- }
- return 0;
- }
- public Updater()
- {
- for(new i; i < GetMaxPlayers(); i++)
- {
- if(GetPVarInt(i,"StartedGuarding")==1)
- {
- SetPVarInt(i,"GuardTime",GetPVarInt(i,"GuardTime")+1);
- if(GetPVarInt(i,"GuardTime")==14)
- {
- TextDrawShowForPlayer(i, Ladeprozess[GetPVarInt(i,"LadenProzess")]);
- SetPVarInt(i,"LadenProzess",GetPVarInt(i,"LadenProzess")+1);
- SetPVarInt(i,"GuardTime",0);
- }
- }
- if(GetPVarInt(i,"KontrollbootVorbereitung") > 0)
- {
- if(GetPVarInt(i,"KontrollbootVorbereitung") >= 0)
- {
- SetPVarInt(i,"KontrollbootVorbereitung",GetPVarInt(i,"KontrollbootVorbereitung")-1);
- }
- if(GetPVarInt(i,"KontrollbootVorbereitung")==0)
- {
- SetPVarInt(i,"KontrollbootVorbereitung",0);
- SetPVarInt(i,"GuardingCP",0);
- SendClientMessage(i, COLOR_WHITE," Job-Information: Du hast deine Arbeitskleidung angezogen. Nach der Meerkontrolle erhälst Du deine alten Kleider zurück. ");
- SendClientMessage(i, COLOR_WHITE, "");
- SendClientMessage(i, COLOR_GREEN," Bitte fahre nun die aufleuchtenden Checkpoints ab um das Meer zu kontrollieren. Bei unsicheren Orten wirst Du sie automatisch ");
- SendClientMessage(i, COLOR_GREEN," kontrollieren. Wenn Du die Kontrolle, bevor der Ladebalken dort das Maximum erreicht, abschließst, erhälst Du einen kleinen Bonus dazu. ");
- SendClientMessage(i, COLOR_WHITE,"");
- SendClientMessage(i, COLOR_RED," Viel Glück nun. ");
- SetPVarInt(i,"Kontrollboot",CreateVehicle(472,-1632.7236,161.6849,-0.3614,316.1652, 0, 0, -1));
- PutPlayerInVehicle(i, GetPVarInt(i,"Kontrollboot"),PLAYER_STATE_DRIVER);
- TextDrawHideForPlayer(i, Bootvorbereitung);
- TextDrawHideForPlayer(i, Bootbox);
- GameTextForPlayer(i, "~g~ Fahre die Checkpoints ab ~n~ um das Meer zu kontrollieren",3000,3);
- SetPlayerVirtualWorld(i, 0);
- new cp = GetPVarInt(i,"GuardingCP");
- SetPlayerCheckpoint(i, GuardPosis[cp][0],GuardPosis[cp][1],GuardPosis[cp][2],10.0);
- TextDrawShowForPlayer(i, Ladebalken);
- SetPVarInt(i,"LadenProzess",0);
- }
- }
- if(GetPVarInt(i,"Nachschauen") > 0)
- {
- if(GetPVarInt(i,"Nachschauen") >= 0)
- {
- SetPVarInt(i,"Nachschauen",GetPVarInt(i,"Nachschauen")-1);
- SetVehicleSpeed(GetPlayerVehicleID(i),0);
- }
- if(GetPVarInt(i,"Nachschauen")==0)
- {
- SetPVarInt(i,"Nachschauen",0);
- SetCameraBehindPlayer(i);
- TogglePlayerControllable(i, 1);
- new arbeit = random(4);
- if(arbeit == 3)
- {
- GameTextForPlayer(i,"~g~Dort waren einige Komplikationen ~n~Du hast alles geregelt.", 3000, 3);
- new belohnung = random(150);
- new string[28];
- format(string, sizeof(string)," Kleine Belohnung: $%d ", belohnung);
- SendClientMessage(i, COLOR_GREEN, string);
- GivePlayerMoney(i, belohnung);
- }
- else
- {
- GameTextForPlayer(i,"~g~Dort war alles sicher",3000,3);
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER) { SetPVarInt(playerid,"CarNow",GetPlayerVehicleID(playerid)); }
- if(oldstate == PLAYER_STATE_DRIVER)
- {
- if(GetPVarInt(playerid,"CarNow") == GetPVarInt(playerid,"Kontrollboot"))
- {
- DestroyVehicle(GetPVarInt(playerid,"Kontrollboot"));
- GameTextForPlayer(playerid,"~r~Meerkontrolle gescheitert",3000,3);
- SetPVarInt(playerid, "Kontrollboot",-1);
- SetPlayerSkin(playerid, GetPVarInt(playerid,"Oldskin"));
- SetPVarInt(playerid,"GuardingCP",-1);
- SetPVarInt(playerid,"StartedGuarding",0);
- DisablePlayerCheckpoint(playerid);
- SetPVarInt(playerid,"LadenProzess",-1);
- TextDrawHideForPlayer(playerid, Ladebalken);
- TextDrawHideForPlayer(playerid, Ladeprozess[0]);
- TextDrawHideForPlayer(playerid, Ladeprozess[1]);
- TextDrawHideForPlayer(playerid, Ladeprozess[2]);
- TextDrawHideForPlayer(playerid, Ladeprozess[3]);
- TextDrawHideForPlayer(playerid, Ladeprozess[4]);
- TextDrawHideForPlayer(playerid, Ladeprozess[5]);
- TextDrawHideForPlayer(playerid, Ladeprozess[6]);
- TextDrawHideForPlayer(playerid, Ladeprozess[7]);
- TextDrawHideForPlayer(playerid, Ladeprozess[8]);
- TextDrawHideForPlayer(playerid, Ladeprozess[9]);
- TextDrawHideForPlayer(playerid, Ladeprozess[10]);
- TextDrawHideForPlayer(playerid, Ladeprozess[11]);
- TextDrawHideForPlayer(playerid, Ladeprozess[12]);
- }
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- new cp = GetPVarInt(playerid,"GuardingCP");
- if(IsPlayerInRangeOfPoint(playerid, 10.0, GuardPosis[cp][0], GuardPosis[cp][1], GuardPosis[cp][2]))
- {
- if(GetPVarInt(playerid,"GuardingCP")==29)
- {
- DisablePlayerCheckpoint(playerid);
- new string[50];
- DestroyVehicle(GetPVarInt(playerid,"Kontrollboot"));
- new belohnung = random(1500);
- GivePlayerMoney(playerid, belohnung);
- format(string, sizeof(string),"~w~Belohnung: ~g~$%d",belohnung);
- GameTextForPlayer(playerid, string, 5000, 1);
- SendClientMessage(playerid, COLOR_GREEN," Der Staat bedankt sich für dein freiwilliges Engagement. „Er hat gute Arbeit geleistet!“, so der Präsident. ");
- SetPVarInt(playerid, "Kontrollboot",-1);
- SetPlayerSkin(playerid, GetPVarInt(playerid,"Oldskin"));
- SetPVarInt(playerid,"GuardingCP",-1);
- SetPVarInt(playerid,"StartedGuarding",0);
- SetPlayerPos(playerid,-1879.7826,1441.7073,7.1809);
- SetPlayerFacingAngle(playerid,226.1267);
- SetCameraBehindPlayer(playerid);
- if(GetPVarInt(playerid,"LadenProzess") < 12)
- {
- SendClientMessage(playerid, COLOR_GREY," Da Du die Meerkontrolle bevor der Ladebalken voll geworden ist abgeschlossen hast, erhälst Du einen Bonus von $1500. ");
- GivePlayerMoney(playerid, 1500);
- }
- SetPVarInt(playerid,"LadenProzess",-1);
- TextDrawHideForPlayer(playerid, Ladebalken);
- TextDrawHideForPlayer(playerid, Ladeprozess[0]);
- TextDrawHideForPlayer(playerid, Ladeprozess[1]);
- TextDrawHideForPlayer(playerid, Ladeprozess[2]);
- TextDrawHideForPlayer(playerid, Ladeprozess[3]);
- TextDrawHideForPlayer(playerid, Ladeprozess[4]);
- TextDrawHideForPlayer(playerid, Ladeprozess[5]);
- TextDrawHideForPlayer(playerid, Ladeprozess[6]);
- TextDrawHideForPlayer(playerid, Ladeprozess[7]);
- TextDrawHideForPlayer(playerid, Ladeprozess[8]);
- TextDrawHideForPlayer(playerid, Ladeprozess[9]);
- TextDrawHideForPlayer(playerid, Ladeprozess[10]);
- TextDrawHideForPlayer(playerid, Ladeprozess[11]);
- TextDrawHideForPlayer(playerid, Ladeprozess[12]);
- }
- else
- {
- new arbeit = random(3);
- if(arbeit == 0)
- {
- DisablePlayerCheckpoint(playerid);
- SetPVarInt(playerid,"GuardingCP",GetPVarInt(playerid,"GuardingCP")+1);
- SetPlayerCheckpoint(playerid, GuardPosis[GetPVarInt(playerid,"GuardingCP")][0], GuardPosis[GetPVarInt(playerid,"GuardingCP")][1], GuardPosis[GetPVarInt(playerid,"GuardingCP")][2], 10.0);
- GameTextForPlayer(playerid, "~r~Hier wirkt es etwas unsicher ~n~Du wirst kurz nachschauen",8500,3);
- SetPVarInt(playerid,"Nachschauen",8);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- SetPlayerCameraPos(playerid, x, y, z+20);
- SetPlayerCameraLookAt(playerid, x, y, z);
- TogglePlayerControllable(playerid, 0);
- SetVehicleSpeed(GetPlayerVehicleID(playerid),0);
- }
- else
- {
- DisablePlayerCheckpoint(playerid);
- SetPVarInt(playerid,"GuardingCP",GetPVarInt(playerid,"GuardingCP")+1);
- SetPlayerCheckpoint(playerid, GuardPosis[GetPVarInt(playerid,"GuardingCP")][0], GuardPosis[GetPVarInt(playerid,"GuardingCP")][1], GuardPosis[GetPVarInt(playerid,"GuardingCP")][2], 10.0);
- }
- }
- }
- return 1;
- }
- stock SetVehicleSpeed(vehicleid,mph)
- {
- new Float:Vx,Float:Vy,Float:Vz,Float:DV,Float:multiple;
- GetVehicleVelocity(vehicleid,Vx,Vy,Vz);
- DV = floatsqroot(Vx*Vx + Vy*Vy + Vz*Vz);
- if(DV > 0)
- {
- multiple = (mph / (DV * 100));
- return SetVehicleVelocity(vehicleid,Vx*multiple,Vy*multiple,Vz*multiple);
- }
- return 0;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement