Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ______ _ ______ _ _ __ _____
- | ___| | | | _ \ | (_) / | | ___|
- | |_ _ _ ___| | | | | |___| |___ _____ _ __ ___ _ __ __ __`| | |___ \
- | _| | | |/ _ \ | | | | / _ \ | \ \ / / _ \ '__/ _ \ '__| \ \ / / | | \ \
- | | | |_| | __/ | | |/ / __/ | |\ V / __/ | | __/ | \ V / _| |__/\__/ /
- \_| \__,_|\___|_| |___/ \___|_|_| \_/ \___|_| \___|_| \_/ \___(_)____/
- | Fuel Deliverer Job [UNIQUE] |
- | Script version 1.5 |
- | Creators :- Bolex_ |
- View/Download Links
- | http://forum.sa-mp.com/showthread.php?p=3857049#post3857049 |
- */
- //----------------------------------------------------------------------------//
- #define FILTERSCRIPT
- #include <a_samp>
- #include <foreach>
- #include <izcmd>
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- new Text3D:JOB_T, Text3D:LOADING_P, JobPick, LoadingPick, object;
- new DELIVERER_VEHICLES[ 6 ], JOB_DELIVERER_VEHICLES[ MAX_VEHICLES ];
- #define SCM SendClientMessage
- #define SPD ShowPlayerDialog
- //-----//
- #define LOCATION ( 4 )
- #define DELIVERER_BONUS ( 25 )
- #define EARNINGS_BY_LOCATION ( 120 )
- #define DELIVERER_BR ( 9 )
- #define NEGATIVE_LOKACIJA ( 0 )
- #define DELIVERER_CP
- //-----//
- enum
- {
- D_JHELP
- }
- forward PJobInfo( playerid );
- forward HidePJobInfo( playerid );
- //----------------------------------------------------------------------------//
- new JobActive[ MAX_PLAYERS ], PlayerCP[ MAX_PLAYERS ], JobBonus[ MAX_PLAYERS ],
- JobEarnings[ MAX_PLAYERS ], PlayerEquipment[ MAX_PLAYERS ];
- new Text:Info0, Text:Info1, Text:Info2, Text:Info3, Text:Info4, Text:Info5;
- new Text:PosaoTD, Text:PosaoTD1, Text:PosaoTD2, Text:PosaoTD3,
- Text:PosaoTD4, Text:PosaoTD5, Text:PosaoTD6;
- new PlayerText:DelivererInfo[ MAX_PLAYERS ], PlayerText:BarrelPrew[ MAX_PLAYERS ], PlayerText:BonusInfo[ MAX_PLAYERS ],
- PlayerText:TotalEarnInfo[ MAX_PLAYERS ], PlayerText:EarningsInfo[ MAX_PLAYERS ];
- //----------------------------------------------------------------------------//
- new Float:LOCATIONS[ DELIVERER_CP ][ 13 ] = {
- {2143.4839,-2252.9707,13.3015,44.6907},
- {2197.8823,-1973.9418,13.5584,272.7168},
- {2447.8191,-1964.4468,13.5469,0.9570},
- {2066.1118,-1991.9330,13.5469,176.4049},
- {2494.0667,-1463.5614,24.0246,185.2177},
- {2446.4258,-1900.3201,13.5469,178.3327},
- {2157.1709,-1797.2056,13.3644,180.1486},
- {1220.4326,-1812.2965,16.5938,93.4171},
- {957.1688,-1556.5499,13.5781,270.0392},
- {2434.6362,-2124.5618,13.5469,183.1550},
- {1112.2283,-1182.9980,18.3215,355.4378},
- {747.9487,-1332.7919,13.5442,97.2721},
- {686.9423,-1569.7079,14.2422,3.5612}
- };
- //----------------------------------------------------------------------------//
- #if defined FILTERSCRIPT
- public OnFilterScriptInit( )
- {
- print("|--------------------------------------|");
- print(" Fuel Deliverer by Bolex_! ");
- print("|--------------------------------------|");
- JobPick = CreatePickup( 1275, 2, 1902.5525,-1776.3734,13.5469, 0 );
- JOB_T = Create3DTextLabel( "{ADFF2F}[ Fuel Deliverer ]\n{ADFF2F}Contract: {FFFFFF}Steady\n{ADFF2F}In order to hire this job press {FFFFFF}Accept this job",-1,1902.5525,-1776.3734,13.5469,30.0,0,40 );
- LoadingPick = CreatePickup( 3632, 1, 1938.2350,-1773.1140,13.3828, 0 );
- LOADING_P = Create3DTextLabel( "{ADFF2F}[ Fuel - Loading ]\n{ADFF2F}Number of loading: {FFFFFF}5\n{ADFF2F}For loading of the fuel enter{FFFFFF}[ /takefuel ]!",-1,1938.2350,-1773.1140,13.3828,30.0,0,1 );
- DisableInteriorEnterExits( );
- //------------------------------------------------------------------------//
- CreateObject(638, 1927.84741, -1767.55627, 13.22687, 0.00000, 0.00000, 180.00000);
- CreateObject(638, 1926.12695, -1766.56580, 13.22687, 0.00000, 0.00000, -90.20003);
- CreateObject(638, 1923.45703, -1766.55652, 13.22687, 0.00000, 0.00000, -90.20003);
- CreateObject(638, 1920.78687, -1766.54724, 13.22687, 0.00000, 0.00000, -90.20003);
- CreateObject(638, 1918.11621, -1766.53796, 13.22687, 0.00000, 0.00000, -90.20003);
- CreateObject(638, 1915.76599, -1766.52942, 13.21687, 0.00000, 0.00000, -90.20003);
- CreateObject(638, 1927.84741, -1770.22717, 13.22687, 0.00000, 0.00000, 180.00000);
- CreateObject(638, 1927.84741, -1772.89832, 13.22687, 0.00000, 0.00000, 180.00000);
- CreateObject(638, 1927.84741, -1775.55896, 13.22687, 0.00000, 0.00000, 180.00000);
- CreateObject(638, 1927.84741, -1778.23889, 13.22687, 0.00000, 0.00000, 180.00000);
- CreateObject(638, 1927.84741, -1780.91919, 13.22687, 0.00000, 0.00000, 180.00000);
- CreateObject(638, 1927.84741, -1783.59998, 13.22687, 0.00000, 0.00000, 180.00000);
- CreateObject(638, 1927.84741, -1785.07043, 13.21687, 0.00000, 0.00000, 180.00000);
- CreateObject(638, 1926.14954, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
- CreateObject(638, 1923.47974, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
- CreateObject(638, 1920.81982, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
- CreateObject(638, 1918.15869, -1786.07776, 13.22687, 0.00000, 0.00000, 90.00000);
- CreateObject(638, 1915.70862, -1786.07776, 13.21687, 0.00000, 0.00000, 90.00000);
- CreateObject(3657, 1923.41235, -1767.50598, 12.98687, 0.00000, 0.00000, 0.00000);
- CreateObject(3657, 1920.09302, -1780.10791, 12.98687, 0.00000, 0.00000, 1.50000);
- CreateObject(3657, 1917.75244, -1785.18591, 12.98687, 0.00000, 0.00000, 180.00000);
- CreateObject(3657, 1923.41235, -1785.18652, 12.98687, 0.00000, 0.00000, 180.00000);
- CreateObject(3515, 1920.14966, -1776.90234, 11.97686, 0.00000, 0.00000, 0.00000);
- CreateObject(19304, 1920.01746, -1774.35498, 12.86280, 0.00000, 0.00000, 1.10000);
- CreateObject(19304, 1920.01953, -1779.44495, 12.86280, 0.00000, 0.00000, 1.90000);
- CreateObject(19304, 1917.40759, -1776.86548, 12.86280, 0.00000, 0.00000, 90.00000);
- CreateObject(19304, 1922.56641, -1776.86548, 12.86280, 0.00000, 0.00000, 90.00000);
- CreateObject(3657, 1917.75244, -1767.48584, 12.98687, 0.00000, 0.00000, 0.00000);
- CreateObject(3657, 1920.09302, -1780.10791, 12.98687, 0.00000, 0.00000, 1.50000);
- CreateObject(3657, 1920.09326, -1773.73816, 12.98687, 0.00000, 0.00000, -179.19998);
- CreateObject(3657, 1923.09241, -1776.80762, 12.98687, 0.00000, 0.00000, 90.00000);
- CreateObject(3657, 1916.82324, -1776.89807, 12.98687, 0.00000, 0.00000, -89.89999);
- CreateObject(628, 1917.47778, -1774.25671, 14.48688, 0.00000, 0.00000, 130.69997);
- CreateObject(628, 1922.73438, -1773.92786, 14.48688, 0.00000, 0.00000, 41.29998);
- CreateObject(628, 1922.81885, -1779.53015, 14.48688, 0.00000, 0.00000, -18.70002);
- CreateObject(628, 1917.30359, -1779.75232, 14.48688, 0.00000, 0.00000, -136.50002);
- CreateObject(1536, 1900.93530, -1777.19812, 12.54690, 0.00000, 0.00000, 90.00000);
- CreateObject(1676, 1940.22900, -1776.39075, 13.89281, 0.00000, 0.00000, 90.00000);
- CreateObject(1676, 1940.22900, -1769.32007, 13.89281, 0.00000, 0.00000, 90.00000);
- CreateObject(19304, 1941.04785, -1776.01440, 12.55280, 0.00000, 0.00000, 90.00000);
- CreateObject(19304, 1941.04785, -1772.53418, 12.55280, 0.00000, 0.00000, 90.00000);
- CreateObject(19304, 1941.04785, -1769.83276, 12.55280, 0.00000, 0.00000, 90.00000);
- CreateObject(19304, 1939.49731, -1769.90393, 12.55280, 0.00000, 0.00000, 90.00000);
- CreateObject(19304, 1939.49731, -1773.37402, 12.55280, 0.00000, 0.00000, 90.00000);
- CreateObject(19304, 1939.49731, -1775.89490, 12.55280, 0.00000, 0.00000, 90.00000);
- CreateObject(1361, 1940.23840, -1778.36450, 12.87686, 0.00000, 0.00000, 0.00000);
- CreateObject(1361, 1940.23840, -1767.62451, 12.87686, 0.00000, 0.00000, 0.00000);
- CreateObject(6958, 1940.49646, -1773.03503, 20.91687, 0.00000, 0.00000, 0.00000);
- CreateObject(11417, 1940.28088, -1772.99634, 17.11281, 0.00000, 0.00000, -45.10001);
- CreateObject(1412, 1900.86987, -1762.39783, 13.79230, 0.00000, 0.00000, 0.51010);
- CreateObject(1412, 1906.14221, -1762.34680, 13.79230, 0.00000, 0.00000, 0.51010);
- CreateObject(1412, 1917.06885, -1762.26270, 13.79230, 0.00000, 0.00000, 0.51010);
- CreateObject(1412, 1922.60889, -1762.23621, 13.79230, 0.00000, 0.00000, 0.51010);
- CreateObject(1412, 1928.15308, -1762.18884, 13.79230, 0.00000, 0.00000, 0.51010);
- CreateObject(3633, 1902.44336, -1764.61243, 13.98450, 0.00000, 0.00000, 0.00000);
- CreateObject(3633, 1902.44336, -1764.61243, 13.02890, 0.00000, 0.00000, 0.00000);
- CreateObject(3632, 1941.77197, -1778.65820, 12.84090, 0.00000, 0.00000, 0.00000);
- CreateObject(3632, 1941.31543, -1779.30273, 12.84090, 0.00000, 0.00000, 0.00000);
- CreateObject(925, 1901.77673, -1785.73425, 13.57390, 0.00000, 0.00000, 90.01359);
- CreateObject(925, 1901.88110, -1789.45569, 13.57390, 0.00000, 0.00000, 90.01359);
- CreateObject(1222, 1902.19812, -1780.19250, 12.98960, 0.00000, 0.00000, 0.00000);
- CreateObject(1222, 1903.16638, -1780.45349, 12.98960, 0.00000, 0.00000, 0.00000);
- CreateObject(1222, 1902.83459, -1779.60364, 12.98960, 0.00000, 0.00000, 0.00000);
- //------------------------------------------------------------------------//
- JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 0 ] ] = 0; JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 1 ] ]= 0;
- JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 2 ] ] = 0; JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 3 ] ]= 0;
- JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 4 ] ] = 0; JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[ 5 ] ]= 0;
- DELIVERER_VEHICLES[ 0 ] = CreateVehicle(578,1914.7301,-1793.1829,13.5069,330.3089,3,3,60000,0);
- DELIVERER_VEHICLES[ 1 ] = CreateVehicle(578,1918.4766,-1794.1277,13.5067,329.4436,3,3,60000,0);
- DELIVERER_VEHICLES[ 2 ] = CreateVehicle(578,1922.5284,-1794.1038,13.5070,329.2636,3,3,60000,0);
- DELIVERER_VEHICLES[ 3 ] = CreateVehicle(578,1926.5687,-1794.2007,13.5078,330.4030,3,3,60000,0);
- DELIVERER_VEHICLES[ 4 ] = CreateVehicle(578,1933.0986,-1784.5759,13.5075,0.5458,3,3,60000,0);
- DELIVERER_VEHICLES[ 5 ] = CreateVehicle(578,1932.8470,-1770.1198,13.5072,180.5444,3,3,60000,0);
- //------------------------------------------------------------------------//
- PosaoTD = TextDrawCreate(119.500000, 165.125000, "usebox");
- TextDrawLetterSize(PosaoTD, 0.000000, 15.044445);
- TextDrawTextSize(PosaoTD, 34.500000, 0.000000);
- TextDrawAlignment(PosaoTD, 1);
- TextDrawColor(PosaoTD, 0);
- TextDrawUseBox(PosaoTD, true);
- TextDrawBoxColor(PosaoTD, 102);
- TextDrawSetShadow(PosaoTD, 0);
- TextDrawSetOutline(PosaoTD, 0);
- TextDrawFont(PosaoTD, 0);
- PosaoTD1 = TextDrawCreate(41.000000, 168.187500, "usebox");
- TextDrawLetterSize(PosaoTD1, 0.000000, 14.262499);
- TextDrawTextSize(PosaoTD1, 112.500000, 0.000000);
- TextDrawAlignment(PosaoTD1, 1);
- TextDrawColor(PosaoTD1, 0);
- TextDrawUseBox(PosaoTD1, true);
- TextDrawBoxColor(PosaoTD1, 255);
- TextDrawSetShadow(PosaoTD1, 0);
- TextDrawSetOutline(PosaoTD1, 0);
- TextDrawFont(PosaoTD1, 0);
- PosaoTD2 = TextDrawCreate(47.000000, 170.187500, "FUEL DELIVERER");
- TextDrawLetterSize(PosaoTD2, 0.132500, 0.738125);
- TextDrawAlignment(PosaoTD2, 1);
- TextDrawColor(PosaoTD2, -1);
- TextDrawSetShadow(PosaoTD2, 0);
- TextDrawSetOutline(PosaoTD2, 1);
- TextDrawBackgroundColor(PosaoTD2, 51);
- TextDrawFont(PosaoTD2, 2);
- TextDrawSetProportional(PosaoTD2, 1);
- PosaoTD3 = TextDrawCreate(43.000000, 175.875000, "-------------------------");
- TextDrawLetterSize(PosaoTD3, 0.204500, 0.790626);
- TextDrawAlignment(PosaoTD3, 1);
- TextDrawColor(PosaoTD3, -5963521);
- TextDrawUseBox(PosaoTD3, true);
- TextDrawBoxColor(PosaoTD3, 0);
- TextDrawSetShadow(PosaoTD3, 0);
- TextDrawSetOutline(PosaoTD3, 1);
- TextDrawBackgroundColor(PosaoTD3, 51);
- TextDrawFont(PosaoTD3, 2);
- TextDrawSetProportional(PosaoTD3, 1);
- PosaoTD4 = TextDrawCreate(50.000000, 197.750000, "ACCEPT THIS JOB");
- TextDrawLetterSize(PosaoTD4, 0.148499, 0.777500);
- TextDrawAlignment(PosaoTD4, 1);
- TextDrawColor(PosaoTD4, -1);
- TextDrawSetShadow(PosaoTD4, 0);
- TextDrawSetOutline(PosaoTD4, 1);
- TextDrawBackgroundColor(PosaoTD4, 51);
- TextDrawFont(PosaoTD4, 2);
- TextDrawSetProportional(PosaoTD4, 1);
- TextDrawSetSelectable(PosaoTD4, true);
- PosaoTD5 = TextDrawCreate(59.000000, 217.437500, "REFUSE IT");
- TextDrawLetterSize(PosaoTD5, 0.147499, 0.786250);
- TextDrawAlignment(PosaoTD5, 1);
- TextDrawColor(PosaoTD5, -1);
- TextDrawSetShadow(PosaoTD5, 0);
- TextDrawSetOutline(PosaoTD5, 1);
- TextDrawBackgroundColor(PosaoTD5, 51);
- TextDrawFont(PosaoTD5, 2);
- TextDrawSetProportional(PosaoTD5, 1);
- TextDrawSetSelectable(PosaoTD5, true);
- PosaoTD6 = TextDrawCreate(43.000000, 249.812500, "EARNS:~y~PER LOCATION + BONUS");
- TextDrawLetterSize(PosaoTD6, 0.104500, 0.580626);
- TextDrawAlignment(PosaoTD6, 1);
- TextDrawColor(PosaoTD6, -1);
- TextDrawSetShadow(PosaoTD6, 0);
- TextDrawSetOutline(PosaoTD6, 1);
- TextDrawBackgroundColor(PosaoTD6, 51);
- TextDrawFont(PosaoTD6, 2);
- TextDrawSetProportional(PosaoTD6, 1);
- //------------------------------------------------------------------------//
- return 1;
- }
- //----------------------------------------------------------------------------//
- public OnFilterScriptExit( )
- {
- print("|--------------------------------------|");
- print(" Fuel Deliverer by Bolex_! Closed!");
- print("|--------------------------------------|");
- Delete3DTextLabel(JOB_T); Delete3DTextLabel(LOADING_P);
- DestroyPickup(JobPick); DestroyPickup(LoadingPick);
- DestroyVehicle(JOB_DELIVERER_VEHICLES[ 0 ]); DestroyVehicle(JOB_DELIVERER_VEHICLES[ 1 ]);
- DestroyVehicle(JOB_DELIVERER_VEHICLES[ 2 ]); DestroyVehicle(JOB_DELIVERER_VEHICLES[ 3 ]);
- DestroyVehicle(JOB_DELIVERER_VEHICLES[ 4 ]); DestroyVehicle(JOB_DELIVERER_VEHICLES[ 5 ]);
- return 1;
- }
- //----------------------------------------------------------------------------//
- PreloadAnimLib(playerid, animlib[])
- {
- ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
- }
- public OnPlayerConnect( playerid )
- {
- PreloadAnimLib(playerid,"CARRY"); PreloadAnimLib(playerid,"DEALER");
- JobActive[ playerid ] =0; JobBonus[ playerid ] =0; JobEarnings[ playerid ] =0; PlayerEquipment[ playerid ] =0;
- PlayerCP[ playerid ] = NEGATIVE_LOKACIJA;
- //---//
- RemoveBuildingForPlayer(playerid, 5535, 1918.8516, -1776.3281, 16.9766, 0.25);
- RemoveBuildingForPlayer(playerid, 1524, 1910.1641, -1779.6641, 18.7500, 0.25);
- RemoveBuildingForPlayer(playerid, 5681, 1921.4844, -1778.9141, 18.5781, 0.25);
- RemoveBuildingForPlayer(playerid, 5409, 1918.8516, -1776.3281, 16.9766, 0.25);
- RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1778.4531, 14.1406, 0.25);
- RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1774.3125, 14.1406, 0.25);
- RemoveBuildingForPlayer(playerid, 955, 1928.7344, -1772.4453, 12.9453, 0.25);
- RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1771.3438, 14.1406, 0.25);
- RemoveBuildingForPlayer(playerid, 1676, 1941.6563, -1767.2891, 14.1406, 0.25);
- RemoveBuildingForPlayer(playerid, 1226, 1955.6641, -1793.0938, 16.3906, 0.25);
- //---//
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- JobActive[ playerid ] =0; JobBonus[ playerid ] =0; JobEarnings[ playerid ] =0; PlayerEquipment[ playerid ] =0; HidePJobInfo( playerid );
- PlayerCP[ playerid ] = NEGATIVE_LOKACIJA;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(JobActive[ playerid ] == 1)
- {
- JobActive[ playerid ] =0; JobBonus[ playerid ] =0; JobEarnings[ playerid ] =0; PlayerEquipment[ playerid ] =0;
- PlayerCP[ playerid ] =NEGATIVE_LOKACIJA;
- DisablePlayerCheckpoint( playerid );
- HidePJobInfo( playerid );
- SCM(playerid, 0x48977996,"[JOB]: {FFFFFF}You left the vehicle and the job is done!");
- }
- return 1;
- }
- CMD:takefuel(playerid, params[])
- {
- if(JobActive[ playerid ] == 1)
- {
- if(IsPlayerInRangeOfPoint(playerid,3.0, 1938.2350,-1773.1140,13.3828))
- {
- if(GetPlayerState( playerid ) == PLAYER_STATE_DRIVER)
- {
- if(JOB_DELIVERER_VEHICLES[GetPlayerVehicleID( playerid )] == 0)
- {
- new string[56];
- JOB_DELIVERER_VEHICLES[GetPlayerVehicleID( playerid )]=5;
- SCM(playerid, 0x48977996,"[FUEL]: {FFFFFF}Fuel gas been loaded, submit it to the location on the map!");
- object = CreateObject( 2935,0,0,0,0,0,0,80 );
- AttachObjectToVehicle( object, GetPlayerVehicleID(playerid), 0.000000, -1.300000, 1.200000, 0.000000, 0.000000, 0.000000 );
- PlayerTextDrawHide(playerid,DelivererInfo[ playerid ]);
- format(string,sizeof(string),"TO DELIVERED: ~y~%d/5",JOB_DELIVERER_VEHICLES[GetPlayerVehicleID( playerid )]);
- PlayerTextDrawSetString(playerid,DelivererInfo[ playerid ],string);
- PlayerTextDrawShow(playerid,DelivererInfo[ playerid ]);
- }
- else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}the vehicle got another fuel they have to be deliver!");
- }
- else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You must be in vehicle!");
- }
- else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You're not with the vehicle in place for taking fuel!");
- }
- else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You dont do any kind of job!");
- return 1;
- }
- CMD:endjob(playerid, params[])
- {
- if(JobActive[ playerid ] == 1)
- {
- new string[128];
- GivePlayerMoney(playerid,JobEarnings[ playerid ]+JobBonus[ playerid ]);
- format(string,sizeof(string),"[INFO]: {FFFFFF}You earned %d$ after job completion!",JobEarnings[ playerid ]+JobBonus[ playerid ]);
- SCM(playerid,0x48977996,string);
- JobEarnings[ playerid ] =0; JobBonus[ playerid ] =0; JobActive[ playerid ] =0; PlayerEquipment[ playerid ] =0;
- if(IsPlayerAttachedObjectSlotUsed(playerid, DELIVERER_BR)) { RemovePlayerAttachedObject(playerid, DELIVERER_BR); }
- PlayerCP[ playerid ]= NEGATIVE_LOKACIJA;
- HidePJobInfo( playerid );
- JOB_DELIVERER_VEHICLES[GetPlayerVehicleID( playerid )]=0;
- SetVehicleToRespawn(GetPlayerVehicleID( playerid ));
- RemovePlayerFromVehicle( playerid );
- SetPlayerSkin(playerid,PlayerEquipment[ playerid ]);
- DisablePlayerCheckpoint( playerid );
- DestroyObject(object);
- }
- else SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You are not employed as the delivery of fuel!");
- return 1;
- }
- CMD:takef(playerid, params[])
- {
- if(JobActive[ playerid ] == 1)
- {
- if(!IsPlayerAttachedObjectSlotUsed(playerid, DELIVERER_BR))
- {
- if(GetPlayerState( playerid ) == PLAYER_STATE_ONFOOT)
- {
- new Float:X,Float:Y,Float:Z;
- for( new j=0;j<6;j++ )
- {
- GetVehiclePos( DELIVERER_VEHICLES[j],X,Y,Z );
- if(IsPlayerInRangeOfPoint( playerid,3.0,X,Y,Z ))
- {
- if(JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[j]] >= 1)
- {
- JOB_DELIVERER_VEHICLES[ DELIVERER_VEHICLES[j]]--;
- ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,1,1,1,1,1);
- SetPlayerAttachedObject( playerid, DELIVERER_BR, 3632, 1, 0.002953, 0.469660, -0.009797, 269.851104, 88.443557, 0.000000, 0.804894, 1.000000, 0.822361 );
- SCM(playerid,-1,"{E10000}(Info): {FFFFFF}Deliver a fuel on the red marker!");
- return 1;
- }
- else
- {
- SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You have no more fuel, take new one!");
- return 1;
- }
- }
- }
- }
- else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You need to get out of the vehicle!");
- }
- else return SCM(playerid,-1," {E10000}(Info): {FFFFFF}You've already got one bottle of fuel!");
- }
- return 1;
- }
- CMD:test(playerid, params[])
- {
- SetPlayerPos(playerid, 1935.1696,-1794.7130,13.5469); //Teleportation to the job, remove it
- return 1;
- }
- public PJobInfo( playerid )
- {
- new string[56];
- format(string,sizeof(string),"TO DELIVERED: ~y~%d/5",JOB_DELIVERER_VEHICLES[GetPlayerVehicleID(playerid)]);
- DelivererInfo[ playerid ] = CreatePlayerTextDraw(playerid,524.500000, 125.562500, string);
- PlayerTextDrawBackgroundColor(playerid,DelivererInfo[ playerid ], 51);
- PlayerTextDrawFont(playerid,DelivererInfo[ playerid ], 2);
- PlayerTextDrawLetterSize(playerid,DelivererInfo[ playerid ], 0.155000, 0.716250);
- PlayerTextDrawColor(playerid,DelivererInfo[ playerid ], -1);
- PlayerTextDrawSetOutline(playerid,DelivererInfo[ playerid ], 1);
- PlayerTextDrawSetProportional(playerid,DelivererInfo[ playerid ], 1);
- PlayerTextDrawSetSelectable(playerid,DelivererInfo[ playerid ], 0);
- BarrelPrew[ playerid ] = CreatePlayerTextDraw(playerid,497.500000, 140.000000, " ");
- PlayerTextDrawFont(playerid,BarrelPrew[ playerid ], 5);
- PlayerTextDrawLetterSize(playerid,BarrelPrew[ playerid ], 0.449999, 1.600000);
- PlayerTextDrawColor(playerid,BarrelPrew[ playerid ], -1);
- PlayerTextDrawSetOutline(playerid,BarrelPrew[ playerid ], 0);
- PlayerTextDrawSetProportional(playerid,BarrelPrew[ playerid ], 1);
- PlayerTextDrawSetShadow(playerid,BarrelPrew[ playerid ], 0);
- PlayerTextDrawBackgroundColor(playerid,BarrelPrew[ playerid ], 0x00000000);
- PlayerTextDrawBoxColor(playerid,BarrelPrew[ playerid ], 45312);
- PlayerTextDrawTextSize(playerid,BarrelPrew[ playerid ], 28.500000, -21.437500);
- PlayerTextDrawSetSelectable(playerid,BarrelPrew[ playerid ], 0);
- PlayerTextDrawSetPreviewModel(playerid,BarrelPrew[ playerid ],3632);
- PlayerTextDrawSetPreviewRot(playerid,BarrelPrew[ playerid ],216.000000, 0.000000, 0.000000, 1.000000);
- format(string,sizeof(string),"EARNINGS: ~y~%d~g~$",JobEarnings[ playerid ]);
- EarningsInfo[ playerid ] = CreatePlayerTextDraw(playerid,527.000000, 139.125000, string);
- PlayerTextDrawBackgroundColor(playerid,EarningsInfo[ playerid ], 51);
- PlayerTextDrawFont(playerid,EarningsInfo[ playerid ], 2);
- PlayerTextDrawLetterSize(playerid,EarningsInfo[ playerid ], 0.154500, 0.589376);
- PlayerTextDrawColor(playerid,EarningsInfo[ playerid ], -1);
- PlayerTextDrawSetOutline(playerid,EarningsInfo[ playerid ], 1);
- PlayerTextDrawSetProportional(playerid,EarningsInfo[ playerid ], 1);
- PlayerTextDrawSetSelectable(playerid,EarningsInfo[ playerid ], 0);
- format(string,sizeof(string),"BONUS: ~y~+%d~g~$",JobBonus[ playerid ]);
- BonusInfo[ playerid ] = CreatePlayerTextDraw(playerid,533.000000, 145.250000, string);
- PlayerTextDrawBackgroundColor(playerid,BonusInfo[ playerid ], 51);
- PlayerTextDrawFont(playerid,BonusInfo[ playerid ], 2);
- PlayerTextDrawLetterSize(playerid,BonusInfo[ playerid ], 0.150000, 0.589375);
- PlayerTextDrawColor(playerid,BonusInfo[ playerid ], -1);
- PlayerTextDrawSetOutline(playerid,BonusInfo[ playerid ], 1);
- PlayerTextDrawSetProportional(playerid,BonusInfo[ playerid ], 1);
- PlayerTextDrawSetSelectable(playerid,BonusInfo[ playerid ], 0);
- format(string,sizeof(string),"TOTAL EARN: ~y~%d~g~$",JobEarnings[ playerid ]+JobBonus[ playerid ]);
- TotalEarnInfo[ playerid ] = CreatePlayerTextDraw(playerid,554.500000, 166.687500, string);
- PlayerTextDrawBackgroundColor(playerid,TotalEarnInfo[ playerid ], 51);
- PlayerTextDrawFont(playerid,TotalEarnInfo[ playerid ], 1);
- PlayerTextDrawLetterSize(playerid,TotalEarnInfo[ playerid ], 0.140000, 0.698750);
- PlayerTextDrawColor(playerid,TotalEarnInfo[ playerid ], -1);
- PlayerTextDrawSetOutline(playerid,TotalEarnInfo[ playerid ], 1);
- PlayerTextDrawSetProportional(playerid,TotalEarnInfo[ playerid ], 1);
- PlayerTextDrawSetSelectable(playerid,TotalEarnInfo[ playerid ], 0);
- PlayerTextDrawAlignment(playerid,TotalEarnInfo[ playerid ], 2);
- Info0 = TextDrawCreate(495.500000, 116.125000, "usebox");
- TextDrawLetterSize(Info0, 0.000000, 6.780555);
- TextDrawTextSize(Info0, 615.000000, 0.000000);
- TextDrawAlignment(Info0, 1);
- TextDrawColor(Info0, 0);
- TextDrawUseBox(Info0, true);
- TextDrawBoxColor(Info0, 102);
- TextDrawSetShadow(Info0, 0);
- TextDrawSetOutline(Info0, 0);
- TextDrawFont(Info0, 0);
- Info1 = TextDrawCreate(496.000000, 103.875000, "usebox");
- TextDrawLetterSize(Info1, 0.000000, 0.995833);
- TextDrawTextSize(Info1, 614.500000, 0.000000);
- TextDrawAlignment(Info1, 1);
- TextDrawColor(Info1, 0);
- TextDrawUseBox(Info1, true);
- TextDrawBoxColor(Info1, 102);
- TextDrawSetShadow(Info1, 0);
- TextDrawSetOutline(Info1, 0);
- TextDrawFont(Info1, 0);
- Info2 = TextDrawCreate(616.000000, 114.187500, "LD_SPAC:white");
- TextDrawLetterSize(Info2, 0.000000, 0.000000);
- TextDrawTextSize(Info2, -121.500000, 0.437500);
- TextDrawAlignment(Info2, 1);
- TextDrawColor(Info2, -5963521);
- TextDrawSetShadow(Info2, 0);
- TextDrawSetOutline(Info2, 0);
- TextDrawBackgroundColor(Info2, -5963521);
- TextDrawFont(Info2, 4);
- Info3 = TextDrawCreate(510.000000, 103.687500, "INFO - FUEL DELIVERER");
- TextDrawLetterSize(Info3, 0.212500, 0.926251);
- TextDrawAlignment(Info3, 1);
- TextDrawColor(Info3, -1);
- TextDrawSetShadow(Info3, 0);
- TextDrawSetOutline(Info3, 1);
- TextDrawBackgroundColor(Info3, 51);
- TextDrawFont(Info3, 2);
- TextDrawSetProportional(Info3, 1);
- Info4 = TextDrawCreate(523.500000, 172.375000, "IIIIIIIIIIIIIIIIIIIIIIIII");
- TextDrawLetterSize(Info4, 0.187999, 0.768750);
- TextDrawAlignment(Info4, 1);
- TextDrawColor(Info4, -5963521);
- TextDrawUseBox(Info4, true);
- TextDrawBoxColor(Info4, 0);
- TextDrawSetShadow(Info4, 0);
- TextDrawSetOutline(Info4, 1);
- TextDrawBackgroundColor(Info4, 51);
- TextDrawFont(Info4, 2);
- TextDrawSetProportional(Info4, 1);
- Info5 = TextDrawCreate(575.000000, 122.937500, "New Textdraw");
- TextDrawLetterSize(Info5, 0.449999, 1.600000);
- TextDrawTextSize(Info5, 48.500000, 43.750000);
- TextDrawAlignment(Info5, 1);
- TextDrawColor(Info5, -1);
- TextDrawBoxColor(Info5, 0x00000000);
- TextDrawBackgroundColor(Info5, 0x00000000);
- TextDrawSetShadow(Info5, 0);
- TextDrawSetOutline(Info5, 1);
- TextDrawFont(Info5, 5);
- TextDrawSetProportional(Info5, 1);
- TextDrawSetPreviewModel(Info5, 578);
- TextDrawSetPreviewRot(Info5, 1.000000, 1.000000, 315.000000, 1.000000);
- TextDrawShowForPlayer(playerid, Info0); TextDrawShowForPlayer(playerid, Info1);
- TextDrawShowForPlayer(playerid, Info2); TextDrawShowForPlayer(playerid, Info3);
- TextDrawShowForPlayer(playerid, Info4); TextDrawShowForPlayer(playerid, Info5);
- PlayerTextDrawShow(playerid, DelivererInfo[ playerid ]);
- PlayerTextDrawShow(playerid, BarrelPrew[ playerid ]);
- PlayerTextDrawShow(playerid, EarningsInfo[ playerid ]);
- PlayerTextDrawShow(playerid, TotalEarnInfo[ playerid ]);
- PlayerTextDrawShow(playerid, BonusInfo[ playerid ]);
- return 1;
- }
- public HidePJobInfo( playerid )
- {
- TextDrawHideForPlayer(playerid, Info0); TextDrawHideForPlayer(playerid, Info1); TextDrawHideForPlayer(playerid, Info2);
- TextDrawHideForPlayer(playerid, Info3); TextDrawHideForPlayer(playerid, Info4); TextDrawHideForPlayer(playerid, Info5);
- PlayerTextDrawDestroy(playerid, DelivererInfo[ playerid ]);
- PlayerTextDrawDestroy(playerid, BarrelPrew[ playerid ]);
- PlayerTextDrawDestroy(playerid, EarningsInfo[ playerid ]);
- PlayerTextDrawDestroy(playerid, TotalEarnInfo[ playerid ]);
- PlayerTextDrawDestroy(playerid, BonusInfo[ playerid ]);
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid, DELIVERER_BR))
- {
- RemovePlayerFromVehicle( playerid );
- SetPlayerArmedWeapon( playerid, 0);
- ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,1,1,1,1,1);
- }
- new VID = GetPlayerVehicleID( playerid );
- if(VID == DELIVERER_VEHICLES[ 0 ] || VID == DELIVERER_VEHICLES[ 1 ] || VID == DELIVERER_VEHICLES[ 2 ] || VID == DELIVERER_VEHICLES[ 3 ] || VID == DELIVERER_VEHICLES[ 4 ] || VID == DELIVERER_VEHICLES[ 5 ])
- {
- if(JobActive[ playerid ] == 1)
- {
- PJobInfo( playerid );
- if(PlayerCP[ playerid ] == NEGATIVE_LOKACIJA)
- {
- new rand = random(sizeof(LOCATIONS));
- new oprema = random(311)+1;
- if(oprema == 74) return oprema=75;
- SetPlayerCheckpoint(playerid, LOCATIONS[rand][ 0 ], LOCATIONS[rand][ 1 ], LOCATIONS[rand][ 2 ],2.0);
- PlayerCP[ playerid ] = LOCATION;
- }
- }
- else
- {
- SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You are not employed as the delivery of fuel!");
- RemovePlayerFromVehicle( playerid );
- }
- }
- }
- else if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER) { HidePJobInfo( playerid ); }
- return 1;
- }
- public OnPlayerEnterCheckpoint( playerid )
- {
- if(PlayerCP[ playerid ] == LOCATION)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid, DELIVERER_BR))
- {
- new string[128];
- new bon=random( DELIVERER_BONUS + 15 );
- JobBonus[ playerid ]+=bon;
- JobEarnings[ playerid ]+=EARNINGS_BY_LOCATION;
- format(string,sizeof(string),"[INFO]: {FFFFFF}You earned %d$ with bounus %d$ for delivered a bottle of fuel!", EARNINGS_BY_LOCATION, bon);
- SCM(playerid, 0x48977996,string);
- RemovePlayerAttachedObject(playerid, DELIVERER_BR);
- PlayerCP[ playerid ] = NEGATIVE_LOKACIJA;
- DisablePlayerCheckpoint( playerid );
- ClearAnimations( playerid );
- }
- else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You need to take a bottle of fuel from the vehicle in order deliver at this location!");
- }
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == JobPick)
- {
- TextDrawShowForPlayer(playerid, PosaoTD); TextDrawShowForPlayer(playerid, PosaoTD1); TextDrawShowForPlayer(playerid, PosaoTD2); TextDrawShowForPlayer(playerid, PosaoTD3);
- TextDrawShowForPlayer(playerid, PosaoTD4); TextDrawShowForPlayer(playerid, PosaoTD5); TextDrawShowForPlayer(playerid, PosaoTD6);
- SelectTextDraw(playerid, 0xA3B4C5FF);
- }
- return 1;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(_:clickedid != INVALID_TEXT_DRAW)
- {
- if(clickedid == PosaoTD4)
- {
- if(IsPlayerInRangeOfPoint(playerid,3.0, 1902.5525,-1776.3734,13.5469))
- {
- if(JobActive[ playerid ] == 0)
- {
- new string[235];
- format(string, sizeof(string),"{FF7E19}Congratulations! {FFFFFF}You've just got a job Fuel Deliverer!\n\nIn this job it is necessary to provide fuel at certain locations after loading\n{FF7E19}Job commands: {FFFFFF}/takef /takefuel /endjob");
- SPD(playerid, D_JHELP, DIALOG_STYLE_MSGBOX, "Fuel Deliverer Job", string, "Ok", "");
- SCM(playerid, -1,"{E10000}(Info): {FFFFFF}Get in you'r vehicle in order to continue with the job!");
- JobActive[ playerid ] = 1;
- PlayerEquipment[ playerid ] = GetPlayerSkin( playerid );
- SetPlayerSkin( playerid, 8 );
- }
- else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You've already work as Fuel Deliverer!");
- }
- else return SCM(playerid,-1,"{E10000}(Info): {FFFFFF}You'r not in place for taking job!");
- }
- else if(clickedid == PosaoTD5)
- {
- TextDrawHideForPlayer(playerid, PosaoTD5);
- }
- TextDrawHideForPlayer(playerid, PosaoTD); TextDrawHideForPlayer(playerid, PosaoTD1); TextDrawHideForPlayer(playerid, PosaoTD2); TextDrawHideForPlayer(playerid, PosaoTD3);
- TextDrawHideForPlayer(playerid, PosaoTD4); TextDrawHideForPlayer(playerid, PosaoTD5); TextDrawHideForPlayer(playerid, PosaoTD6);
- CancelSelectTextDraw( playerid );
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(PRESSED(KEY_FIRE))
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid, DELIVERER_BR))
- {
- ApplyAnimation(playerid,"CARRY","crry_prtial",4.1,1,1,1,1,1,1);
- SetPlayerArmedWeapon( playerid, 0 );
- }
- }
- return 1;
- }
- #endif
Add Comment
Please, Sign In to add comment