05.08.2012, 20:45
Use this "system":
This above OnGameModeInit, OUTSIDE any callback:
This under OnGameModeInit, AFTER you created all the vehicles:
This at the bottom of your script:
Hope this helps you
This above OnGameModeInit, OUTSIDE any callback:
pawn Код:
new sirenon[MAX_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);
}
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;
}