[HELP]Ingame Car Spawn & Save
#8

pawn Код:
CMD:saveallvehicles(playerid, params[])
{
    if(pInfo[playerid][Admin] < 5) return SendClientMessage(playerid, color_red, "This command can use only admins!"); //I suppose you have custom admin system
    new Float:VX, Float:VY, Float:VZ, Float:VA, Float:VH, filestring[32];
    for(new i; i < MAX_VEHICLES; i++)
    {
        GetVehiclePos(i, VX, VY, VZ);
        GetVehicleZAngle(i, VA);
        GetVehicleHealth(i, VH);
        format(filestring, sizeof(filestring), "/data/vehicle/%i.ini", i); //Generated ini file name
        //Save this... I donґt work with Y_INI, you must complete this yourself
    }
    return 1;
}

public OnGameModeInit()
{
    new Float:VX, Float:VY, Float:VZ, Float:VA, Float:VH, VM, veh, filestring[32];
    for(new i; i < MAX_VEHICLES; i++)
    {
        format(filestring, sizeof(filestring), "/data/vehicle/%i.ini", i); //Generated ini file name
        //Load data from file
        veh = CreateVehicle(VM, VX, VY, VZ, VA, -1, -1, 10000);
        SetVehicleHealth(veh, VH);
    }
    return 1;
}
Reply


Messages In This Thread
[HELP]Ingame Car Spawn & Save - by Hyperfire - 06.09.2012, 19:39
Re: [HELP]Ingame Car Spawn & Save - by Hyperfire - 08.09.2012, 17:10
Re: [HELP]Ingame Car Spawn & Save - by Hyperfire - 11.09.2012, 14:14
Re: [HELP]Ingame Car Spawn & Save - by lamarr007 - 11.09.2012, 14:25
Re: [HELP]Ingame Car Spawn & Save - by Hyperfire - 11.09.2012, 14:32
Re: [HELP]Ingame Car Spawn & Save - by lamarr007 - 11.09.2012, 14:35
Re: [HELP]Ingame Car Spawn & Save - by Hyperfire - 11.09.2012, 14:40
Re: [HELP]Ingame Car Spawn & Save - by lamarr007 - 11.09.2012, 15:14
Re: [HELP]Ingame Car Spawn & Save - by Hyperfire - 11.09.2012, 15:49
Re: [HELP]Ingame Car Spawn & Save - by Hyperfire - 15.09.2012, 01:59

Forum Jump:


Users browsing this thread: 1 Guest(s)