Dialog after class select
#1

alright, so i want to make a dialog pop up after you select a class (in this case, country)
Currently when you spawn, it shows you the dialog right away.
Since this dialog should only show up after changing class, not on every spawn.

Code:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1963.0435, 1342.9009, 16.6642);
    SetPlayerCameraLookAt(playerid, 1962.0388, 1342.8906, 16.5992);
    switch(classid)
    {
     case 0:
        {
        new string[18];
        format(string, sizeof(string), "~r~United Kingdom");
        SetPlayerTeam(playerid, TEAM_UK);
        GameTextForPlayer(playerid, string, 3000, 4);
        }
     case 1:
        {
        new string[18];
        format(string, sizeof(string), "~g~America");
        GameTextForPlayer(playerid, string, 3000, 4);
        }
     case 2:
        {
        new string[18];
        format(string, sizeof(string), "~r~Russia");
        SetPlayerTeam(playerid, TEAM_RUSSIA);
        GameTextForPlayer(playerid, string, 3000, 4);
        }
     case 3:
        {
        new string[18];
        format(string, sizeof(string), "~r~Japan");
        SetPlayerTeam(playerid, TEAM_JAPAN);
        GameTextForPlayer(playerid, string, 3000, 4);
        }
     case 4:
        {
        new string[18];
        format(string, sizeof(string), "~r~Germany");
        SetPlayerTeam(playerid, TEAM_GERMANY);
        GameTextForPlayer(playerid, string, 3000, 4);
        }
    }
    {
        ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Sniper\nSoldier\nPilot\nEngineer", "Choose","");
    }
    return 1;
}
Reply
#2

it's like that
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1963.0435, 1342.9009, 16.6642);
    SetPlayerCameraLookAt(playerid, 1962.0388, 1342.8906, 16.5992);
    switch(classid)
    {
     case 0:
        {
        new string[18];
        format(string, sizeof(string), "~r~United Kingdom");
        SetPlayerTeam(playerid, TEAM_UK);
        GameTextForPlayer(playerid, string, 3000, 4);
        }
     case 1:
        {
        new string[18];
        format(string, sizeof(string), "~g~America");
        GameTextForPlayer(playerid, string, 3000, 4);
        }
     case 2:
        {
        new string[18];
        format(string, sizeof(string), "~r~Russia");
        SetPlayerTeam(playerid, TEAM_RUSSIA);
        GameTextForPlayer(playerid, string, 3000, 4);
        }
     case 3:
        {
        new string[18];
        format(string, sizeof(string), "~r~Japan");
        SetPlayerTeam(playerid, TEAM_JAPAN);
        GameTextForPlayer(playerid, string, 3000, 4);
        }
     case 4:
        {
        new string[18];
        format(string, sizeof(string), "~r~Germany");
        SetPlayerTeam(playerid, TEAM_GERMANY);
        GameTextForPlayer(playerid, string, 3000, 4);
        }
    }
        ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Sniper\nSoldier\nPilot\nEngineer", "Choose","");
    return 1;
}
try that
Reply
#3

ain't working either.
Reply
#4

still need help. (soz for bumpin)
Reply
#5

Copy the dialog and paste in OnPayerRequestSpawn
Reply
#6

I don't know what you mean with that, might sending a example code?
Reply
#7

Nvm use this
On the top
pawn Код:
new pClass[MAX_PLAYERS];

//now onplayerrequest class add this code under it
pClass[playerid] = 1;

//now under onplayerspawn

if(pClass[playerid] == 1)
{
       pClass[playerid] = 0;
       Here add te dialog

}
else {


// the rest of your code under this
}
Reply
#8

Quote:
Originally Posted by Naruto_Emilio
Посмотреть сообщение
Nvm use this
On the top
pawn Код:
new pClass[MAX_PLAYERS];

//now onplayerrequest class add this code under it
pClass[playerid] = 1;

//now under onplayerspawn

if(pClass[playerid] == 1)
{
       pClass[playerid] = 0;
       Here add te dialog

}
else {


// the rest of your code under this
}
I see what you did there :P I feel stupid that i couldn't figure it out by myself :P
REPPED, and tyvm :P
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)