Car attachment
#1

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+
Reply
#2

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;
}
Reply
#3

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"cmdtexttrue11) == 0)
{
    new 
light,vehmodel,v;
    
light CreateObject(18646,2001.1956791547.11389214.2834000.00.096.0);
    
GetPlayerVehicleID(playerid);
    
vehmodel GetVehicleModel(v);
    if ((
vehmodel == 541 || vehmodel == 560)) {
                    
AttachObjectToVehicle(lightv002000);
                         
    }
    return 
1;

Reply
#4

dude he already defined it! -_-
pawn Код:
new light = CreateObject(18646,2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)