DFT-30 Attaching canon to DFT
#1

Hey i tried to attach a millitairy canon to a DFT but it doesnt show it! :O
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
new a;
main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}



public OnGameModeInit()
{
	a = CreateObject(3884,0,0,0,0,0,0);

	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		return 1;
	}
	return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    AttachObjectToVehicle(a, 578, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
PLS HELP!
Reply
#2

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new object = CreateObject(578,0,0,0,0,0,0);
    AttachObjectToVehicle(object, vehicleid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
    return 1;
}
Reply
#3

Do i have to change vehicleid to 578 (dft-30)?
Reply
#4

Now its crashing cause of that! -.- SA-MP 0.3c
Exception At Address: 0x00412B8A

Registers:
EAX: 0x00962161 EBX: 0x0DBCECF0 ECX: 0x009664D0 EDX: 0x10BD4CA4
ESI: 0x10BD4CA4 EDI: 0x00000000 EBP: 0x00000000 ESP: 0x0022F8B0
EFLAGS: 0x00210202

Stack:
+0000: 0x00000000 0x00966490 0x3E1F24C0 0xBEE87938
+0010: 0xBF9CE05C 0xBF3D88DA 0x0041970A 0x0022F95C
+0020: 0x004197D2 0x3F6664CC 0x10BD4CA4 0x00000000
+0030: 0x00000000 0x0AC1B798 0x0B510A38 0x0AF30480
+0040: 0x0B6D250C 0x00C1BFF8 0x0000000B 0x00000000
+0050: 0x6753C21C 0x0000001B 0x00000004 0x00000026
+0060: 0x00967DD8 0x0DBCECF0 0x00B73BB4 0x0DBCECF0
+0070: 0x10BD4EAC 0xFFFFFFFF 0x0000000A 0x00000026
+0080: 0x00000000 0x00000000 0x0B9DB198 0x3FA0CDD5
+0090: 0xC080D066 0x3EEB5486 0x40CB175C 0xC48B4327
+00A0: 0x3F8A0000 0x00533522 0x3F67A853 0x3FA0ED6A
+00B0: 0xC080DCFB 0xBF3D88DA 0x00000000 0x00000000
+00C0: 0xC29AB424 0xC48B4327 0x3F8A0000 0x3E950FB7
+00D0: 0xC0AB514C 0xBFE4372D 0x0054BCD2 0x08DFD278
+00E0: 0x00000000 0x0B510A38 0x0AC1B798 0x08DFD278
+00F0: 0x00B73710 0x0000003A 0x0B510A38 0x00000025
+0100: 0x0000003A 0x0000FD72 0xBF800000 0x00000000
+0110: 0xBF800000 0x012C0190 0xC2998B8E 0xC48A8CE6
+0120: 0x3FE3406B 0x00533522 0x0022F9F0 0x0B6D250C
+0130: 0x00200246 0x00546D5B 0x0B6D265C 0x0AF30480
+0140: 0x0B6D250C 0x0AF30480 0x00B73710 0x00000000
+0150: 0x00000000 0x00000000 0x0B510A38 0x0AC1B798
+0160: 0x00000002 0x00000000 0x0054CF1C 0x0B6D265C
+0170: 0x00B73710 0x0000003A 0x0AC1B798 0x00000025
+0180: 0x0000003A 0x00000A38 0xBF800000 0x00000000
+0190: 0xBF800000 0x0B510A38 0xB5CDF712 0x00000110
+01A0: 0x371FD349 0x80000000 0x36AB4010 0x371FD349
+01B0: 0x00B996F0 0x3EF1C97C 0x3F61A803 0x80000000
+01C0: 0x3C672EDA 0x3CD7C27C 0x80000000 0x3CE5F345
+01D0: 0x3D569BF5 0x80000000 0x006A5BBC 0x38337ACC
+01E0: 0x0022FBBC 0x36CDF712 0x0022FCE4 0x00000004
+01F0: 0x00000000 0x3A4F00D1 0x45ABE000 0x3735511C
+0200: 0x044E4B00 0x0022FBD4 0x3735511C 0xC08596AD
+0210: 0x3E3B48EE 0x3F99999A 0x3F99999A 0x00000002
+0220: 0x3F4CCCCD 0x00000000 0x0022FB80 0x0B510A38
+0230: 0xBF70892C 0x3EAF4111 0x40CB175C 0x80000000
+0240: 0x80000000 0x80000000 0xBF70892C 0x3EAF4111
+0250: 0x00000000 0x00B996F0 0x08DD7114 0x0042564E
+0260: 0xC299FD33 0xC48AA00F 0xBEAF410E 0x00425940
+0270: 0xFFFFFFFF 0x00000000 0x004254B8 0xFFFFFFFF

SCM Op: 0x77E, lDbg: 0

Game Version: US 1.0

State Information: Ped Context: 0
P0 (0,0)
Reply
#5

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new object = CreateObject(578,0,0,0,0,0,0);
    AttachObjectToVehicle(object, 578, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
    return 1;
}
Reply
#6

I assume 578 is the vehiclemodel not the vehicleid?
Reply
#7

3885 thats the id to be attached
and i still crash with that code
Reply
#8

raped whats the vehicleID?
Reply
#9

Quote:
Originally Posted by thimo
Посмотреть сообщение
raped whats the vehicleID?
578

4char
Reply
#10

The vehicle id is the slot that the server takes up on the server. These start at 1 and increment by one for each new vehicle created.

Clive gave the vehicle model, which is the type of vehicle to load. For example, Landstalker, Stallion, Turismo, etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)