Need Teleport Dialog Box
#1

How i add Teleports on Dialog box when player type /teleports a box open and when he click on teleport name he direct goto area dont need to type teleport name like /dday or /twist

i mean i need lisiten menu

Код:
if(strcmp(cmdtext, "/dday1", true) == 0) {
                new name[MAX_PLAYER_NAME];
                new msg[256];
		SetPlayerPos(playerid,2827.3567,-2143.6956,11.0872);
		GameTextForPlayer(playerid, "~w~Welcome To D-Day1 Deathmatch~G~", 5000, 5);
        GivePlayerWeapon(playerid,29,700);//weapon mp5
		GivePlayerWeapon(playerid,31,400);//m4
		GivePlayerWeapon(playerid,16,20);//nades
		GivePlayerWeapon(playerid,23,50000);//pistol
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        format(msg, sizeof(msg), "TELE: %s has joined D-Day Team 1 (/dday1)",name,playerid);
        SendClientMessageToAll(COLOR_YELLOW, msg);
	    return 1;
    }
	if(strcmp(cmdtext,"/twist",true)==0)
	{
                new name[MAX_PLAYER_NAME];
                new msg[256];
		new vehicleid = GetPlayerVehicleID(playerid);
		new State = GetPlayerState(playerid);
		if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
		{
            GetPlayerName(playerid,name,MAX_PLAYER_NAME);
            format(msg, sizeof(msg), "TELE: %s has gone to The Twisty Road (/twist)",name,playerid);
            SendClientMessageToAll(COLOR_YELLOW, msg);
			GameTextForPlayer(playerid, "~w~Type /v to spawn cars ~G~", 5000, 5);
			return SetVehiclePos(vehicleid,947.219055, 142.820281, 302.127349);
		}
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        format(msg, sizeof(msg), "TELE: %s has gone to The Twisty Road (/twist)",name,playerid);
        SendClientMessageToAll(COLOR_YELLOW, msg);
		SetPlayerPos(playerid,947.219055, 142.820281, 302.127349);
		GameTextForPlayer(playerid, "~w~Type /v to spawn cars ~G~", 5000, 5);
		return 1;
	}
Reply
#2

https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Reply
#3

sufyan i cant understand wiki can u help me
Reply
#4

pawn Код:
if(strcmp(cmdtext, "/teleports", true) == 0)
{
    ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST,"Teleport","D-Day\nTwisty Road","Select","Exit");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 9999:
        {
            if(!response) return 0;
            if(response)
            {
                switch(listitem)
                {
                    case 0:
                    {
                        new name[MAX_PLAYER_NAME];
                        new msg[256];
                        SetPlayerPos(playerid,2827.3567,-2143.6956,11.0872);
                        GameTextForPlayer(playerid, "~w~Welcome To D-Day1 Deathmatch~G~", 5000, 5);
                        GivePlayerWeapon(playerid,29,700);//weapon mp5
                        GivePlayerWeapon(playerid,31,400);//m4
                        GivePlayerWeapon(playerid,16,20);//nades
                        GivePlayerWeapon(playerid,23,50000);//pistol
                        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
                        format(msg, sizeof(msg), "TELE: %s has joined D-Day Team 1 (/dday1)",name,playerid);
                        SendClientMessageToAll(COLOR_YELLOW, msg);
                    }
                    case 1:
                    {
                        new name[MAX_PLAYER_NAME];
                        new msg[256];
                        new vehicleid = GetPlayerVehicleID(playerid);
                        new State = GetPlayerState(playerid);
                        if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
                        {
                            GetPlayerName(playerid,name,MAX_PLAYER_NAME);
                            format(msg, sizeof(msg), "TELE: %s has gone to The Twisty Road (/twist)",name,playerid);
                            SendClientMessageToAll(COLOR_YELLOW, msg);
                            GameTextForPlayer(playerid, "~w~Type /v to spawn cars ~G~", 5000, 5);
                            return SetVehiclePos(vehicleid,947.219055, 142.820281, 302.127349);
                        }
                        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
                        format(msg, sizeof(msg), "TELE: %s has gone to The Twisty Road (/twist)",name,playerid);
                        SendClientMessageToAll(COLOR_YELLOW, msg);
                        SetPlayerPos(playerid,947.219055, 142.820281, 302.127349);
                        GameTextForPlayer(playerid, "~w~Type /v to spawn cars ~G~", 5000, 5);
                    }
                }
            }
        }
    }
    return 1;
}
Reply
#5

Код:
#define TELE 5678 //Top Of your Script

//Your Command
	if(strcmp(cmdtext,"/teleports",true)==0)
	{
	ShowPlayerDialog(playerid,TELE,DIALOG_STYLE_LIST,"Teleports"," D-Day Team \n The Twistry Road","Teleport", "Cancel");
	return 1;
	}




//your Dialog response
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{


	switch(dialogid == TELE) 
    {
        case 1:
        {
            if(!response) return SendClientMessage(playerid, 0xFF0000FF, "You cancel the teleports dialog.");

            switch(listitem) 
            {
            
                case 0: 
                {
                
                       new name[MAX_PLAYER_NAME];
                new msg[256];
		SetPlayerPos(playerid,2827.3567,-2143.6956,11.0872);
		GameTextForPlayer(playerid, "~w~Welcome To D-Day1 Deathmatch~G~", 5000, 5);
        GivePlayerWeapon(playerid,29,700);//weapon mp5
		GivePlayerWeapon(playerid,31,400);//m4
		GivePlayerWeapon(playerid,16,20);//nades
		GivePlayerWeapon(playerid,23,50000);//pistol
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        format(msg, sizeof(msg), "TELE: %s has joined D-Day Team 1 (/dday1)",name,playerid);
        SendClientMessageToAll(COLOR_YELLOW, msg);
                }
                case 1:
                {
                		new vehicleid = GetPlayerVehicleID(playerid);
		new State = GetPlayerState(playerid);
		if(IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
		{
            GetPlayerName(playerid,name,MAX_PLAYER_NAME);
            format(msg, sizeof(msg), "TELE: %s has gone to The Twisty Road (/twist)",name,playerid);
            SendClientMessageToAll(COLOR_YELLOW, msg);
			GameTextForPlayer(playerid, "~w~Type /v to spawn cars ~G~", 5000, 5);
			return SetVehiclePos(vehicleid,947.219055, 142.820281, 302.127349);
		}
        GetPlayerName(playerid,name,MAX_PLAYER_NAME);
        format(msg, sizeof(msg), "TELE: %s has gone to The Twisty Road (/twist)",name,playerid);
        SendClientMessageToAll(COLOR_YELLOW, msg);
		SetPlayerPos(playerid,947.219055, 142.820281, 302.127349);
		GameTextForPlayer(playerid, "~w~Type /v to spawn cars ~G~", 5000, 5);
                }
                case 2:
                {
                 //Add Here your 3rd List Choice and ++
                }
                

            }

        }
        

    }
    
	return 1;
}
Reply
#6

thanks guys its workng
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)