PlayerKeysStill dont work - 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: PlayerKeysStill dont work (
/showthread.php?tid=79097)
PlayerKeysStill dont work -
Divine - 25.05.2009
I made these lines
pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
new keys, alt, alt1;
{
if(IsPlayerInAnyVehicle(playerid))
GetPlayerKeys(playerid, keys, alt, alt1);
}
if(alt == KEY_FIRE) // the left alt key this time, or the mouse left button, the nitro button
SendClientMessage(playerid, 0xFF0000AA, "Notro is not allowed");
RemovePlayerFromVehicle(playerid);
return 1;
}
the point is ... it compiles with NO ERRORS ...
but when I enter a car ... ir removes me from car even if i press "w" or "s" or anything ...
...
but I want it only to detect "the left alt button" or "left mouse button" ...
...
any help/suggestions ?
Re: PlayerKeysStill dont work -
Weirdosport - 25.05.2009
Errr, not sure what's going on there but try this:
pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
new tempkeys = newkeys-oldkeys;
if(tempkeys == KEY_FIRE)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, 0xFF0000AA, "Nitro is not allowed");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
Re: PlayerKeysStill dont work -
Divine - 25.05.2009
Quote:
Originally Posted by Weirdosport
Errr, not sure what's going on there but try this:
pawn Код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys) { new tempkeys = newkeys-oldkeys; if(tempkeys == KEY_FIRE) { if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, 0xFF0000AA, "Nitro is not allowed"); RemovePlayerFromVehicle(playerid); } } return 1; }
|
[me=Divine]<3 You :P :P :P[/me]
WORKS GREAT MAN
Thnx
))