31.01.2013, 21:44
Hi,
My problem is when I choose a team, It just set me to the Team number 1= TEAM_COPS1.
My problem is when I choose a team, It just set me to the Team number 1= TEAM_COPS1.
PHP код:
#define TEAM_COPS1 0
#define TEAM_COPS2 1
#define TEAM_CIVILIAN 2
#define TEAM_ROBBERS 3
#define DIALOG_CLASS 3
static Team[MAX_PLAYERS];
public OnGameModeInit()
{
SetGameModeText("TR-CR v1.0");
AddPlayerClass(280, 1525.697265, -1677.923706, 5.890625, 265.247283, 5,1,22,1000,30,1000);
AddPlayerClass(287,1568.449707, -1690.995849, 5.890625, 180.959609,5,1,22,1000,30,1000);
AddPlayerClass(217,1642.000122, -2334.761474, 13.546875, 354.693267,29,500,33,500,24,320);
AddPlayerClass(115,2520.769775, -1678.817016, 15.176570, 88.838874,29,500,34,280,23,450);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "{555555}Teams", "{0909F7}LSPD Officer\n{AEA551}Army Soldier\n{CCCCCC}Civilian\n{F72009}Robbers", "Choose", "Kick");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
//
//
if(dialogid == DIALOG_CLASS)
{
if(!response) return Kick(playerid);
if(response)
{
if(listitem == 0) // They selected the first item - Police Officer
{
Team[playerid] = TEAM_COPS1;
SetPlayerPos(playerid, 1525.697265, -1677.923706, 5.890625);
SetPlayerSkin(playerid, 280);
SpawnPlayer(playerid);
}
if(listitem == 1)
{
Team[playerid] = TEAM_COPS2;
SetPlayerPos(playerid, 1568.449707, -1690.995849, 5.890625);
SetPlayerSkin(playerid, 287);
SpawnPlayer(playerid);
}
if(listitem == 2)
{
Team[playerid] = TEAM_CIVILIAN;
SetPlayerPos(playerid, 1642.000122, -2334.761474, 13.546875);
SetPlayerSkin(playerid, 217);
SpawnPlayer(playerid);
}
if(listitem == 3)
{
Team[playerid] = TEAM_ROBBERS;
SetPlayerPos(playerid, 2520.769775, -1678.817016, 15.176570);
SetPlayerSkin(playerid, 115);
SpawnPlayer(playerid);
}
}
}
return 1;
}