Siren attach but not deleting?
#1

Quote:

new objectid = CreateObject(18646, 0, 0, 0, 0, 0, 0);
AttachObjectToVehicle(objectid, GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.944999, 0.000000, 0.000000, 0.000000); //Object Model: 19419 |
SendClientMessage(playerid, COLOR_RED, "You've Added a siren to your vehicle");

i tried /sirenoff code: DestroyObject(18646); Not worked.
Reply
#2

pawn Код:
DestroyObject(objectid);
Reply
#3

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
pawn Код:
DestroyObject(objectid);
Not working.
Reply
#4

You'll have to define it within the global scope, and you'll need to make one slot for every car you want to be able to set it on.

This forum requires that you wait 120 seconds between posts. Please try again in 44 seconds. ;(
Reply
#5

Use this "system":

This above OnGameModeInit, OUTSIDE any callback:
pawn Код:
new sirenon[MAX_VEHICLES];
This under OnGameModeInit, AFTER you created all the vehicles:
pawn Код:
for(new vehicleid=0;vehicleid<=MAX_VEHICLES;vehicleid++)
    {
    sirenon[vehicleid] = CreateDynamicObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    }
This at the bottom of your script:
pawn Код:
CMD:siren(playerid,params[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"You are not in any vehicle");
    AttachObjectToVehicle(siren[vehicleid],(GetPlayerVehicleID(playerid)), 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
    return 1;
}
CMD:nosiren(playerid,params[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"You are not in any vehicle");
    DestroyObject(siren[vehicleid]);
   
    return 1;
}
Hope this helps you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)