SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 11/06/2019, 04:51 PM   #1
Lokii
Huge Clucker
 
Join Date: Sep 2017
Posts: 375
Reputation: 87
Default Keypad (clickable)


KEYPAD

current version (v1.3)

This include does the same job as this one but got more features.

You must add

PHP Code:
public OnPlayerEnterKeypadArea(playeridkeypadid)
{
    return 
1;
}

public 
OnKeypadResponse(playeridkeypadidbool:responsebool:successcode[])
{
    return 
1;

or else you will get error.


Functions:

Code:
native CreateKeypad(code[], color = 0x00FF00FF); //length 1-10
native CreateKeypadEx(Float:x, Float:y, Float:z, code[], color = 0x00FF00FF, worldid = 0, interior = 0); //length 1-10
native SetKeypadCode(keypadid, new_code[]);
native SetKeypadHoverColor(keypadid, color);
native SetKeypadInterior(keypadid, interior);
native SetKeypadWorld(keypadid, worldid);
native SetKeypadPos(keypadid, Float:x, Float:y, Float:z);
native ShowPlayerKeypad(playerid, keypadid);
native GetKeypadLength(keypadid);
native GetKeypadPos(keypadid, &Float:x, &Float:y, &Float:z);
native GetPlayerKeypadID(playerid);
native GetKeypadHoverColor(keypadid);
native GetKeypadInterior(keypadid);
native GetKeypadWorld(keypadid);
native HidePlayerKeypad(playerid, keypadid);
native DestroyKeypad(keypadid);
native DestroyAllKeypads();
Callbacks:

Code:
native OnPlayerEnterKeypadArea(playerid, keypadid);
native OnKeypadResponse(playerid, keypadid, bool:response, success, code[]);
Script from the video:

PHP Code:
#define FILTERSCRIPT

#include <a_samp>
#include <KeyPad>
#include <zcmd>

new key1;
new 
key2;
new 
key3;

public 
OnFilterScriptInit()
{
    
CreateObject(29221930.860961361.9921910.15799,   0.000000.00000268.23666);
    
CreateObject(29221930.778691375.4792510.15799,   0.000000.00000268.23666);
    
key1 CreateKeypadEx(1931.000981361.775028.34830"1234");
    
key2 CreateKeypadEx(1931.275271375.073738.34830"12355");
    
key3 CreateKeypad("12");
    return 
1;
}

public 
OnPlayerEnterKeypadArea(playeridkeypadid)
{
    
ShowPlayerKeypad(playeridkeypadid);
    return 
1;
}

CMD:key(playeridparams[])
{
    
HidePlayerKeypad(playerid22);
    
ShowPlayerKeypad(playeridkey1);
    return 
1;
}

CMD:key2(playeridparams[])
{
    
ShowPlayerKeypad(playeridkey2);
    return 
1;
}

CMD:key3(playeridparams[])
{
    
ShowPlayerKeypad(playeridkey3);
    return 
1;
}

CMD:destroy(playeridparams[])
{
    
DestroyKeypad(strval(params));
    return 
1;
}

CMD:code(playeridparams[])
{
    
SetKeypadCode(key2params);
    return 
1;
}

public 
OnKeypadResponse(playeridkeypadidbool:responsebool:successcode[])
{
    if(
keypadid == key3)
    {
        if(!
response)
        {
            
HidePlayerKeypad(playeridkeypadid);
            return 
1;
        }
        if(
success)
        {
            
SendClientMessage(playerid0x00FF00FF":)");
            return 
1;
        }
    }
    if(
keypadid == key1)
    {
        if(!
response)
        {
            
SendClientMessage(playerid0xFFFFFFFF"Key 1 exit");
            
HidePlayerKeypad(playeridkeypadid);
            return 
1;
        }
        if(
response)
        {
            if(!
success)
            {
                
SendClientMessage(playerid0xFFFFFFFF"Key 1 fail");
            }
            if(
success)
            {
                
SendClientMessage(playerid0xFFFFFFFF"Key 1 success");
            }
        }
    }
    if(
keypadid == key2)
    {
        if(!
response)
        {
             
SendClientMessage(playerid0xFFFFFFFF"Key 2 exit");
             
HidePlayerKeypad(playeridkeypadid);
            return 
1;
        }
        if(
response)
        {
            if(!
success)
            {
                
SendClientMessage(playerid0xFFFFFFFF"Key 2 fail");
            }
            if(
success)
            {
                
SendClientMessage(playerid0xFFFFFFFF"Key 2 success");
            }
        }
    }
    return 
1;

Pic:



Video: "https://www.youtube.com/watch?v=CPsQf8idZIM"

Github: Click here

Download: Click here

requires:

YSI, streamer, foreach, a_samp


Bugs:

Please report if you find any.


Credits:

SA-MP team - a_samp
MP2 - idea
****** - y_hooks, foreach
Lokii - keypad
Incognito - streamer
__________________

Last edited by Lokii; 15/10/2019 at 09:36 AM.
Lokii is offline   Reply With Quote
Old 15/10/2019, 09:36 AM   #2
Lokii
Huge Clucker
 
Join Date: Sep 2017
Posts: 375
Reputation: 87
Default Re: Keypad (clickable)

Updated V1.3
__________________
Lokii is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Interactive clickable textdraw keypad system (Easy to use) MP2 Includes 101 12/06/2019 11:23 AM
[Ajuda] Help Keypad não aparece HorNeT6 Português/Portuguese 5 16/06/2016 05:09 PM
[Pedido] FS keypad Netiinho Português/Portuguese 5 24/07/2014 11:02 PM
keypad 0.3e help Tarik_Tare Scripting Help 2 14/05/2012 08:55 PM
[HELP] Keypad.inc don't open clickable textdraw Abravanel Scripting Help 4 09/04/2012 10:25 PM


All times are GMT. The time now is 11:39 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.