SA-MP Forums Archive
Two Filterscripts problem - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Two Filterscripts problem (/showthread.php?tid=527564)



Two Filterscripts problem - salev13 - 23.07.2014

the first one is street sweeper job and the other one is pizza boy please help me

In this two filterscripts i dont recive money

pawn Код:
#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 earned 200 dollars");
    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));
            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;
    }
}
and in this one i dont recive money and i got only one point how to add more?

pawn Код:
#include <a_samp>


#define COLOR_ORANGE 0xFF9900AA
#define COLOR_RED 0xAA3333AA


#define PizzaCheckPoint1 1946.1525,-2047.4603,12.9842
#define PizzaCheckPoint2 1887.2511,-2025.6620,12.9907
#define PizzaCheckPoint3 1801.9717,-2108.4243,12.9782
#define PizzaCheckPoint4 1712.8094,-2108.2202,12.9778
#define PizzaCheckPoint5 1758.9286,-2117.8645,13.1443
#define PizzaCheckPoint6 2249.7629,-1899.5115,13.1621
#define PizzaCheckPoint7 2273.7979,-1899.1754,12.9112
#define PizzaCheckPoint8 2464.2188,-2014.2488,12.8764
#define PizzaCheckPoint9 2487.6382,-2013.8530,12.8765
#define PizzaCheckPoint10 2508.4534,-2005.0922,12.8816
#define PizzaCheckPoint11 2394.3926,-1727.6661,12.9778
#define PizzaCheckPoint12 2385.1702,-1663.5616,12.9824
#define PizzaTakePoint 2093.0647,-1807.4172,13.1484

new pizza = 0;
new pizzainfo;

public OnFilterScriptInit()
{
    AddStaticVehicleEx(448,2113.4265,-1783.2411,12.9881,0.4907,3,6,615); // pizza1
    AddStaticVehicleEx(448,2119.3572,-1782.7574,12.9869,358.8506,3,6,615); // pizza2
    AddStaticVehicleEx(448,2121.7573,-1783.6804,12.9824,175.0377,3,6,615); // pizza3
    AddStaticVehicleEx(448,2121.7573,-1783.6804,12.9824,175.0377,3,6,615); // pizza4

    pizzainfo = CreatePickup(1239, 1, 2093.0647,-1807.4172,13.1484, -1);
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/pizza", cmdtext, true, 10) == 0)
    {
        if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
        {
            pizza = 1;
            SetPlayerCheckpoint(playerid, PizzaCheckPoint1, 3.0);
            GameTextForPlayer(playerid, "~g~You are now pizza delivery boy!", 3000, 3);
            new name[MAX_PLAYER_NAME], string[48];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "%s is now a pizza delivery boy.", name );
            SendClientMessageToAll(COLOR_ORANGE, string);
            return 1;
        }
        SendClientMessage(playerid, COLOR_ORANGE,"You have to be in a Pizzaboy bike delivery.");
    }
    if (strcmp("/Pizzainfo", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, COLOR_ORANGE, "You need to deliver pizza to houses.");
        SendClientMessage(playerid, COLOR_ORANGE, "You will get pay.");
        SendClientMessage(playerid, COLOR_ORANGE, "If you enter a Pizzaboy bike ,use /pizza to start job.");
        SendClientMessage(playerid, COLOR_ORANGE, "Just drive to the red markers and earn money.");
        return 1;
    }
    return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
   {
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint1))
     {
          SetPlayerCheckpoint(playerid, PizzaCheckPoint2, 7.0);
          GameTextForPlayer(playerid, "~g~1 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint2))
     {
          SetPlayerCheckpoint(playerid, PizzaCheckPoint3, 7.0);
          GameTextForPlayer(playerid, "~g~2 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint3))
     {
          SetPlayerCheckpoint(playerid, PizzaCheckPoint4, 7.0);
          GameTextForPlayer(playerid, "~g~3 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint4))
     {
          SetPlayerCheckpoint(playerid, PizzaCheckPoint5, 7.0);
          GameTextForPlayer(playerid, "~g~4 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint5))
     {
          SetPlayerCheckpoint(playerid, PizzaTakePoint, 7.0);
          GameTextForPlayer(playerid, "~g~5 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint6))
     {
          SetPlayerCheckpoint(playerid, PizzaCheckPoint7, 7.0);
          GameTextForPlayer(playerid, "~g~6 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint7))
     {
          SetPlayerCheckpoint(playerid, PizzaCheckPoint8, 7.0);
          GameTextForPlayer(playerid, "~g~7 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint8))
     {
          SetPlayerCheckpoint(playerid, PizzaCheckPoint9, 7.0);
          GameTextForPlayer(playerid, "~g~8 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint9))
     {
          SetPlayerCheckpoint(playerid, PizzaCheckPoint10, 7.0);
          GameTextForPlayer(playerid, "~g~9 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint10))
     {
          SetPlayerCheckpoint(playerid, PizzaCheckPoint11, 7.0);
          GameTextForPlayer(playerid, "~g~10 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint11))
     {
          SetPlayerCheckpoint(playerid, PizzaCheckPoint12, 7.0);
          GameTextForPlayer(playerid, "~g~11 pizza delivered!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaCheckPoint12))
     {
          SetPlayerCheckpoint(playerid, PizzaTakePoint, 7.0);
          GameTextForPlayer(playerid, "~g~12 pizza delivered, get back to for the payment!", 3000, 3);
     }
     if (IsPlayerInRangeOfPoint(playerid, 7.0,PizzaTakePoint))
     {
         GivePlayerMoney(playerid, 150);
         GameTextForPlayer(playerid, "~g~You collected a total of $150,-!", 3000, 3);
         new veh;
         veh = GetPlayerVehicleID(playerid);
         SetVehicleToRespawn(veh);
         DisablePlayerCheckpoint(playerid);
         pizza = 0;
     }
   }
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 448)
     {
         SendClientMessage(playerid, COLOR_ORANGE, "You can start the pizza delivery boy with /pizza");
     }
     return 0;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if((pizza) == 1)
    {
        pizza = 0;
        SendClientMessage(playerid, COLOR_RED, "You left your pizzaboy bike, get in again or you will get fired!");

    }else if((pizza) == 0){

        //Nothing
 }
}
public OnPlayerDeath(playerid, killerid, reason)
{
          DisablePlayerCheckpoint(playerid);
          pizza = 0;
          return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pizzainfo)
    {
    GameTextForPlayer(playerid, "~g~Welcome to the Pizza delivery boy job, use /pizzainfo for more information", 3000, 3);
    }
}



Re: Two Filterscripts problem - salev13 - 23.07.2014

Quote:
Originally Posted by ******
Посмотреть сообщение
Do you have and AC? If so, the filterscripts need to include it so that the "GivePlayerMoney" function is correctly hooked.
Can you told me what to write and where?

cuase i dont really good scripter my friend told me edit it a little and i tryed cuase thats dosent work