Disable Keyboard Button
#1

hey budies...i wish to do something but dont know how...

I've saw in a gamemode (but not source) when u just get the class selection screen...if you try to press shift key to select...a message apear : "we disable shift on selection class, you have to register/login"...
How they do it...

How i can disable on keyboard function and lock class selection by screen?
Reply
#2

OnPlayerRequest spawn, if they arent registered, retrun 0;.
Reply
#3

Thx a Lot Mate!
Reply
#4

yw
Reply
#5

i dont get it....

help?
Reply
#6

its like a trap. the "OnPlayerRequestClass" gets called when you press the shift key.
the magic is: let a
Код:
GameTextForPlayer(playerid,"~r~~h~you need to register first",4000,4);
show up for the playerid who pressed the key, then:
disturb the execution of the spawn process by a
Код:
return 0;
in stead of the (regular)
Код:
return 1;
at the end of that callback.
Reply
#7

thx man!
Reply
#8

oops, not at the end of the callback, but at the end inside your trap of coz, as mentioned before ^^
yw hehe
Reply
#9

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
  if(var == value)
  {
    // do stuff
    return 0;
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)