Convert this into a dialog?
#1

Hello, I would like to convert this into a dialog but I'm unsure how to.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    gPlayerClass[playerid] = ASSAULT_CLASS;

   
    SetPlayerPos(playerid,220.3261,1822.9734,7.5368);
    SetPlayerCameraLookAt(playerid,220.3261,1822.9734,7.5368);
    SetPlayerCameraPos(playerid,226.7491,1823.0441,7.4141);
    SetPlayerFacingAngle(playerid, 270 );
    ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1); //smooth dancing
    CreateExplosion(212.9525,1822.9084,6.4141, 11, 10.0);

    // TEAM STUFF
    if(classid == TEAM_GERMANY) {
        SetPlayerSkin(playerid, 179);
        GameTextForPlayer(playerid,"~g~GERMANY",1000,4);
        SetPlayerColor(playerid, TEAM_GERMANY_COLOR);
        gTeam[playerid] = TEAM_GERMANY;
    }
    if(classid == TEAM_IRAQ) {
        SetPlayerSkin(playerid, 128);
        GameTextForPlayer(playerid,"~p~Taliban Cell",1000,4);
        SetPlayerColor(playerid, TEAM_IRAQ_COLOR);
        gTeam[playerid] = TEAM_IRAQ;
    }
    if(classid == TEAM_RUSSIA) {
        SetPlayerSkin(playerid, 206);
        GameTextForPlayer(playerid,"~r~Soviet Union",1000,4);
        SetPlayerColor(playerid, TEAM_RUSSIA_COLOR);
        gTeam[playerid] = TEAM_RUSSIA;
    }
    if(classid == TEAM_USA) {
        SetPlayerSkin(playerid, 287);
        GameTextForPlayer(playerid,"~b~United States of America",1000,4);
        SetPlayerColor(playerid, TEAM_USA_COLOR);
        gTeam[playerid] = TEAM_USA;
    }
    if(classid == TEAM_BANGLADESH) {
        SetPlayerSkin(playerid, 285);
        GameTextForPlayer(playerid,"~p~European Alliance",1000,4);
        SetPlayerColor(playerid, TEAM_BANGLADESH_COLOR);
        gTeam[playerid] = TEAM_BANGLADESH;
    }
    return 1;
}
Reply
#2

PHP код:
#define DIALOG_TEAMS 3
//......................................................//
//......................................................//
//......................................................//
//......................................................//
//......................................................//
public OnPlayerConnect(playerid)
{
ShowPlayerDialog(playeridDIALOG_TEAMSDIALOG_STYLE_LIST"Teams""Germany\nIraq\nRussia""Choose""Quit");
    return 
1;
}
//......................................................//
//......................................................//
//......................................................//
//......................................................//
//......................................................//
//......................................................//
//......................................................//
//......................................................////......................................................//
//......................................................//
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_TEAMS)
    {
        if(
response
        {
           
            if(
listitem == 0
            {
                
SetPlayerSkin(playerid179);
                
SendClientMessage(playeridGREEN"Welcome to GERMANY");
                
SetPlayerColor(playeridTEAM_GERMANY_COLOR);
                
gTeam[playerid] = TEAM_GERMANY;
            }
            if(
listitem == 1
            {
                
SendClientMessage(playeridGREEN"Welcome to IRAQ");
                
SetPlayerSkin(playerid128);
                
GameTextForPlayer(playerid,"~p~Taliban Cell",1000,4);
                
SetPlayerColor(playeridTEAM_IRAQ_COLOR);
                
gTeam[playerid] = TEAM_IRAQ;
            }
            if(
listitem == 2
            {
            
SendClientMessage(playeridGREEN"Welcome to Russia");
            
SetPlayerSkin(playerid206);
            
GameTextForPlayer(playerid,"~r~Soviet Union",1000,4);
            
SetPlayerColor(playeridTEAM_RUSSIA_COLOR);
            
gTeam[playerid] = TEAM_RUSSIA;
            }
        }
        return 
1;
    }
    return 
0

Reply
#3

Hm you help a lot, deserves a rep!=]
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)