Is it possible?
#1

Well, I'm here to ask if it's possible to disable F4 and prevent it from changing your class/team?
Reply
#2

Please use the forum search function, this has been handled before.
Reply
#3

Just spawn them when they reach the class selection menu unless they used the command previously
Reply
#4

Well, if it's handled before can you please tell me how?.. The only way I know to disable it is to return 0 in OnPlayerRequestClass, but I need that callback so that's not a solution, one of my community scripter is working on a command to disable /switchteam, but we need to know if there's a way to prevent people from using F4.
Reply
#5

Make a variable, assign it's value to 1 when the player connects. Then check if the value is 1 under OnPlayerRequestClass, if it is, then let the player choose the skin and then set the value to 0. If the value is 0 under OnPlayerRequest class then respawn the player. Hope this might work out.
Reply
#6

Already did that, and it works perfectly but some people bypass it by using F4..
Reply
#7

But how the player gets the value 1 by hitting F4? That ain't possible.

Wait lemme try it out.
Reply
#8

Give this a try and let me know if it works:
pawn Код:
new F4[MAX_PLAYERS];
public OnPlayerRequestClass(playerid, classid)
{
    if(F4[playerid] == 1)
    {
        SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
        SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
        SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
        F4[playerid] = 0;
        print("value found to be 1");
        print("value set to be 0");
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    F4[playerid] = 1;
    print("Value set to 1");
    return 1;
}
Reply
#9

Didn't work.. still F4 bypasses it.
Reply
#10

I don't know if this can help you or not,but here's a plugin that detects keys.
https://sampforum.blast.hk/showthread.php?tid=268671
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)