Need a bit help about Teams -
MBilal - 10.12.2017
I know to set team and spawn players with skin or team.
But I need small help how i can show the team first after player select team the skins of that team will show only.
Like TEAM_POLICE is chosen by the player now it show him skins of POLICE?
Kindly help me out.
Код:
new TeamCount[MAX_PLAYERS];
public OnPlayerRequestClass(playerid,classid)
{
TogglePlayerControl(playerid, 1);
SetPlayerVirtualWorld(playerid, 25);
switch(TeamCount[playerid])
{
case 0:
{
gTeam[playerid] = TEAM_POLICE;
//Camera code under it or team name textdraw
}
case 1:
{
gTeam[playerid] = TEAM_GROVE;
//Camera code under it
}
case 2:
{
gTeam[playerid] = TEAM_BALLA;
}
case 3:
{
gTeam[playerid] = TEAM_VAGO;
}
case 4:
{
gTeam[playerid] = TEAM_TRAIDS;
}
case 5:
{
gTeam[playerid] = TEAM_AZTECS;
}
case 6:
{
gTeam[playerid] = TEAM_CHICKEN;
}
case 7:
{
gTeam[playerid] = TEAM_BIKERS;
}
case 8:
{
gTeam[playerid] = TEAM_DONATORS;
}
}
if(TeamCount[playerid] == 8 )return TeamCount[playerid] = 0;
TeamCount[playerid]++;
return 1;
}
Like he has chosen one of the team from it
How i can show the skins of Police team?
OnPlayerRequestSpawn(playerid)
How i can use OnPlayerRequestSpawn for showing classid of team police or other teams which is chosen.
Thanks.
Re: Need a bit help about Teams -
RowdyrideR - 10.12.2017
If that's what you mean
Код:
switch(classid)
{
case 0:
{
GameTextForPlayer(playerid, "~b~Police", 999999, 6);
gTeam[playerid] = TEAM_POLICE;
}
case 1:
{
GameTextForPlayer(playerid, "~p~BALLA", 999999, 6);
gTeam[playerid] = TEAM_BALLA;
}
}
Or if you have more than one skin for a team
like 3 skins for BALLAS, You can use
Re: Need a bit help about Teams -
MBilal - 11.12.2017
Nope you don't understand but thanks for reply.
As i already write above i know how to show skin directly but i want to show team first when select team like grove press spawn button it take it to the class section and show only grove skins.
Re: Need a bit help about Teams -
RogueDrifter - 11.12.2017
Quote:
Originally Posted by MBilal
Nope you don't understand but thanks for reply.
As i already write above i know how to show skin directly but i want to show team first when select team like grove press spawn button it take it to the class section and show only grove skins.
|
What i understood was you wanted players to choose a team THEN they can only play by the skins that team provides, here's what i can come up with, show player dialog onplayerrequestclass to choose a team, once they've done choosing they'll now switch between skins, put it all there and put under OnPlayerRequestSpawn the following: if the player's team is police and he chooses CIVILLIAN skin return SendClientMessage NOT YOUR TEAM SKIN and return 0; if you return 0 onplayerrequestpsawn he will not spawn by clicking on the spawn button, for EX:
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
ShowPlayerDialog(playerid,DIALOG_STYLE_LIST,DIALOG_TEAMS,"DIALOG FOR TEAMS",DIALOGSTRING,"Accept","");
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(GetPlayerTeam(playerid) == POLICE_TEAM && GetPlayerSkin(playerid) != copskins(playerid))
{
SendClientMessage(playerid,-1,"NOT YOUR TEAM'S SKIN")
return 0;
}
return 1;
}
IMPORTANT NOTES: Make sure that you put under OnPlayerRequestSpawn if the team is not chosen return 0;
AND at the dialog response make sure to return showplayerdialog if the team hasn't been chosen as well to force them to choose a team, hope this helped!
NOTE THIS: This code will
NOT hide the skins for other teams
BUT will disable the ability for players to choose other team skins, there's no point in hiding them if they can't choose them in the first place, unless if you just don't want them to scroll for unusable skins and that can't be done through onplayerrequestclass and onplayerrequstspawn you'll have to custom that on your own. Good luck.
EDIT: ANOTHER NOTE: If you show a LOGIN dialogue onplayerrequestclass, LET the player's login first THEN if they've not chosen a team before or they're registering LINK the choose team dialogue at the response of the login/register dialogue if success login player && showplayerdialogue DIALOG_TEAMS ...ETC, Good luck.
Re: Need a bit help about Teams -
Xeon™ - 11.12.2017
Quote:
Originally Posted by MBilal
Nope you don't understand but thanks for reply.
As i already write above i know how to show skin directly but i want to show team first when select team like grove press spawn button it take it to the class section and show only grove skins.
|
that's can't be done with nativly request class, but you can build your own Request class using actors and setactorskin
and some textdraws.