./includes/functions.pwn(17710) : error 017: undefined symbol "GetGVarInt" ./includes/functions.pwn(17712) : error 017: undefined symbol "GetGVarInt" ./includes/functions.pwn(17713) : error 017: undefined symbol "DeleteGVar" ./includes/functions.pwn(17715) : error 017: undefined symbol "GetGVarInt" ./includes/functions.pwn(17717) : error 017: undefined symbol "GetGVarInt" ./includes/functions.pwn(17718) : error 017: undefined symbol "DeleteGVar" ./includes/functions.pwn(17729) : error 017: undefined symbol "SetGVarInt" ./includes/functions.pwn(17735) : error 017: undefined symbol "SetGVarInt" ./includes/functions.pwn(17741) : error 017: undefined symbol "SetGVarInt" ./includes/functions.pwn(17747) : error 017: undefined symbol "SetGVarInt" ./includes/functions.pwn(17755) : error 017: undefined symbol "SetGVarInt" ./includes/functions.pwn(17756) : error 017: undefined symbol "SetGVarInt" ./includes/functions.pwn(17762) : error 017: undefined symbol "SetGVarInt"
stock ToggleSiren(vehid, iTogState)
{
if(iTogState == 1)
{
if(GetGVarInt("VehSiren", vehid) != INVALID_OBJECT_ID)
{
DestroyDynamicObject(GetGVarInt("VehSiren", vehid));
DeleteGVar("VehSiren", vehid);
}
if(GetGVarInt("VehSiren2", vehid) != INVALID_OBJECT_ID)
{
DestroyDynamicObject(GetGVarInt("VehSiren2", vehid));
DeleteGVar("VehSiren2", vehid);
}
}
else
{
switch(GetVehicleModel(vehid))
{
case 402:
{
new iTempObj = CreateDynamicObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1, -1, -1, 200.0);
AttachDynamicObjectToVehicle(iTempObj, vehid, -0.20, 0.5, 0.4, 0.0, 0.0, 0.0);
SetGVarInt("VehSiren", iTempObj, vehid);
}
case 411, 541:
{
new iTempObj = CreateDynamicObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1, -1, -1, 200.0);
AttachDynamicObjectToVehicle(iTempObj, vehid, 0.0, 0.2, 0.4, 0.0, 0.0, 0.0);
SetGVarInt("VehSiren", iTempObj, vehid);
}
case 415:
{
new iTempObj = CreateDynamicObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1, -1, -1, 200.0);
AttachDynamicObjectToVehicle(iTempObj, vehid, -0.20, 0.30, 0.3, 0.0, 0.0, 0.0);
SetGVarInt("VehSiren", iTempObj, vehid);
}
case 451:
{
new iTempObj = CreateDynamicObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1, -1, -1, 200.0);
AttachDynamicObjectToVehicle(iTempObj, vehid, -0.30, 0.4, 0.6, 0.0, 0.0, 0.0);
SetGVarInt("VehSiren", iTempObj, vehid);
}
case 525:
{
new iTempObj2 = CreateDynamicObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1, -1, -1, 200.0);
new iTempObj3 = CreateDynamicObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1, -1, -1, 200.0);
AttachDynamicObjectToVehicle(iTempObj2, vehid, 0.55, -0.5, 1.5, 0.0, 0.0, 0.0);
AttachDynamicObjectToVehicle(iTempObj3, vehid, -0.55, -0.5, 1.5, 0.0, 0.0, 0.0);
SetGVarInt("VehSiren", iTempObj2, vehid);
SetGVarInt("VehSiren2", iTempObj3, vehid);
}
default:
{
new iTempObj = CreateDynamicObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1, -1, -1, 200.0);
AttachDynamicObjectToVehicle(iTempObj, vehid, -0.30, 0.4, 0.4, 0.0, 0.0, 0.0);
SetGVarInt("VehSiren", iTempObj, vehid);
}
}
}
return 1;
}
hook OnVehicleSpawn(vehicleid)
{
if(GetGVarType("VehSiren", vehicleid)) ToggleSiren(vehicleid, 1);
}
public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
{
if(DynVeh[vehicleid] != -1)
{
for(new i = 0; i != MAX_DV_OBJECTS; i++)
{
ToggleDVSiren(DynVeh[vehicleid], i, newstate);
}
}
switch(newstate)
{
case 0: ToggleSiren(vehicleid, 1);
case 1:
{
if(!GetGVarType("VehSiren", vehicleid)) ToggleSiren(vehicleid, 0);
}
}
return 1;
}
There's original plugin: https://sampforum.blast.hk/showthread.php?tid=151076
And pluginless implementation: https://sampforum.blast.hk/showthread.php?tid=370852 |
stock ToggleDVSiren(iDvSlotID, iSlot, iTogState = 0)
{
switch(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel]);
{
case 1899:
{
if(!iTogState) return 0;
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 19294;
Streamer_SetIntData(STREAMER_TYPE_OBJECT, DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID, 19294);
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
}
case 18646:
{
if(iTogState) return 0;
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 19300;
Streamer_SetIntData(STREAMER_TYPE_OBJECT, DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID, 19300);
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
}
case 19294:
{
if(iTogState) return 0;
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 1899;
Streamer_SetIntData(STREAMER_TYPE_OBJECT, DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID, 1899);
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
}
case 19300:
{
if(!iTogState) return 0;
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 18646;
Streamer_SetIntData(STREAMER_TYPE_OBJECT, DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID, 18646);
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
}
case 19419:
{
if(iTogState) return 0;
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 19420;
Streamer_SetIntData(STREAMER_TYPE_OBJECT, DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID, 19420);
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
}
case 19420:
{
if(!iTogState) return 0;
DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectModel] = 19419;
Streamer_SetIntData(STREAMER_TYPE_OBJECT, DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], E_STREAMER_MODEL_ID, 19419);
AttachDynamicObjectToVehicle(DynVehicleInfo[iDvSlotID][iSlot][gv_iAttachedObjectID], DynVehicleInfo[iDvSlotID][gv_iSpawnedID], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectZ], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRX], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRY], DynVehicleInfo[iDvSlotID][iSlot][gv_fObjectRZ]);
}
}
return 1;
}
/includes/functions.pwn(17708) : warning 213: tag mismatch ./includes/functions.pwn(17708) : error 001: expected token: ")", but found "[" ./includes/functions.pwn(17708) : warning 215: expression has no effect ./includes/functions.pwn(17708) : error 001: expected token: ";", but found "]" ./includes/functions.pwn(17708) : error 029: invalid expression, assumed zero ./includes/functions.pwn(17708) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.