Thread: How To Script..
View Single Post
Old 16/05/2018, 07:53 PM   #2
JasonRiggs
Gangsta
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 744
Reputation: 39
Default Re: How To Script..

You must first create the pickup..

PHP Code:
OnGameModeInIt()
{
   
EnterHouse CreatePickup(Model IDtypeXYZvirtual world //By the way you can also create Dynamic one...

And need a house enum that saves the password
PHP Code:
enum houseinfo
{
   
housepassword;
}
new 
HouseInfo[MAX_HOUSES][houseinfo]; 
Then do like that..

PHP Code:
public OnPlayerPickUpPickup(playeridpickupid)
{
     if(
pickupid == EnterHouse)
     {
          
ShowPlayerDialog(playerid1000DIALOG_STYLE_PASSWORD"House Password""Enter the house password below:""Enter""Close");
     }

Then the dialog response

PHP Code:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 1000)
    {
        if(!
response// That's if he pressed ESC or Cancel button.
        
{
            
SendClientMessage(playerid,0xFF0000AA,"Wrong Password!");  
        }
        else 
// That's if he pressed Okay or ENTER button.
        
{
            if(
strcmp(HouseInfo[houseid][hPassword], inputtexttrue32)
            {
                
SetPlayerPos(playerid,139.4020,1368.8059,1083.8636);  
            }
            else
            {
                
SendClientMessage(playerid,0xFF0000AA,"Wrong Password!"); 
 
                
// Re-show the login dialog
                
ShowPlayerDialog(playerid1000DIALOG_STYLE_PASSWORD"House Password""Please enter your house password:""Login""Cancel");
            }
        }
        return 
1;
    }
 
    return 
0;

__________________


Discord: Riggs #5210
JasonRiggs is offline   Reply With Quote