22.09.2012, 14:30
Hello everybody! I Attached a red light to maverick and it's attaching but is isn't detaching. Where is my mistake?
Код:
Definicje: #define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) #define RELEASED(%0) \ (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) OnPlayerKeyStateChange: new helilight = CreateObject(18657,0,0,0,0,0,0,100.0); if (PRESSED( KEY_CROUCH )) { new heliid = GetPlayerVehicleID(playerid); switch(GetVehicleModel(heliid)) { case 487: { AttachObjectToVehicle(helilight, GetPlayerVehicleID(playerid), 0.004999, 2.019998, 0.599999, -80.025001, 0.000000, 0.000000); //Object Model: 18657 | 0 return 1; } } } if (RELEASED( KEY_CROUCH )) { switch(GetVehicleModel(GetPlayerVehicleID(playerid))) { case 487: { DestroyObject(helilight); return 1; } } }