#1

hey guys i have a siren command and i have some coords only for bullet and infernus cars but if i try to add the siren to a turismo is set's on air can i do something like detecting player car id and set the good coords of the siren on that veh?

i already have the good coords for turismo car but i want to make like /siren and should get the player vehicle id like 451 turismo and give him the right pos of siren and not the bullet/infernus code , is possible?
Reply
#2

You cant make the script just magically detect the roof and place it there, you could however make something like this but it requires that you actually get the vehicles offset position and place it under this

pawn Код:
CMD:siren(playerid,params[]) {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are not inside any vehicles");
    addVehicleSirens(GetVehicleModel(GetPlayerVehicleID(playerid)));
    return true;
}

addVehicleSirens(vehicleid) {
    switch(vehicleid) {
        case 451: AttachObjectToVehicle(siren, vehicleid, x,y,z,rx,ry,rz);  //if vehicle model is 451 (turismo)
        case 411: AttachObjectToVehicle(siren, vehicleid, x,y,z,rx,ry,rz);  //if vehicle model is 411 (nfernus)
        //add more cases... Replace X Y Z with your coordinates
    }

}
Reply
#3

thx verry much
Reply
#4

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
You cant make the script just magically detect the roof and place it there
I think GetVehicleModelInfo gets close enough.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)