Locking Playerclasses or teams so I can select who uses them?
#2

PHP код:
#define GROVE_STREET 1
#define POLICE 2
#define ARMY 3
#define Fbi 4
public OnPlayerRequestClass(playerid, classid)
{
    
SetupPlayerForClassSelection(playerid);
    
SetPlayerTeamFromClass(playerid, classid);
    
    switch (
classid)
    {
        case 
0:
        {
            if(
gTeam[playerid] == GROVE_STREET)
            {
            
GameTextForPlayer(playerid, "~b~NORMAL~n~~w~NOOB", 3000, 5);
            }
        else return 
SendClientMessage(playerid,COLOR_RED,"You must be Grove Street to use this skin!");
        }
    
//Else
    
return 1;
} 
I dont get your logic, if player connects, he wont be able to use any skin cause he is not any team!
Maybe if you make dialog to pick team on login, i dont know but here's an example!

PHP код:
public OnPlayerConnect(playerid)
{
    
ShowPlayerDialog(playerid, 4321, DIALOG_STYLE_LIST,"Pick one team before spawn!","Grove Street\nPolice\nArmy\nFBI","Pick","Exit");
        return 
1;
}
public 
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(
dialogid == 353)
        {
                if(
response == 0)
                {
                   
SendClientMessage(playerid, 0xFF0000FF, "You Must Pick One Option!");
                   
Kick(playerid);
                   }
                if(
response == 1)
                {
                   if(
listitem == 0)
                        {
                           
gTeam[playerid] = GROVE_STREET;
                           
SendClientMessage(playerid, COLOR_GREEN,"You have picked team Grove Street!");
                           }
                           }
                   if(
listitem == 1)
                           {
                           
gTeam[playerid] = POLICE;
                           
SendClientMessage(playerid, COLOR_GREEN,"You have picked team Police!");
                           }
                         }
                   if(
listitem == 2)
                         {
                           
gTeam[playerid] = ARMY;
                           
SendClientMessage(playerid, COLOR_GREEN,"You have picked team Army!");
                           }
                         }
                   if(
listitem == 3)
                               {
                           
gTeam[playerid] = Fbi;
                           
SendClientMessage(playerid, COLOR_GREEN,"You have picked team FBI!");
                               }
                                }
                            }
}
return 
1;
} 
Reply


Messages In This Thread
Locking Playerclasses or teams so I can select who uses them? - by alexharvey52 - 13.04.2012, 23:08
Re: Locking Playerclasses or teams so I can select who uses them? - by Kakioshe22 - 13.04.2012, 23:47
Re: Locking Playerclasses or teams so I can select who uses them? - by alexharvey52 - 14.04.2012, 09:46

Forum Jump:


Users browsing this thread: 1 Guest(s)