Car park zone help
#15

okay i see whats wrong,
this should fix it,


ill explain what i did
pawn Код:
new bool:playerIsInParkRange;// removed iCarPark as its not used..
                    for(new i=0;i<=6;i++) {
                        if (IsPlayerInRangeOfPoint(playerid, ParkRange, CarParkX[i], CarParkY[i], CarParkZ[i])) {
                            playerIsInParkRange = true;  // added  a semi  colon ;
                            break;      //moved the break; statement back one tab to line up the indentation
                        }
                    }
ofcorse the hole thing here.

pawn Код:
COMMAND:park(playerid, params[])
{
    new Float:x, Float:y, Float:z, Float:rot, vid, HouseID, Msg[128];
    new engine,lights,alarm,doors,bonnet,boot,objective;
    SendAdminText(playerid, "/park", params);
    if (APlayerData[playerid][LoggedIn] == true) {
        if (GetPlayerVehicleSeat(playerid) == 0) {
            vid = GetPlayerVehicleID(playerid);
            HouseID = AVehicleData[vid][BelongsToHouse];
            if ((AVehicleData[vid][Owned] == true) && (HouseID != 0)) {
                if (IsPlayerInRangeOfPoint(playerid, ParkRange, AHouseData[HouseID][HouseX], AHouseData[HouseID][HouseY], AHouseData[HouseID][HouseZ])) {
                    new bool:playerIsInParkRange;// the unsued iCarPark warning
                    for(new i=0;i<=6;i++) {
                        if (IsPlayerInRangeOfPoint(playerid, ParkRange, CarParkX[i], CarParkY[i], CarParkZ[i])) {
                            playerIsInParkRange = true;
                            break;      //and the other warning and error  
                        }
                    }
                    if(playerIsInParkRange) {
                        GetVehiclePos(vid, x, y, z);
                        GetVehicleZAngle(vid, rot);
                        AVehicleData[vid][SpawnX] = x;
                        AVehicleData[vid][SpawnY] = y;
                        AVehicleData[vid][SpawnZ] = z;
                        AVehicleData[vid][SpawnRot] = rot;
                        for (new i = 0; i < MAX_HOUSESPERPLAYER; i++) {
                            HouseID = APlayerData[playerid][Houses][i];
                            for (new CarSlot; CarSlot < 10; CarSlot++) {
                                if (AHouseData[HouseID][VehicleIDs][CarSlot] == vid) {
                                    House_ReplaceVehicle(HouseID, CarSlot);
                                    PutPlayerInVehicle(playerid, AHouseData[HouseID][VehicleIDs][CarSlot], 0);
                                    GetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], engine, lights, alarm, doors, bonnet, boot, objective);
                                    SetVehicleParamsEx(AHouseData[HouseID][VehicleIDs][CarSlot], 1, lights, alarm, doors, bonnet, boot, objective);
                                    break;
                                }
                            }
                        }
                        SendClientMessage(playerid, 0x00FF00FF, "You've parked your vehicle");
                        PlayerFile_Save(playerid);
                    }
                    else {
                        format(Msg, 128, "{FF0000}You need to be within %im of your house or carpark to park this vehicle", ParkRange);
                        SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                    }
                }
                else {
                    format(Msg, 128, "{FF0000}You need to be within %im of your house or carpark to park this vehicle", ParkRange);
                    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
                }
            }
            else
                SendClientMessage(playerid, 0xFF0000FF, "You cannot park a vehicle that's not owned by you");
        }
        else
            SendClientMessage(playerid, 0xFF0000FF, "You must be driving a vehicle you own to park it");
    }
    else
        return 0;
    return 1;
}
Reply


Messages In This Thread
Car park zone help - by nickdodd25 - 22.03.2012, 23:10
Re: Car park zone help - by Jonny5 - 23.03.2012, 04:16
Re: Car park zone help - by DarkScripter - 23.03.2012, 06:32
Re: Car park zone help - by nickdodd25 - 23.03.2012, 14:30
Re: Car park zone help - by Jonny5 - 23.03.2012, 14:34
Re: Car park zone help - by nickdodd25 - 23.03.2012, 15:57
Re: Car park zone help - by Jonny5 - 23.03.2012, 19:01
Re: Car park zone help - by nickdodd25 - 23.03.2012, 21:26
Re: Car park zone help - by Jonny5 - 23.03.2012, 23:26
Re: Car park zone help - by nickdodd25 - 24.03.2012, 00:33
Re: Car park zone help - by Jonny5 - 24.03.2012, 00:41
Re: Car park zone help - by nickdodd25 - 24.03.2012, 19:06
Re: Car park zone help - by Jonny5 - 28.03.2012, 21:21
Re: Car park zone help - by nickdodd25 - 29.03.2012, 02:40
Re: Car park zone help - by Jonny5 - 29.03.2012, 03:41
Re: Car park zone help - by nickdodd25 - 29.03.2012, 23:43
Re: Car park zone help - by chrism11 - 29.03.2012, 23:49
Re: Car park zone help - by nickdodd25 - 30.03.2012, 00:18
Re: Car park zone help - by chrism11 - 30.03.2012, 01:16
Re: Car park zone help - by nickdodd25 - 30.03.2012, 02:02
Re: Car park zone help - by chrism11 - 30.03.2012, 22:34
Re: Car park zone help - by nickdodd25 - 02.04.2012, 00:56

Forum Jump:


Users browsing this thread: 1 Guest(s)