Not Working - 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: Not Working (
/showthread.php?tid=136801)
Not Working -
ColdXX - 26.03.2010
Hey!
This wont work...
pawn Code:
if (PRESSED(KEY_CROUCH))
{
RepairVehicle(GetPlayerVehicleID(playerid));
SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
I dont have any errors....which is the problem??:S
Thanks in advance!
Re: Not Working -
MaykoX - 26.03.2010
Quote:
Originally Posted by ColdXX
Hey!
This wont work...
pawn Code:
if (PRESSED(KEY_CROUCH)) { RepairVehicle(GetPlayerVehicleID(playerid)); SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); }
I dont have any errors....which is the problem??:S
Thanks in advance!
|
Quote:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
// Check if the player is in any vehicle and is the driver
if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if (newkeys & KEY_CROUCH)
{
RepairVehicle(GetPlayerVehicleID(playerid));
SetVehicleHealth(GetPlayerVehicleID(playerid),1000 .0);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
// Exit here
return 1;
}
}
// Exit here
return 1;
}
|
I guess it's same, Or maybe problem is in KEY_CROUCH that key never worked for me.. Try using other keys like KEY_SUBMISSION.