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;
}
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;
}
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
}
Nvm use this
On the top pawn Код:
|