Vehicles
#1

I don't know if this is the right place but does anyone have a list of

CreateVehicles
or
AddStaticVehicles

Which I can use for my RP script? I have a system setup to dynamically do it but it's not quite working at the moment therefore no one has vehicles and I don't really have the time to go all over the map spawning them.

Thanks
Reply
#2

I say to use AddStaticVehicle
CreateVehicle is using in commanda
Reply
#3

You haven't understood me. I'm asking if anyone has a pre set list of vehicles I can use
Reply
#4

Use the vehicles given in the SA-MP 0.3.7 package.

http://www.mediafire.com/download/el...w/vehicles.zip
Reply
#5

Is there a filterscript to easily add these?
Reply
#6

gl_common.inc

pawn Код:
stock LoadStaticVehiclesFromFile(const filename[])
{
    new File:file_ptr;
    new line[256];
    new var_from_line[64];
    new vehicletype;
    new Float:SpawnX;
    new Float:SpawnY;
    new Float:SpawnZ;
    new Float:SpawnRot;
        new Color1, Color2;
    new index;
    new vehicles_loaded;

    file_ptr = fopen(filename,filemode:io_read);
    if(!file_ptr) return 0;

    vehicles_loaded = 0;

    while(fread(file_ptr,line,256) > 0)
    {
        index = 0;

        // Read type
        index = token_by_delim(line,var_from_line,',',index);
        if(index == (-1)) continue;
        vehicletype = strval(var_from_line);
        if(vehicletype < 400 || vehicletype > 611) continue;

        // Read X, Y, Z, Rotation
        index = token_by_delim(line,var_from_line,',',index+1);
        if(index == (-1)) continue;
        SpawnX = floatstr(var_from_line);

        index = token_by_delim(line,var_from_line,',',index+1);
        if(index == (-1)) continue;
        SpawnY = floatstr(var_from_line);

        index = token_by_delim(line,var_from_line,',',index+1);
        if(index == (-1)) continue;
        SpawnZ = floatstr(var_from_line);

        index = token_by_delim(line,var_from_line,',',index+1);
        if(index == (-1)) continue;
        SpawnRot = floatstr(var_from_line);

        // Read Color1, Color2
        index = token_by_delim(line,var_from_line,',',index+1);
        if(index == (-1)) continue;
        Color1 = strval(var_from_line);

        index = token_by_delim(line,var_from_line,';',index+1);
        Color2 = strval(var_from_line);
       
        //printf("%d,%.2f,%.2f,%.2f,%.4f,%d,%d",vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2);
       
        AddStaticVehicleEx(vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2,(30*60)); // respawn 30 minutes
       
        /*new numplate_test[32+1];
        format(numplate_test,32,"GRLC{44AA33}%d",vid);
        SetVehicleNumberPlate(vid, numplate_test);*/

       
        vehicles_loaded++;
    }

    fclose(file_ptr);
    printf("Loaded %d vehicles from: %s",vehicles_loaded,filename);
    return vehicles_loaded;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)