Deactivate waterthrower
#1

Hi guys!

Is there a function to deactivate / block the waterthrower of the firetruck?

Best regards

selEcT
Reply
#2

No.
Altough you could make a Kill system when a player fires it...
Reply
#3

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 407)
    {
        new keys, up, down;
        GetPlayerKeys(playerid, keys, up, down);
        if(keys & KEY_FIRE) return 0;
    }
    return 1;
}
This might be a solution, but a quite bad one. It checks if a player is in a fire truck, and if he presses the fire key. If he does, it will desync him.
Pro: he cant harm other players with the waterthrower.
Con: also his movement and everything else will be desynced. He will stop for other player when he shoots, and will beam around when he stops firing.

If you combine this with a warning, or a kick or a punishment in any kind, this might be a solution.

Edit: question: would it work, to just desync the player once when he starts pressing the key, and not return 0 all the time he has the key pressed? (So the keypress wouldnt be synced with other players -> he never pressed it for them) I saw this somewhere some time ago, but never tested it.
Reply
#4

You could just freeze and unfreeze him quickly instead.
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 407)
    {
        new keys, up, down;
        GetPlayerKeys(playerid, keys, up, down);
        if(keys & KEY_FIRE)
        {
            TogglePlayerControllable(playerid, 0);
            TogglePlayerControllable(playerid, 1);
         }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)