11.03.2011, 08:29
i make something like this
but when i use again KEY_CROUCH that police light is still there..
how can i make a variable which depend by carid?
or how i can solve this problem?
Код:
if (newkeys == KEY_CROUCH)
{
new pdlight1;
new pdlight2;
new pdlight3;
new pdlight4;
new pdlighton;
if(pdlighton == 0)
{
new checkcar = GetPlayerVehicleID(playerid);
if(checkcar == buffpd1)
{
pdlight1 = CreateObject(18646,0,0,0,0,0,0);
AttachObjectToVehicle(pdlight1, buffpd1, 0, -0.0, 0, 2.0, 2.0, 3.0);
pdlighton = 1;
}
else if(checkcar == buffpd2)
{
ipdlight2 = CreateObject(18646,0,0,0,0,0,0);
iAttachObjectToVehicle(pdlight2, buffpd2, 0, -0.0, 0, 2.0, 2.0, 3.0);
ipdlighton = 1;
}
else if(checkcar == buffpd3)
{
pdlight3 = CreateObject(18646,0,0,0,0,0,0);
AttachObjectToVehicle(pdlight3, buffpd3, 0, -0.0, 0, 2.0, 2.0, 3.0);
pdlighton = 1;
}
else if(checkcar == buffpd4)
{
pdlight4 = CreateObject(18646,0,0,0,0,0,0);
AttachObjectToVehicle(pdlight4, buffpd4, 0, -0.0, 0, 2.0, 2.0, 3.0);
pdlighton = 1;
}
return 1;
}
else
{
new checkcar = GetPlayerVehicleID(playerid);
if(checkcar == buffpd1)
{
DestroyObject(pdlight1);
}
else if(checkcar == buffpd2)
{
DestroyObject(pdlight2);
}
else if(checkcar == buffpd3)
{
DestroyObject(pdlight3);
}
else if(checkcar == buffpd4)
{
DestroyObject(pdlight4);
}
return 1;
}
}
how can i make a variable which depend by carid?
or how i can solve this problem?

