22.08.2015, 15:28
[G]KeyPad
Hi guys,Today i made include called [G]KeyPad
Function
BUTTONS
0-9 to add number
Ok to response
Del to remove numer
X to close [G]Keypad
SHOW
pawn Code:
native ShowGKeyPad(playerid,keypadid,match,selectcolor = -1);
Display [G]KeyPad for player
Parameters:
pawn Code:
(playerid,keypadid,match,selectcolor)
playerid - The ID of the player to display the [G]KeyPad
keypadid - An ID to assign this [G]KeyPad to, so responses can be processed.
match - An value of keypad. ( check if player input value success)
selectcolor - Color Select textdraw ( default White)
pawn Code:
native HideGKeyPad(playerid);
Hide [G]KeyPad for player.
Parameters:
pawn Code:
(playerid)
playerid - The ID of the player to display the [G]KeyPad
pawn Code:
public OnPlayerEnterGKeyPad(playerid,success,keypadid,value,match)
This callback is called when a player click button 'Ok' on [G]KeyPad
Parameters:
pawn Code:
(playerid,success,keypadid,value,match)
playerid - The ID of the player that enter to the [G]KeyPad
success - 0 is wrong and 1 is correct
keypadid - The ID of the [G]Keypad the player enter to, assigned in ShowGKeyPad
value - Is Value of player input
match - Is Value of Keypadid


EXAMPLE
Code:
#define FILTERSCRIPT
#include <a_samp>
#include <gkeypad>
#include <zcmd>
CMD:gkeypad(playerid,params[])
{
ShowGKeyPad(playerid,1,123456,-1);
return 1;
}
CMD:cursor(playerid,params[])
{
if(IsGKeyPadOpened(playerid) == 1) SelectTextDraw(playerid,-1);
else SendClientMessage(playerid,-1,"GKeypad no opened");
return 1;
}
public OnPlayerEnterGKeyPad(playerid,success,keypadid,value,match)
{
new str[128];
format(str,sizeof(str),"%d , id : %d,value %d match %d",success,keypadid,value,match);
SendClientMessage(playerid,-1,str);
return 1;
}
https://github.com/gasmanvnn/SA-MP/b...ts/gkeypad.inc
CREDITS
Specical thank Southclaw's for Example Functions.
Gasman for script.
ZeeX for Zcmd (Example)

