23.12.2014, 10:25
Hey,
I've made a thing where if a SWAT player enters any of their cars in the SWAT base, a message will come up and a siren will be placed on the car. The problem is it occurs with every car a SWAT player enters.
Under OnPlayerStateChange
How can I fix this problem?
Thanks,
FunnyBear
I've made a thing where if a SWAT player enters any of their cars in the SWAT base, a message will come up and a siren will be placed on the car. The problem is it occurs with every car a SWAT player enters.
Under OnPlayerStateChange
pawn Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
Car[playerid] = GetPlayerVehicleID(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
//////////////////////////////////////SWATS VEHICLES////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if((vehicleid == SwatVehicle1 || SwatVehicle2 || SwatVehicle3 || SwatVehicle4 || SwatVehicle5 || SwatVehicle6 || SwatVehicle7 || SwatVehicle8 || SwatVehicle9 || SwatVehicle10 || SwatVehicle11 || SwatVehicle13 || SwatVehicle14 || SwatVehicle15 || SwatVehicle16 || SwatVehicle17) && (gTeam[playerid] == TEAM_SWAT))
{
new
panels,
doors,
tires,
lights;
SendClientMessage(playerid, INFO, "[SWAT VEHICLE] You can use this vehicle to do your job!");
obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.225000,0.750000,0.449999,0.000000,0.000000,0.000000);
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
Flasher[vehicleid] = 1;
return 1;
}
}
Thanks,
FunnyBear