Alright, this is just an example of how to do it, you will have to edit it to your classes, and ranks, for now, I will use player score.
pawn Код:
#define DIALOG_CLASSES 1000
new class[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
ShowPlayerDialog(playerid, DIALOG_CLASSES, DIALOG_STYLE_LIST, "Pick a Class", "Sniper \nArmy(10 score+) \nNavy(20 Score+) \nMarines(50 score+)", "Select","");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_CLASSES:
{
new score = GetPlayerScore(playerid);
if(!response){ }
if(response)
{
switch(listitem)
{
case 0:
{
if(score >= 0)
{
class[playerid] = 1;
SendClientMessage(playerid, -1, "You have joined the Sniper class!");
}
}
case 1:
{
if(score >= 10)
{
class[playerid] = 2;
SendClientMessage(playerid, -1, "You have joined the Army Class!");
}
else
{
SendClientMessage(playerid, -1, "You aren't high enough level for this.");
ShowPlayerDialog(playerid, DIALOG_CLASSES, DIALOG_STYLE_LIST, "Pick a Class", "Sniper \nArmy(10 score+) \nNavy(20 Score+) \nMarines(50 score+)", "Select","");
}
}
case 2:
{
if(score >= 20)
{
class[playerid] = 3;
SendClientMessage(playerid, -1, "You have joined the Navy Class!");
}
else
{
SendClientMessage(playerid, -1, "You aren't high enough level for this.");
ShowPlayerDialog(playerid, DIALOG_CLASSES, DIALOG_STYLE_LIST, "Pick a Class", "Sniper \nArmy(10 score+) \nNavy(20 Score+) \nMarines(50 score+)", "Select","");
}
}
case 3:
{
if(score >= 50)
{
class[playerid] = 4;
SendClientMessage(playerid, -1, "You have joined the Marines Class!");
}
else
{
SendClientMessage(playerid, -1, "You aren't high enough level for this.");
ShowPlayerDialog(playerid, DIALOG_CLASSES, DIALOG_STYLE_LIST, "Pick a Class", "Sniper \nArmy(10 score+) \nNavy(20 Score+) \nMarines(50 score+)", "Select","");
}
}
}
}
}
}
return 1;
}