Pizza Job
#1

When i take Pizza Job and type /getpizza i got checkpoint to someones house, when i enter it, it says "You need to be in a bank car"

PHP код:
CMD:getpizza(playerid, params[])
{
    if (
PlayerInfo[playerid][pJob] != 21 && PlayerInfo[playerid][pJob2] != 21)
    {
        
SendClientMessageEx(playerid,COLOR_GREY,"   You are not a Pizza Boy!");
        return 
1;
    }
    new 
vehicleid = GetPlayerVehicleID(playerid);
    if(!(
IsAPizzaCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
    {
        
SendClientMessageEx(playerid,COLOR_GREY,"   You need to be driving a pizzaboy found at the side of the Pizza Stack!");
        return 
1;
    }
    if(!(
GetPlayerSkin(playerid) == 155))
    {
        
SendClientMessageEx(playerid,COLOR_GREY,"   You need to be in the Pizza Stack uniform!");
        return 
1;
    }
    if(
IsLoaded[playerid] || IsBooked[playerid] || gPlayerCheckpointStatus[playerid] == RETURN || gPlayerCheckpointStatus[playerid] == ROUTE) {
    
SendClientMessageEx(playerid, COLOR_GRAD2, " You cannot kill checkpoint when on a mission!");
    return 
1;
    }
    new 
playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid, playername, sizeof(playername));
    if(!
IsPlayerInRangeOfPoint(playerid, 3.0, 2099.2761,-1804.8387,13.5547))
    {
        
SendClientMessageEx(playerid,COLOR_GREY,"   You are not at the Pizza Stack pickup!");
        return 
1;
    }
    if(
GetPVarInt(playerid, "Pizza") > 0)
    {
        
SendClientMessageEx(playerid, COLOR_GREY, "   You are already delivering pizzas!");
        return 
1;
    }
    for(new 
h=0; h < MAX_HOUSES; h++)
    {
        if(
HouseInfo[h][hOwned] == 1)
        {
            new 
rand = random(MAX_HOUSES - 1);
            while(
HouseInfo[rand][hOwned] == 0)
            {
                
rand = random(MAX_HOUSES - 1);
            }
            
SetPVarInt(playerid, "tpPizzaTimer", floatround((GetPizzaDistance(rand) / 80), floatround_round));
            
SetPVarInt(playerid, "pizzaTotal", floatround((GetPizzaDistance(rand) / 10), floatround_round));
            
SetPVarInt(playerid, "pizzaTimer", GetPVarInt(playerid, "pizzaTotal"));
             
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPPIZZARUNTIMER);
             
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_PIZZATIMER);
            new 
szMessage[128];
            
format(szMessage, sizeof(szMessage), "You have picked up a pizza for %s. You have %d seconds to deliver it!", HouseInfo[rand][hOwner], GetPVarInt(playerid, "pizzaTotal"));
            
SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
            
SetPVarInt(playerid, "Pizza", rand);
            
PizzaBar[playerid] = CreateProgressBar(258.00, 137.00, 131.50, 3.19, COLOR_GREEN, 100.0);
            
SetProgressBarValue(PizzaBar[playerid], 100.0);
            
ShowProgressBarForPlayer(playerid, PizzaBar[playerid]);
            
SetPlayerCheckpoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ], 5);
            
gPlayerCheckpointStatus[playerid] = ROUTE;
            return 
1;
        }
        else
        {
            
SendClientMessageEx(playerid, COLOR_GREY, "   There are no houses that you can deliver to!");
            return 
1;
        }
    }
    return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
// Pizza Delivery
    
if(GetPVarInt(playerid, "Pizza") > 0 && IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorX], HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorY], HouseInfo[GetPVarInt(playerid, "Pizza")][hExteriorZ]))
    {
        new 
string[128];
        if (
GetPVarInt(playerid, "tpPizzaTimer") != 0)
        {
            
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport pizzarunning.", GetPlayerNameEx(playerid), playerid);
              
ABroadCast( COLOR_YELLOW, string, 2 );
            
format(string, sizeof(string), "%s (ID %d) is possibly teleport pizzarunning.", GetPlayerNameEx(playerid), playerid);
            
Log("logs/hack.log", string);
        }
        
DestroyProgressBar(PizzaBar[playerid]);
        
format(string, sizeof(string), "You have delivered the pizza to the destination! You have made $%d.", (GetPVarInt(playerid, "pizzaTimer") / 3));
        
Tax -= (GetPVarInt(playerid, "pizzaTimer") * 1);
        
SaveStuff();
        
GivePlayerCash(playerid, floatround((GetPVarInt(playerid, "pizzaTimer") / 3), floatround_round));
        
//PlayerInfo[playerid][pPayCheck] += floatround((GetPVarInt(playerid, "pizzaTimer") / 3), floatround_round);
        
SendClientMessageEx(playerid, COLOR_WHITE, string);
        
SetPVarInt(playerid, "Pizza", 0);
        
DisablePlayerCheckpoint(playerid);
    }    
DisablePlayerCheckpoint(playerid);
    return 
1;
} 
Reply


Messages In This Thread
Pizza Job - by FaZeRs - 06.01.2015, 15:11
Re: Pizza Job - by Ironboy - 06.01.2015, 15:15
Re: Pizza Job - by viddo - 06.01.2015, 15:18
Re: Pizza Job - by FaZeRs - 06.01.2015, 17:13
Re: Pizza Job - by viddo - 06.01.2015, 17:20

Forum Jump:


Users browsing this thread: 1 Guest(s)