How To Script..
#2

You must first create the pickup..

PHP код:
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 код:
enum houseinfo
{
   
housepassword;
}
new 
HouseInfo[MAX_HOUSES][houseinfo]; 
Then do like that..

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

Then the dialog response

PHP код:
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;

Reply


Messages In This Thread
How To Script.. - by Vizi10 - 16.05.2018, 19:36
Re: How To Script.. - by JasonRiggs - 16.05.2018, 19:53
Re: How To Script.. - by Vizi10 - 16.05.2018, 20:12
Re: How To Script.. - by JasonRiggs - 16.05.2018, 20:13
Re: How To Script.. - by Lokii - 16.05.2018, 20:14
Re: How To Script.. - by JasonRiggs - 16.05.2018, 20:25
Re: How To Script.. - by Vizi10 - 16.05.2018, 20:29
Re: How To Script.. - by Lokii - 16.05.2018, 20:31
Re: How To Script.. - by GTLS - 17.05.2018, 04:33

Forum Jump:


Users browsing this thread: 1 Guest(s)