Requesting help with OnPlayerRequestClass
#1

Hi,
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(2801525.697265, -1677.9237065.890625265.2472835,1,22,1000,30,1000);
    
AddPlayerClass(287,1568.449707, -1690.9958495.890625180.959609,5,1,22,1000,30,1000);
     
AddPlayerClass(217,1642.000122, -2334.76147413.546875354.693267,29,500,33,500,24,320);
     
AddPlayerClass(115,2520.769775, -1678.81701615.17657088.838874,29,500,34,280,23,450);
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
    
ShowPlayerDialog(playeridDIALOG_CLASSDIALOG_STYLE_LIST"{555555}Teams""{0909F7}LSPD Officer\n{AEA551}Army Soldier\n{CCCCCC}Civilian\n{F72009}Robbers""Choose""Kick");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
//
//
    
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(playerid1525.697265, -1677.9237065.890625);
        
SetPlayerSkin(playerid280);
        
SpawnPlayer(playerid);
        }
        if(
listitem == 1)
        {
        
Team[playerid] = TEAM_COPS2;
        
SetPlayerPos(playerid1568.449707, -1690.9958495.890625);
        
SetPlayerSkin(playerid287);
        
SpawnPlayer(playerid);
        }
        if(
listitem == 2)
        {
        
Team[playerid] = TEAM_CIVILIAN;
        
SetPlayerPos(playerid1642.000122, -2334.76147413.546875);
        
SetPlayerSkin(playerid217);
        
SpawnPlayer(playerid);
        }
        if(
listitem == 3)
        {
        
Team[playerid] = TEAM_ROBBERS;
        
SetPlayerPos(playerid2520.769775, -1678.81701615.176570);
        
SetPlayerSkin(playerid115);
        
SpawnPlayer(playerid);
          }
    }
}
  return 
1;

Reply


Messages In This Thread
Requesting help with OnPlayerRequestClass - by Magic_Time - 31.01.2013, 21:44
Re: Requesting help with OnPlayerRequestClass - by Roach_ - 31.01.2013, 21:51
Re: Requesting help with OnPlayerRequestClass - by Magic_Time - 31.01.2013, 22:06
Re: Requesting help with OnPlayerRequestClass - by Roach_ - 31.01.2013, 22:14

Forum Jump:


Users browsing this thread: 1 Guest(s)