Help with OnPlayerKey
#1

I need this to work by pressing number 2 instead of FIRE

Quote:

if (PRESSED(KEY_FIRE))
{
new
v = GetPlayerVehicleID(playerid);
if (v){
#if defined _samp03_
RepairVehicle(v);
#else
SetVehicleHealth(v,1000.0);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_YELLOW,"Car fixed!");
}
else
{
return SendClientMessage(playerid,COLOR_YELLOW,"You need to be in a vehicle!");
#endif
}

Thanks!
Reply
#2

Usually PRESSED(KEY_ACTION) works.
You can't check for a specific key, but a key that has been assigned to the given action. The action key can be assigned to different keys for different people, but usually it is assigned to the 2 key.
Reply
#3

in this case you want KEY_SUBMISSION
Reply
#4

Quote:
Originally Posted by Joe Staff
in this case you want KEY_SUBMISSION
Worked, thanks to you two guys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)