SA-MP Forums Archive
[FilterScript] Sweeper Job - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Sweeper Job (/showthread.php?tid=251170)



Sweeper Job [LS] - Mister. M - 25.04.2011

Hello Guys.

I've changed my old job (2 minutes driving).
I hope you guys enjoy it, its much smaller.

Example:
pawn Code:
#include <a_samp>

#define COLOR_DARKGOLD 0x808000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA

new SweepingJob[256];

public OnFilterScriptInit()
{
    AddStaticVehicle(574,1424.8956,-1844.7279,13.2739,359.7335,0,0); // Sweeper1
    AddStaticVehicle(574,1428.4050,-1844.6340,13.2739,0.7382,0,0); // Sweeper2
    AddStaticVehicle(574,1431.9050,-1844.6138,13.2739,1.4491,0,0); // Sweeper3
}
forward SweeperJobFinish(playerid);
public SweeperJobFinish(playerid)
{
    if(SweepingJob[playerid] == 0){ return 1; }
   
    GivePlayerMoney(playerid,200);
    SendClientMessage(playerid,COLOR_YELLOW,"* You have been payed for your job! - $200");
    SweepingJob[playerid] = 0;

    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/sweeper", cmdtext, true, 10) == 0)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
        {
            SweepingJob[playerid] = 1;
            new name[MAX_PLAYER_NAME], string[48];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "* %s is now a StreetSweeper.", name );
            SendClientMessageToAll(COLOR_YELLOW, string);
            SendClientMessage(playerid,COLOR_YELLOW,"* Clean the street for 1 minute and recieve $200");
            SetTimerEx("SweeperJobFinish", 60000, false, "i", playerid);
            return 1;
        }
        SendClientMessage(playerid, COLOR_RED,"You have to be in a streetsweeper to start the job");
    }
    return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
     {
         SendClientMessage(playerid, COLOR_RED, "* You can start the sweepingjob by using /sweeper");
     }
     return 0;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(SweepingJob[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_RED, "* You have left your job, you won't be payed.");
        SweepingJob[playerid] = 0;
    }
}
Download:
http://www.mediafire.com/?xksx9to0749s9rb

Picture(s):
/imageshack/img51/3136/samp025cd.png

Credit(s):
* Forum (SA-MP) - For the idea.

Test Server: (Don't know if its allowed to post, but if not, please tell me)
217.117.234.62:7777

Enjoy,
Mister. M (BlackBerry)


Re: Sweeper Job - Mister. M - 25.04.2011

I will soon release a whole server.


Re: Sweeper Job - wheelman_WM - 26.04.2011

Bump


Re: Sweeper Job - StreetGT - 29.04.2011

you can stay stopped, you also will earn money -.-'
update code and check if player is moving


Re: Sweeper Job - Mister. M - 09.11.2011

Quote:
Originally Posted by StreetGT
View Post
you can stay stopped, you also will earn money -.-'
update code and check if player is moving
You're not lazy right? Do it yourself, and post a fix? ..

*sigh*


Re: Sweeper Job - Marshall32 - 09.11.2011

The job is bugged....:P....You forgot this one....

Under onplayerdisconect to set hes jobstatus to 0.Because when i leaved and came back it stayed i finished the job :P.


Re: Sweeper Job - Joshb93 - 19.11.2011

you can simply use GetPlayerVelocity to check if he moving.. I will post a fix for this soon..


Re: Sweeper Job - IndependentGaming - 25.04.2013

You dont get cash it say 200 and you dont get it


Re: Sweeper Job - tboysamp - 26.04.2013

nice


Re: Sweeper Job - Fredrick - 26.04.2013

Very Useful Thanks man!