AttachObjectToVehicle Help
#1

Hello,

I found a nice FS but I wanna change it a bit.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/code2", cmdtext, true, 6) == 0)
    {
        if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
        {
            return SendClientMessage(playerid, -1, "* You are not the driver!");
        }
        new pveh = GetPlayerVehicleID(playerid);
        if (!GetVehicleModel(pveh)) return SendClientMessage(playerid, -1, "* You are not in a vehicle!");
        if (VObject(obj[pveh])) return SendClientMessage(playerid, -1, "* You switched off the lights."), DObject(obj[pveh]);
        switch (GetVehicleModel(pveh))
        {
            case 596:
            {
                obj[pveh] = CObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
                AObject(obj[pveh], pveh, 0.000000, -0.379999, 0.889999, 0.000000, 0.000000, 0.000000);
            }
            case 597:
            {
                obj[pveh] = CObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
                AObject(obj[pveh], pveh, 0.000000, -0.374999, 0.884999, 0.000000, 0.000000, 0.000000);
            }
            case 598:
            {
                obj[pveh] = CObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
                AObject(obj[pveh], pveh, 0.000000, -0.334498, 0.933500, 0.000000, 0.000000, 0.000000);
            }
            case 599:
            {
                obj[pveh] = CObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
                AObject(obj[pveh], pveh, 0.000000, 0.039999, 1.153999, 0.000000, 0.000000, 0.000000);
            }
            default:
            {
                return SendClientMessage(playerid, -1, "* You are not in a CODE 2 compatible police vehicle!");
            }
        }
        return SendClientMessage(playerid, -1, "* Lights on, you are now in a CODE 2 run!");
    }
    return 0;
}
Is there a FS to move objects on vehicles to get there position because now the light is in the middle of the roof, and I want two lights on the left and right side.

Does someone know how to make that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)