/getpizza
#2

pawn Код:
command(getpizza, playerid, params[])
{
    if(Player[playerid][Authenticated] == 1)
    {
        if(Jobs[Player[playerid][Job]][JobType] != 8 && Jobs[Player[playerid][Job2]][JobType] != 8) return SendClientMessage(playerid, WHITE, "You are not a Pizza Boy!");
        new vehid = GetPlayerVehicleID(playerid);
        switch(vehid)
        {
            case    PizzaBike1, PizzaBike2, PizzaBike3, PizzaBike4,
                    PizzaBike5, PizzaBike6, PizzaBike7, PizzaBike8:
            {
                new jid = Player[playerid][Job];
                if(!IsPlayerInRangeOfPoint(playerid, 5, Jobs[jid][JobMiscLocationOneX], Jobs[jid][JobMiscLocationOneY], Jobs[jid][JobMiscLocationOneZ])
                {
                    jid = Player[playerid][Job2];
                    if(!IsPlayerInRangeOfPoint(playerid, 5.0, Jobs[jid][JobMiscLocationOneX], Jobs[jid][JobMiscLocationOneY], Jobs[jid][JobMiscLocationOneZ]))
                        return SendClientMessage(playerid, WHITE, "You are not near the pizza pickup!");
                }
                new rand = random(SpawnedHouses), attempts = 0;
                Player[playerid][Checkpoint] = 1;
                while(Houses[rand][hInteriorID])
                {
                    if(attempts >= 50) return SendClientMessage(playerid, WHITE, "Could not find a house.");
                    //Security countermeasure to make sure this loop doesn't hang your server.
                    rand = random(SpawnedHouses);
                    attempts++;
                }
                SetPlayerCheckpoint(playerid, Houses[rand][hExteriorX], Houses[rand][hExteriorY], Houses[rand][hExteriorZ], 5.0);
                Player[playerid][PizzaTimer] = 1;
                SendClientMessage(playerid, WHITE, "You have three minutes to deliver the pizza to the house marked on your minimap!");
            }
            default: SendClientMessage(playerid, WHITE, "You are not on a pizza bike!");
        }
    }
    return 1;
}
pawn Код:
if(Houses[rand][hInteriorID] == 0)
Give this a shot.

pawn Код:
if(Houses[rand][hInteriorID] == 0)
Is that meant to be 'if(Houses[rand][hInteriorID] == 0)' or 'if(Houses[rand][hInteriorID] != 0)'?
Reply


Messages In This Thread
/getpizza - by BornHuman - 13.01.2015, 23:43
Re: /getpizza - by Threshold - 14.01.2015, 01:50
Re: /getpizza - by Abagail - 14.01.2015, 02:03
Re: /getpizza - by Threshold - 14.01.2015, 02:15
Re: /getpizza - by BornHuman - 14.01.2015, 10:08
Re: /getpizza - by Sawalha - 14.01.2015, 10:21
Re: /getpizza - by Threshold - 14.01.2015, 10:29
Re: /getpizza - by BornHuman - 14.01.2015, 20:43
Re: /getpizza - by Threshold - 14.01.2015, 21:41
Re: /getpizza - by BornHuman - 14.01.2015, 21:51

Forum Jump:


Users browsing this thread: 2 Guest(s)