/trackcar not working
#1

Hello friend this cmd is not working please help me tell what is the problem
pawn Код:
CMD:trackcar(playerid, params[])
{
    new vstring[1024];
    for(new i; i < MAX_PLAYERVEHICLES; i++)
    {
        if(PlayerVehicleInfo[playerid][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
            format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);

        else if(PlayerVehicleInfo[playerid][i][pvImpounded] == 1)
            format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);

        else
            format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
    }
    ShowPlayerDialog(playerid, TRACKCAR, DIALOG_STYLE_LIST, "OnStar Vehicle GPS Tracking", vstring, "Track", "Cancel");
    return 1;
}
Other Parts
pawn Код:
if(dialogid == TRACKCAR)
    {
        if(response == 1)
        {
            for(new i = 0; i < MAX_PLAYERVEHICLES; i++)
            {
                if(listitem == i)
                {
                    new Float: carPos[3];
                    if(PlayerVehicleInfo[playerid][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
                    {
                        GetVehiclePos(PlayerVehicleInfo[playerid][i][pvId], carPos[0], carPos[1], carPos[2]);
                        if(GetPVarInt(playerid, "Packages") >= 1 || TaxiAccepted[playerid] != 999 || EMSAccepted[playerid] != 999 || BusAccepted[playerid] != 999 || gPlayerCheckpointStatus[playerid] != CHECKPOINT_NONE || MedicAccepted[playerid] != 999 || MechanicCallTime[playerid] >= 1)
                        {
                            SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first with /killcheckpoint (you either have material packages, or another existing checkpoint).");
                        }
                        else
                        {
                            SetPVarInt(playerid, "TrackCar", 1);

                            new zone[MAX_ZONE_NAME];
                        //  Get3DZone(carPos[0], carPos[1], carPos[2], zone, sizeof(zone));
                            format(string, sizeof(string), "Your vehicle is located in %d.", zone);
                            SendClientMessageEx(playerid, COLOR_YELLOW, string);
                            SetPlayerCheckpoint(playerid, carPos[0], carPos[1], carPos[2], 15.0);
                            SendClientMessageEx(playerid, COLOR_WHITE, "Hint: Make your way to the checkpoint to find your vehicle!");
                        }
                    }
                    else if(PlayerVehicleInfo[playerid][i][pvImpounded]) SendClientMessageEx(playerid, COLOR_WHITE, "You can not track an impounded vehicle. If you wish to reclaim it, do so at the DMV in Dillimore.");
                    else SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a non-existent vehicle.");
                }
            }
        }
    }
    if(dialogid == GTRACKCAR)
    {
        if(response == 1)
        {
            for(new i = 0; i < MAX_GANG_VEHICLES; i++)
            {
                if(listitem == i)
                {
                    new Float: carPos[3];
                    new Family = PlayerInfo[playerid][pFMember];
                    if(FamilyVehicleInfo[Family][i][fvId] != INVALID_VEHICLE_ID)
                    {
                        GetVehiclePos(FamilyVehicleInfo[Family][i][fvId], carPos[0], carPos[1], carPos[2]);
                        if(GetPVarInt(playerid, "Packages") >= 1 || TaxiAccepted[playerid] != 999 || EMSAccepted[playerid] != 999 || BusAccepted[playerid] != 999 || gPlayerCheckpointStatus[playerid] != CHECKPOINT_NONE || MedicAccepted[playerid] != 999 || MechanicCallTime[playerid] >= 1)
                        {
                            SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first with /killcheckpoint (you either have material packages, or another existing checkpoint).");
                        }
                        else
                        {
                            SetPVarInt(playerid, "TrackCar", 1);

                            new zone[MAX_ZONE_NAME];
                        //  Get3DZone(carPos[0], carPos[1], carPos[2], zone, sizeof(zone));
                            format(string, sizeof(string), "Your vehicle is located in %s.", zone);
                            SendClientMessageEx(playerid, COLOR_YELLOW, string);
                            SetPlayerCheckpoint(playerid, carPos[0], carPos[1], carPos[2], 15.0);
                            SendClientMessageEx(playerid, COLOR_WHITE, "Hint: Make your way to the checkpoint to find your car!");
                        }
                    }
                    else
                    {
                        SendClientMessageEx(playerid, COLOR_WHITE, "You can not track a vehicle in a empty slot.");
                    }
                }
            }
        }
    }
    if(dialogid == 1347)
    {
        if(response)
        {
            new Float: carPosF[3];
            new v = ListItemTrackId[playerid][listitem];
            GetVehiclePos(PlayerVehicleInfo[playerid][v][pvId], carPosF[0], carPosF[1], carPosF[2]);
            if(GetPVarInt(playerid, "Packages") >= 1 || TaxiAccepted[playerid] != 999 || EMSAccepted[playerid] != 999 || BusAccepted[playerid] != 999 || gPlayerCheckpointStatus[playerid] != CHECKPOINT_NONE || MedicAccepted[playerid] != 999 || MechanicCallTime[playerid] >= 1)
            {
                SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first with /killcheckpoint (you either have material packages, or another existing checkpoint).");
            }
            else
            {
                SetPVarInt(playerid,"TrackCar",1);
                new zone[MAX_ZONE_NAME];
            //  Get3DZone(carPosF[0], carPosF[1], carPosF[2], zone, sizeof(zone));
                format(string, sizeof(string), "Your vehicle is located in %d.", zone);
                SendClientMessageEx(playerid, COLOR_YELLOW, string);
                SetPlayerCheckpoint(playerid, carPosF[0], carPosF[1], carPosF[2], 15.0);
                SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Make your way to the checkpoint to find your car!");
            }
        }
    }
    if(dialogid == 1346)
    {
        if(response)
        {
            new Float: carPosF[3];
            new v = ListItemTrackId[playerid][listitem];
            new f = PlayerInfo[playerid][pFMember];
            GetVehiclePos(FamilyVehicleInfo[f][v][fvId], carPosF[0], carPosF[1], carPosF[2]);
            if(GetPVarInt(playerid, "Packages") >= 1 || TaxiAccepted[playerid] != 999 || EMSAccepted[playerid] != 999 || BusAccepted[playerid] != 999 || MedicAccepted[playerid] != 999 || MechanicCallTime[playerid] >= 1)
            {
                SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first with /killcheckpoint (you either have material packages, or another existing checkpoint).");
            }
            else
            {
                SetPVarInt(playerid,"TrackCar",1);
                new zone[MAX_ZONE_NAME];
            //  Get3DZone(carPosF[0], carPosF[1], carPosF[2], zone, sizeof(zone));
                format(string, sizeof(string), "Your vehicle is located in %d.", zone);
                SendClientMessageEx(playerid, COLOR_YELLOW, string);
                SetPlayerCheckpoint(playerid, carPosF[0], carPosF[1], carPosF[2], 15.0);
                SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Make your way to the checkpoint to find your car!");
            }
        }
    }
Reply
#2

What script looks like NGRP to me?
Reply
#3

Yea it is copied from NGRP but its not working pls help me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)