27.09.2012, 15:58
pawn Код:
//at the top
#define epass "changeme" //define your elevator password
//command (zcmd)
CMD:elevator(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid,1,x,y,z)) //check if they are near the elevator.
{//if they're near the elevator, then show them a dialog box
ShowPlayerDialog(playerid,6287,DIALOG_STYLE_INPUT,"Enter the password", "In order to use this elevator, you need to enter the password below.","Enter","Cancel"); //now they need to enter the password
}
//if they're not near the elevator, then...
else return SendClientMessage(playerid,-1,"You are not near the elevator!");
return 1;
}
//OnDialogResponse
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 6287 && response)
{
if(!strcmp(epass,inputtext,true))//if they've entered a correct password, then
{
//move the the elevator
}
else return SendClientMessage(playerid,-1,"Wrong Password!");//if they've entered a wrong password
}
return 1;
}