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(playeridparams[])
{
    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(playeridCOLOR_GRAD2" You cannot kill checkpoint when on a mission!");
    return 
1;
    }
    new 
playername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayernamesizeof(playername));
    if(!
IsPlayerInRangeOfPoint(playerid3.02099.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(playeridCOLOR_GREY"   You are already delivering pizzas!");
        return 
1;
    }
    for(new 
h=0MAX_HOUSESh++)
    {
        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"1000false"ii"playeridTYPE_TPPIZZARUNTIMER);
             
SetTimerEx("OtherTimerEx"1000false"ii"playeridTYPE_PIZZATIMER);
            new 
szMessage[128];
            
format(szMessagesizeof(szMessage), "You have picked up a pizza for %s. You have %d seconds to deliver it!"HouseInfo[rand][hOwner], GetPVarInt(playerid"pizzaTotal"));
            
SendClientMessageEx(playeridCOLOR_WHITEszMessage);
            
SetPVarInt(playerid"Pizza"rand);
            
PizzaBar[playerid] = CreateProgressBar(258.00137.00131.503.19COLOR_GREEN100.0);
            
SetProgressBarValue(PizzaBar[playerid], 100.0);
            
ShowProgressBarForPlayer(playeridPizzaBar[playerid]);
            
SetPlayerCheckpoint(playeridHouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ], 5);
            
gPlayerCheckpointStatus[playerid] = ROUTE;
            return 
1;
        }
        else
        {
            
SendClientMessageEx(playeridCOLOR_GREY"   There are no houses that you can deliver to!");
            return 
1;
        }
    }
    return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
// Pizza Delivery
    
if(GetPVarInt(playerid"Pizza") > && IsPlayerInRangeOfPoint(playerid5.0HouseInfo[GetPVarInt(playerid"Pizza")][hExteriorX], HouseInfo[GetPVarInt(playerid"Pizza")][hExteriorY], HouseInfo[GetPVarInt(playerid"Pizza")][hExteriorZ]))
    {
        new 
string[128];
        if (
GetPVarInt(playerid"tpPizzaTimer") != 0)
        {
            
format(stringsizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport pizzarunning."GetPlayerNameEx(playerid), playerid);
              
ABroadCastCOLOR_YELLOWstring);
            
format(stringsizeof(string), "%s (ID %d) is possibly teleport pizzarunning."GetPlayerNameEx(playerid), playerid);
            
Log("logs/hack.log"string);
        }
        
DestroyProgressBar(PizzaBar[playerid]);
        
format(stringsizeof(string), "You have delivered the pizza to the destination! You have made $%d.", (GetPVarInt(playerid"pizzaTimer") / 3));
        
Tax -= (GetPVarInt(playerid"pizzaTimer") * 1);
        
SaveStuff();
        
GivePlayerCash(playeridfloatround((GetPVarInt(playerid"pizzaTimer") / 3), floatround_round));
        
//PlayerInfo[playerid][pPayCheck] += floatround((GetPVarInt(playerid, "pizzaTimer") / 3), floatround_round);
        
SendClientMessageEx(playeridCOLOR_WHITEstring);
        
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: 2 Guest(s)