SA-MP Forums Archive
Block F4 Key - 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: Block F4 Key (/showthread.php?tid=202961)



Block F4 Key - piohh - 25.12.2010

Hi, I don't find any things here to block the F4 Key for all users.
I hope someone know the Keynumber or things to block this.

Greetz Pio


Re: Block F4 Key - Voldemort - 25.12.2010

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerLoggedIn[playerid] == 1) // Your way how you recognzie logged in player
    {
        SpawnPlayer(playerid);
    }
    else
    {
        //Your usual class selecting
    }
    return 1;
}



Re: Block F4 Key - piohh - 25.12.2010

ok. I will test it.


Re: Block F4 Key - Steven82 - 25.12.2010

Quote:
Originally Posted by Las Venturas CNR
Посмотреть сообщение
It'd be nice if there was a function somewhat close to

pawn Код:
F4MayBeUsed(false);
F4MayBeUsed(true);
which would go under "OnGameModeInIt".
Yes in some RP servers you can bug abuse and change your skin for free doing this.


Re: Block F4 Key - Hiddos - 25.12.2010

Well, possible idea:

pawn Код:
#define ForceClassSelection O_ForceClassSelection
new bool:cs[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
  cs[playerid] = false;
  return 1;
}

public OnPlayerConnect(playerid)
{
  cs[playerid] = true;
  return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
  if(!cs[playerid]) return SpawnPlayer(playerid);
  //other code
  return 1;
}

//undef ForceClassSelection
stock O_ForceClassSelection(playerid)
{
  cs[playerid] = true;
  ForceClassSelection(playerid);
}
Just a possible idea, this only allows them to select a class if you use ForceClassSelection.

I used this on a diferrent project once.