Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define COLOR_RED 0xFF0000AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define Checkpoint1 -1253.9714,238.6661,14.1484
- #define Checkpoint2 1855.2505,-2494.0652,13.5547
- #define ResetMoneyBar ResetPlayerMoney
- #define UpdateMoneyBar GivePlayerMoney
- new flyjobrunning = 0;
- new info;
- enum pInfo
- {
- pCash,
- pBank,
- pJob,
- };
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //==============================================================================
- if(IsPlayerConnected(playerid))
- {
- new string3[128];
- format(string3, sizeof(string3), "Inferno Roleplay/Accounts/%s.ini", PlayerName(playerid));
- new File: hFile = fopen(string3, io_write);
- if (hFile)
- {
- strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
- new var[32];
- format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
- PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
- format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
- //==============================================================================
- public OnFilterScriptInit()
- {
- AddStaticVehicle(519,1729.8932,-2415.7798,14.4727,149.2040,1,1); //
- info = CreatePickup(1239,1,1748.7014,-2421.0500,13.5547,-1);
- }
- stock GivePlayerCash(playerid, money)
- {
- PlayerInfo[playerid][pCash] += money;
- UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);
- return PlayerInfo[playerid][pCash];
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/startflight", cmdtext, true, 10) == 0)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 519)
- {
- flyjobrunning = 1;
- SetPlayerCheckpoint(playerid, Checkpoint1, 3.0);
- GameTextForPlayer(playerid, "~g~You started the job, good luck!", 3000, 3);
- new name[MAX_PLAYER_NAME], string[48];
- flyjobrunning = 1;
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s is now delivering goods with a plane.", name );
- SendClientMessageToAll(COLOR_RED, string);
- return 1;
- }
- SendClientMessage(playerid, COLOR_RED,"You have to be in the jobplane to start the job");
- }
- if (strcmp("/flyinfo", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "You need to bring the planeload to the airport in San Fierro.");
- SendClientMessage(playerid, COLOR_YELLOW, "There they will reward you for your help.");
- SendClientMessage(playerid, COLOR_YELLOW, "If you enter the truck, type /startflight and a red marker will appear.");
- SendClientMessage(playerid, COLOR_YELLOW, "Just fly to the marker and you're done.");
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 519)
- {
- if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint1))
- {
- SetPlayerCheckpoint(playerid, Checkpoint2, 7.0);
- GameTextForPlayer(playerid, "~g~Now fly back to Los Santos Airport to collect your paycheck.", 3000, 3);
- }
- if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint2))
- {
- GivePlayerCash(playerid, 1000);
- GameTextForPlayer(playerid, "~g~You Completed the job, well done!", 3000, 3);
- SetVehicleToRespawn(1);
- DisablePlayerCheckpoint(playerid);
- flyjobrunning = 0;
- }
- }
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 519)
- {
- SendClientMessage(playerid, COLOR_RED, "You can start the Fly job with /startflight");
- }
- return 0;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- if((flyjobrunning) == 1)
- {
- flyjobrunning = 0;
- SendClientMessage(playerid, COLOR_RED, "You left the plane, you failed the job.");
- }else if((flyjobrunning) == 0){
- //Nothing
- }
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- DisablePlayerCheckpoint(playerid);
- flyjobrunning = 0;
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == info)
- {
- GameTextForPlayer(playerid, "~g~Welcome at the Fly job, use /flyinfo to know more", 3000, 3);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement