SA-MP Forums Archive
/repair to 2 help me plzz - 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: /repair to 2 help me plzz (/showthread.php?tid=117079)



/repair to 2 help me plzz - snabbo - 31.12.2009

Hi everyone,

I have one question: how can a command button on a keyboard to do (eg if you / repair and that you then instead of typing in / repair in 1 to 2 times on your keyboard to click that then your vehicle is made)

Already super thanks!
snabbo


Re: /repair to 2 help me plzz - snabbo - 31.12.2009

this de code:

Код:
 if (!strcmp("/repair", cmdtext))
  {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Je zit niet in een voertuig!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    return 1;
  }
it's a nederlands server :P


Re: /repair to 2 help me plzz - Deat_Itself - 31.12.2009

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{


if(newkeys & KEY_SUBMISSION)
{
if(!IsPlayerInAnyVehicle(playerid)) return 1;
else
{
RepairVehicle(GetPlayerVehicleID(playerid));
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
return 1;
}
}
only repair vehicle will not set the vehicle health


Re: /repair to 2 help me plzz - snabbo - 31.12.2009

ty it work