06.07.2013, 22:31
Under
I want to have these two functions but I don't know how to combine them
First:
Second:
I have no idea how to combine those two under OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
First:
Код:
if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(newkeys == KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid)) { { new VehicleID = GetPlayerVehicleID(playerid); RepairVehicle(VehicleID); AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~Vehicle ~g~Repaired ~r~+ NOS Added!",3000,3);
Код:
if ( HOLDING( KEY_FIRE ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER || HOLDING( KEY_ACTION ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER ) { AddVehicleComponent( GetPlayerVehicleID( playerid ), 1010 ); } if ( RELEASED( KEY_FIRE ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER ) { RemoveVehicleComponent( GetPlayerVehicleID( playerid ), 1010 ); } } } } return 1; }