PDA

View Full Version : Samp CreateVehicle rotation


coolmark1995
03/01/2016, 09:05 AM
How might I fix vehicle rotation as it appears to spawn backwards my rotation currently is 0


#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Busses spawn locations by coolmark1995");
print("--------------------------------------\n");

CreateVehicle(431, -94.95, -1118.03, 1.37, 0, -1, -1, 0);

return 1;
}

public OnFilterScriptExit()
{
return 1;
}
#endif

Tamy
03/01/2016, 10:11 AM
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Busses spawn locations by coolmark1995");
print("--------------------------------------\n");

new carid;
carid = CreateVehicle(431, -94.95, -1118.03, 1.37, 0, -1, -1, 0);
SetVehicleZAngle(carid, ANGLE HERE);

return 1;
}

public OnFilterScriptExit()
{
return 1;
}
#endif

CodeStyle175
03/01/2016, 10:28 AM
CreateVehicle(431, -94.95,-1118.03,1.37, ANGLE GOES HERE, -1, -1, -1);

coolmark1995
03/01/2016, 11:21 AM
Thanks I also have another question I know createvehicle causes vehicle to spawn but how might I go about attaching text to bus on spawn? I am just wondering Now I know the following code should work but I am a bit confused as I want the text to be there permanently. any ideas? I am wondering if the following is correct or not.

Vehicle 1:
vehicle_id = CreateVehicle( 431, -126.66, -1210.45, 2.69, 5, 0, 120 );
vehicle3Dtext[ vehicle_id ] = Create3DTextLabel( "Bus 45 Los Santos", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Creating the Vehicle
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle( vehicle3Dtext[ vehicle_id ] , vehicle_id, 0.0, 0.0, 2.0);

Vehicle 2:
vehicle_id = CreateVehicle( 431, 1402.71, 1028.00, 10.81, 5, 0, 120 );
vehicle3Dtext[ vehicle_id ] = Create3DTextLabel( "Bus 25 San Fierro", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Creating the Vehicle
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle( vehicle3Dtext[ vehicle_id ] , vehicle_id, 0.0, 0.0, 2.0);

Vehicle 3:
vehicle_id = CreateVehicle( 431, -98.67, -1168.64, 2.57, 5, 0, 120 );
vehicle3Dtext[ vehicle_id ] = Create3DTextLabel( "Bus 31 Las Venturas", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Creating the Vehicle
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle( vehicle3Dtext[ vehicle_id ] , vehicle_id, 0.0, 0.0, 2.0);

Compile Errors:

C:\Users\markh\Downloads\gta san andreas\filterscripts\road.pwn(15) : warning 217: loose indentation
C:\Users\markh\Downloads\gta san andreas\filterscripts\road.pwn(15) : error 017: undefined symbol "vehicle_id"
C:\Users\markh\Downloads\gta san andreas\filterscripts\road.pwn(15) : warning 202: number of arguments does not match definition
C:\Users\markh\Downloads\gta san andreas\filterscripts\road.pwn(16) : warning 217: loose indentation
C:\Users\markh\Downloads\gta san andreas\filterscripts\road.pwn(16) : error 017: undefined symbol "vehicle3Dtext"
C:\Users\markh\Downloads\gta san andreas\filterscripts\road.pwn(16) : error 017: undefined symbol "vehicle_id"
C:\Users\markh\Downloads\gta san andreas\filterscripts\road.pwn(16) : error 029: invalid expression, assumed zero
C:\Users\markh\Downloads\gta san andreas\filterscripts\road.pwn(16) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

IceBilizard
03/01/2016, 12:21 PM
try this


//At top of script
new vehicle_id[3];


//Then at where you are creating vehicles

//1st vehicle
vehicle_id[0] = CreateVehicle(431, -126.66, -1210.45, 2.69, 5, 0, 120 );
vehicle3Dtext[vehicle_id[0]] = Create3DTextLabel("Bus 45 Los Santos", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle(vehicle3Dtext[vehicle_id[0]], vehicle_id[0], 0.0, 0.0, 2.0);

//2nd vehicle
vehicle_id[1] = CreateVehicle(431, 1402.71, 1028.00, 10.81, 5, 0, 120 );
vehicle3Dtext[vehicle_id[1]] = Create3DTextLabel("Bus 25 San Fierro", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle(vehicle3Dtext[vehicle_id[1]], vehicle_id[1], 0.0, 0.0, 2.0);

//3rd vehicle
vehicle_id[2] = CreateVehicle(431, -98.67, -1168.64, 2.57, 5, 0, 120 );
vehicle3Dtext[vehicle_id[2]] = Create3DTextLabel("Bus 31 Las Venturas", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle(vehicle3Dtext[vehicle_id[2]], vehicle_id[2], 0.0, 0.0, 2.0);

coolmark1995
03/01/2016, 09:09 PM
try this


//At top of script
new vehicle_id[3];


//Then at where you are creating vehicles

//1st vehicle
vehicle_id[0] = CreateVehicle(431, -126.66, -1210.45, 2.69, 5, 0, 120 );
vehicle3Dtext[vehicle_id[0]] = Create3DTextLabel("Bus 45 Los Santos", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle(vehicle3Dtext[vehicle_id[0]], vehicle_id[0], 0.0, 0.0, 2.0);

//2nd vehicle
vehicle_id[1] = CreateVehicle(431, 1402.71, 1028.00, 10.81, 5, 0, 120 );
vehicle3Dtext[vehicle_id[1]] = Create3DTextLabel("Bus 25 San Fierro", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle(vehicle3Dtext[vehicle_id[1]], vehicle_id[1], 0.0, 0.0, 2.0);

//3rd vehicle
vehicle_id[2] = CreateVehicle(431, -98.67, -1168.64, 2.57, 5, 0, 120 );
vehicle3Dtext[vehicle_id[2]] = Create3DTextLabel("Bus 31 Las Venturas", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle(vehicle3Dtext[vehicle_id[2]], vehicle_id[2], 0.0, 0.0, 2.0);

n/a s