Vehicle Saving / Loading?
#1

I made these two commands and they don't work;
pawn Код:
if(strcmp(cmd, "/saveveh", true) == 0)
    {
        new file[128];
        format(file, sizeof(file), "Vehicles/%s.ini", GetPlayerVehicleID(playerid));
        if(PlayerInfo[playerid][pAdmin] >= 1337)
        {
            new Float:X, Float:Y, Float:Z, Float:A;
            GetVehiclePos(vehicleid, X, Y, Z);
        GetVehicleZAngle(vehicleid, A);
            dini_Create(file);

        dini_FloatSet(file, "PosX", X);
        dini_FloatSet(file, "PosY", Y);
        dini_FloatSet(file, "PosZ", Z);
        dini_FloatSet(file, "PosA", A);
        SendClientMessage(playerid, COLOR_YELLOW, "[VEHICLE-INFO] Vehicle Saved");
        }
        return 1;
    }
    if(strcmp(cmd, "/loadveh", true) == 0)
    {
        new file[128];
        for(new i = 1; i <= MAX_VEHICLES; i++)
        {
            format(file, sizeof(file), "Vehicles/%s.ini", GetPlayerVehicleID(playerid));
            if(!fexist(file))
            {
                return SendClientMessage(playerid, COLOR_YELLOW, "[VEHICLE INFO] Vehicles Loaded");
            }
            CreateVehicle(i, vInfo[vehicleid][vPosX], vInfo[vehicleid][vPosY], vInfo[vehicleid][vPosZ], vInfo[vehicleid][vPosA], random(151), random(151), false);
        }
        SendClientMessage(playerid, COLOR_YELLOW, "[VEHICLE INFO] Vehicles Loaded");
        return 1;
    }
Could someone tell me what I am doing wrong?
Reply
#2

Please, I need this.
Reply
#3

can you explain what you mean they dont work? does it save vehicle at all?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)