PlayerKeysStill dont work
#1

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 ?
Reply
#2

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;
}
Reply
#3

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 ))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)