Question Of Need - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Question Of Need (
/showthread.php?tid=132487)
Question Of Need -
jesus17 - 07.03.2010
I was wondering how i can bind a key in script that like fixes your car. Like I have a stunt server so i need help on binding a key that fixes your car
Re: Question Of Need -
Carlton - 07.03.2010
To do a keybinding autorepair, you must use the OnPlayerKeyState change callback. If you don't know how to add it there, the tutorial here will explain how the callback works.
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Re: Question Of Need -
jesus17 - 07.03.2010
Thanks for the help.
Re: Question Of Need -
aircombat - 07.03.2010
ok here is an example :
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_FIRE))
{
RepairVehicle(GetPlayerVehicleID(playerid));
return 1;
}
return 1;
}
that will make u when u press ((left mouse button)) ur car get fixed
________
Jailbroken