Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #define COLOR_DARKORANGE 0xFF3F00AA
- new fishes[MAX_PLAYERS];
- new fishprogress[MAX_PLAYERS];
- forward fishtimer(playerid);
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- AddStaticVehicleEx(453,2937.2935,-2062.6792,-0.1762,180.7421,56,56,15000); // boatwerk1
- AddStaticVehicleEx(453,2930.7781,-2063.4063,-0.2910,179.4181,56,56,15000); // boatwerk2
- AddStaticVehicleEx(453,2930.5361,-2043.3026,-0.5164,358.8169,56,56,15000); // boatwerk3
- AddStaticVehicleEx(453,2936.2163,-2043.3353,-0.5593,358.6886,56,56,15000); // boatwerk4
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- COMMAND:gotofish(playerid,params[])
- {
- SetPlayerPos(playerid,2941.1365,-2051.7290,3.5480);
- return 1;
- }
- COMMAND:fish(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid, 7.0, 2941.1365,-2051.7290,3.5480)) return SendClientMessage(playerid,COLOR_DARKORANGE,"You're not at the fishing place");
- if(fishprogress[playerid] > 0) return SendClientMessage(playerid,COLOR_DARKORANGE,"You're already doing this job!");
- else
- fishprogress[playerid] = 1;
- SendClientMessage(playerid,COLOR_DARKORANGE,"You've started your fishing job. Take a boat and go to the checkpoints!");
- SetPlayerCheckpoint(playerid,3019.4819,-1259.1970,0.8884,4.0);
- return 1;
- }
- COMMAND:fishes(playerid,params[])
- {
- new string[100];
- format(string,sizeof(string),"You have %d fishes",fishes[playerid]);
- SendClientMessage(playerid,COLOR_DARKORANGE,string);
- return 1;
- }
- stock IsPlayerInRangeOfFishCP(playerid)
- {
- if(IsPlayerInRangeOfPoint(playerid,4.0,3215.4434,-1035.6681,0.7980)||IsPlayerInRangeOfPoint(playerid,4.0,3019.4819,-1259.1970,0.8884)||IsPlayerInRangeOfPoint(playerid,4.0,3115.2380,-511.2403,0.9685))
- {
- return 1;
- }
- else if(IsPlayerInRangeOfPoint(playerid,4.0,2979.5803,-8.0016,1.4147)||IsPlayerInRangeOfPoint(playerid,4.0,2488.8032,472.4902,0.8335)||IsPlayerInRangeOfPoint(playerid,4.0,2358.1958,518.7128,-0.3048))
- {
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(IsPlayerInRangeOfFishCP(playerid))
- {
- if(fishprogress[playerid] == 1)
- {
- SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
- SetTimerEx("fishtimer",5000,false,"i",playerid);
- fishes[playerid] += 1;
- TogglePlayerControllable(playerid,0);
- SetPlayerCheckpoint(playerid,3215.4434,-1035.6681,0.7980,4.0);
- fishprogress[playerid] = 2;
- }
- else
- if(fishprogress[playerid] == 2)
- {
- SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
- SetTimerEx("fishtimer",5000,false,"i",playerid);
- fishes[playerid] += 1;
- TogglePlayerControllable(playerid,0);
- SetPlayerCheckpoint(playerid,3019.4819,-1259.1970,0.8884,4.0);
- fishprogress[playerid] = 3;
- }
- else
- if(fishprogress[playerid] == 3)
- {
- SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
- SetTimerEx("fishtimer",5000,false,"i",playerid);
- fishes[playerid] += 1;
- TogglePlayerControllable(playerid,0);
- SetPlayerCheckpoint(playerid,3115.2380,-511.2403,0.9685,4.0);
- fishprogress[playerid] = 4;
- }
- else
- if(fishprogress[playerid] == 4)
- {
- SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
- SetTimerEx("fishtimer",5000,false,"i",playerid);
- fishes[playerid] += 1;
- TogglePlayerControllable(playerid,0);
- SetPlayerCheckpoint(playerid,2979.5803,-8.0016,1.4147,4.0);
- fishprogress[playerid] = 5;
- }
- else
- if(fishprogress[playerid] == 5)
- {
- SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
- SetTimerEx("fishtimer",5000,false,"i",playerid);
- fishes[playerid] += 1;
- TogglePlayerControllable(playerid,0);
- SetPlayerCheckpoint(playerid,2488.8032,472.4902,0.8335,4.0);
- fishprogress[playerid] = 6;
- }
- else
- if(fishprogress[playerid] == 6)
- {
- SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
- SetTimerEx("fishtimer",5000,false,"i",playerid);
- fishes[playerid] += 1;
- TogglePlayerControllable(playerid,0);
- SetPlayerCheckpoint(playerid,2358.1958,518.7128,-0.3048,4.0);
- fishprogress[playerid] = 7;
- }
- else
- if(fishprogress[playerid] == 7)
- {
- SendClientMessage(playerid,COLOR_DARKORANGE,"Taking your fishes out of the boat");
- SetTimerEx("fishtimer",15000,false,"i",playerid);
- fishes[playerid] += 1;
- TogglePlayerControllable(playerid,0);
- DisablePlayerCheckpoint(playerid);
- fishprogress[playerid] = 8;
- }
- }
- return 1;
- }
- public fishtimer(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- TogglePlayerControllable(playerid,1);
- if(fishprogress[playerid] == 8)
- {
- SendClientMessage(playerid,COLOR_DARKORANGE,"You've unloaded your fishes from the boat.");
- SendClientMessage(playerid,COLOR_DARKORANGE,"____________________");
- SendClientMessage(playerid,COLOR_DARKORANGE,"Earning:$2000");
- SendClientMessage(playerid,COLOR_DARKORANGE,"____________________");
- GivePlayerMoney(playerid,2000);
- TogglePlayerControllable(playerid,1);//this one's unneeded because you are unfreezing 'em already at line 172
- fishprogress[playerid] = 0;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement