24.04.2011, 14:27
Ok I made the system engine like this,and I have defined PRESSED and RELEASE but when I relase the key nothig happens:
What's the problem?
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicleid=GetPlayerVehicleID(playerid);
SetVehicleParamsEx(vehicleid,0,0,0,0,0,0,0);
GameTextForPlayer(playerid,"Press 2 to turn engine on",1000,4);
if(PRESSED(KEY_SUBMISSION))
{
SendClientMessage(playerid,BLUE,"The engine is turned on.");
if(RELEASED(KEY_SUBMISSION))
{
SetVehicleParamsEx(vehicleid,1,0,0,0,0,0,0);
}
}
}
return 1;
}