SA-MP Forums Archive
Not saving the vehicles are using ONE cmd | +rep - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Not saving the vehicles are using ONE cmd | +rep (/showthread.php?tid=385164)



Not saving the vehicles are using ONE cmd | +rep - RLGaming - 14.10.2012

pawn Код:
CMD:trackcar(playerid, params[])
{
    if(TrackCar[playerid])
    {
        TrackCar[playerid] = 0;
        DisablePlayerCheckpoint(playerid);
        SendClientMessage(playerid, COLOR_WHITE, "You are not tracking your vehicle anymore.");
        return 1;
    }
    new info[256], bool:found;
    for(new i=1; i < MAX_DVEHICLES; i++)
    {
        if(VehicleCreated[i] == VEHICLE_PLAYER && strcmp(VehicleOwner[i], PlayerName(playerid)) == 0)
        {
            found = true;
            format(info, sizeof(info), "%sID: %d  Name: %s\n", info, i, VehicleNames[VehicleModel[i]-400]);
        }
    }
    if(!found) return SendClientMessage(playerid, COLOR_RED, "You don't have any vehicles!");
    ShowPlayerDialog(playerid, DIALOG_FINDVEHICLE, DIALOG_STYLE_LIST, "Find your vehicle!", info, "Find", "Cancel");
    return 1;
}
I have that CMD, and I can track my vehicle but only once.. Whenever I attempt to do the CMD again it says I dont have any vehicles.. but on the vehicle INI file it says Im the owner and I do? And when I restart the server it says I own it but then after using it once it says I dont..

Dialog response:
pawn Код:
if(dialogid == DIALOG_FINDVEHICLE)
    {
        if(response)
        {
            new id;
            sscanf(inputtext[4], "d", id);
            if(IsValidVehicle(id))
            {
                TrackCar[playerid] = VehicleID[id];
                SendClientMessage(playerid, COLOR_WHITE, "You vehicle's location is shown on your radar!");
                SendClientMessage(playerid, COLOR_YELLOW, "You have lost $40 as it costs to enable your vehicle's tracking system!");
                GivePlayerMoney(playerid, -40);
                SaveUser(playerid);
            }
        }
        return 1;
    }
Thanks so much
+rep


Re: Not saving the vehicles are using ONE cmd | +rep - RLGaming - 14.10.2012

anyone? please