Help - Dialog
#1

So,when I enter LSPD interior,there is a spot,and I need to type /pdup to go up and /pddown to go down.How can i make it appear in dialog and then chose? Who helps REP + ?


Код:
if(!strcmp(cmdtext, "/pdup", true))
 	{
		if(IsPlayerConnected(playerid))
		{
		    if(GetPlayerState(playerid) == 1)
		    {
		        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pAdminDuty] == 1)
		        {
		            if(IsPlayerInRangeOfPoint(playerid, 1,242.7591,66.4315,1003.6406))
		            {
		            	SafeSetPlayerPos(playerid, 1556.1990,-1671.6530,28.3956);
		            	GameTextForPlayer(playerid, "~w~Police Departemnt Roof",5000,1);
						SafeSetPlayerInterior(playerid,0);
						new y, m, d;
						new h,mi,s;
						getdate(y,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /pdup",d,m,y,h,mi,s,sendername);
						CommandLog(string);
					}
		        }
		    }
		}
		return 1;
 	}

 	if(!strcmp(cmdtext, "/pddown", true))
 	{
 	    if(IsPlayerConnected(playerid))
		{
		    if(GetPlayerState(playerid) == 1)
		    {
		        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pAdminDuty] == 1)
		        {
		            if(IsPlayerInRangeOfPoint(playerid, 1,242.7591,66.4315,1003.6406))
		            {
		            	SafeSetPlayerPos(playerid, 1526.5972,-1676.0651,5.8906);
		            	GameTextForPlayer(playerid, "~w~Police Departemnt Garage",5000,1);
						SafeSetPlayerInterior(playerid,0);
						new y, m, d;
						new h,mi,s;
						getdate(y,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /pddown",d,m,y,h,mi,s,sendername);
						CommandLog(string);
					}
		        }
		    }
		}
		return 1;
 	}
Reply
#2

Well offcourse you can do it with dialog.. Search on ******..
Here is what i found for you!
Btw this is for weapons but you have to change ondialogresponse to move object or whatever you want!
Reply
#3

Your Mean Is You Want Delete The Commands And Use Dialog ?
Reply
#4

pawn Код:
#define DIALOG_UPDOWN 50
pawn Код:
if(!strcmp(cmdtext, "/pd", true))
    {
        if(IsPlayerConnected(playerid))
        {
            if(GetPlayerState(playerid) == 1)
            {
                if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pAdminDuty] == 1)
                {
                    if(IsPlayerInRangeOfPoint(playerid, 1,242.7591,66.4315,1003.6406))
                    {
                        ShowPlayerDialog(playerid, DIALOG_UPDOWN, DIALOG_STYLE_LIST, "Go up / down", "Up\nDown", "Ok", "Cancel"); //you have to : #define DIALOG_UPDOWN 50 (or 1 or whatever non used ID)

                    }
                }
            }
        }
        return 1;
    }
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == DIALOG_UPDOWN)
    {
        if (response)
        {
            if (listitem == 0)
            {
                        SafeSetPlayerPos(playerid, 1556.1990,-1671.6530,28.3956);
                        GameTextForPlayer(playerid, "~w~Police Departemnt Roof",5000,1);
                        SafeSetPlayerInterior(playerid,0);
                        new y, m, d;
                        new h,mi,s;
                        getdate(y,m,d);
                        gettime(h,mi,s);
                        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /pdup",d,m,y,h,mi,s,sendername);
                        CommandLog(string);
            }
            else if (listitem == 1)
            {
                        SafeSetPlayerPos(playerid, 1526.5972,-1676.0651,5.8906);
                        GameTextForPlayer(playerid, "~w~Police Departemnt Garage",5000,1);
                        SafeSetPlayerInterior(playerid,0);
                        new y, m, d;
                        new h,mi,s;
                        getdate(y,m,d);
                        gettime(h,mi,s);
                        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /pddown",d,m,y,h,mi,s,sendername);
                        CommandLog(string);
            }
           
        }
    }
           
    return 1;
}
not tested! try it
search about dialogs they are really easy to use!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)