Car attachment - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car attachment (
/showthread.php?tid=515930)
Car attachment (+REP!) -
Bek_Loking - 28.05.2014
AttachObjectToVehicle(objectid, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:RotX, Float:RotY, Float:RotZ)
I want to attach this object: 18646
To car like this: 541 and 560
With a command etc. /policelight
If someone could make a example script or so, I'd give rep+
Re: Car attachment -
Matess - 28.05.2014
pawn Код:
if (strcmp("/policelight", cmdtext, true, 11) == 0)
{
new light = CreateObject(18646,2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid));
if (vehmodel == 541 || vehmodel == 560)
{
AttachObjectToVehicle(light, GetPlayerVehicleID(playerid), 0, 0, 2, 0, 0, 0);
}
return 1;
}
Re: Car attachment -
Lacamora - 28.05.2014
Quote:
Originally Posted by Matess
pawn Код:
if (strcmp("/policelight", cmdtext, true, 11) == 0) { new light = CreateObject(18646,2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0) new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid)); if (vehmodel == 541 || vehmodel == 560) { AttachObjectToVehicle(light, GetPlayerVehicleID(playerid), 0, 0, 2, 0, 0, 0) } return 1; }
|
you must @define light
& and the
'' ; '' ^^
PHP код:
if (strcmp("/policelight", cmdtext, true, 11) == 0)
{
new light,vehmodel,v;
light = CreateObject(18646,2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
v = GetPlayerVehicleID(playerid);
vehmodel = GetVehicleModel(v);
if ((vehmodel == 541 || vehmodel == 560)) {
AttachObjectToVehicle(light, v, 0, 0, 2, 0, 0, 0);
}
return 1;
}
Re: Car attachment -
Eth - 28.05.2014
dude he already defined it! -_-
pawn Код:
new light = CreateObject(18646,2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);