SA-MP Forums Archive
Dialog after class select - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog after class select (/showthread.php?tid=456282)



Dialog after class select - ThaCrypte - 05.08.2013

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;
}



Re: Dialog after class select - Vanter - 05.08.2013

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


Re: Dialog after class select - ThaCrypte - 05.08.2013

ain't working either.


Re: Dialog after class select - ThaCrypte - 06.08.2013

still need help. (soz for bumpin)


Re: Dialog after class select - Naruto_Emilio - 06.08.2013

Copy the dialog and paste in OnPayerRequestSpawn


Re: Dialog after class select - ThaCrypte - 06.08.2013

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


Re: Dialog after class select - Naruto_Emilio - 06.08.2013

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
}



Re: Dialog after class select - ThaCrypte - 06.08.2013

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