SA-MP Forums Archive
Help with team selection - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with team selection (/showthread.php?tid=566610)



Help with team selection - Nabster - 07.03.2015

When i press F4 and kill myself to go to team selection then it doesn't show me the teamselection menu which is in textdraws and it shows me CJ skin and sets my team to Team ID 0

I am not using onplayerequestclass etc callbacks

I want to make it such that when i press F4 it will show me my own team selection menu,any ideas on how to do this?


Re: Help with team selection - De4dpOol - 07.03.2015

pawn Код:
public OnPlayerRequestClass(....)
{
    SpawnPlayer(playerid);//To spawn the player
    ShowCustomClassSelection(playerid);//Create a stock function to set up the custom class selection.
    return 1;
}
Create a stock function to send the player to class selection at OnPlayerRequestClass.
Edit: I added Spawn Player as it will need to spawn him first.


Re: Help with team selection - Nabster - 07.03.2015

So without using OnPlayerRequestClass i can't make that happen?

This is my team selection,just a little script

Код:
if(clickedid == USAText)
	{
        TextDrawHideForPlayer(playerid,Team);
		TextDrawHideForPlayer(playerid,TeamBox);
		TextDrawHideForPlayer(playerid,USAText);
		TextDrawHideForPlayer(playerid,TalibanText);
		TextDrawShowForPlayer(playerid,Box);
		TextDrawShowForPlayer(playerid,Class);
		TextDrawShowForPlayer(playerid,Soldier);
		TextDrawShowForPlayer(playerid,JetTrooper);
		TextDrawShowForPlayer(playerid,Spy);
		TextDrawShowForPlayer(playerid,Sniper);
		SetPlayerTeam(playerid, 0);
		SelectTextDraw(playerid,COLOR_RED);
	}



Re: Help with team selection - De4dpOol - 07.03.2015

Quote:
Originally Posted by Nabster
Посмотреть сообщение
So without using OnPlayerRequestClass i can't make that happen?

This is my team selection,just a little script

Код:
if(clickedid == USAText)
	{
        TextDrawHideForPlayer(playerid,Team);
		TextDrawHideForPlayer(playerid,TeamBox);
		TextDrawHideForPlayer(playerid,USAText);
		TextDrawHideForPlayer(playerid,TalibanText);
		TextDrawShowForPlayer(playerid,Box);
		TextDrawShowForPlayer(playerid,Class);
		TextDrawShowForPlayer(playerid,Soldier);
		TextDrawShowForPlayer(playerid,JetTrooper);
		TextDrawShowForPlayer(playerid,Spy);
		TextDrawShowForPlayer(playerid,Sniper);
		SetPlayerTeam(playerid, 0);
		SelectTextDraw(playerid,COLOR_RED);
	}
This is OnPlayerClickTextDraw callback. If you want the player to see the custom class selection you first have to spawn him when he requests class (OnPlayerRequestClass) selection and than you have to send him to the custom class selection.


Re: Help with team selection - Nabster - 07.03.2015

well i can't get this to work and i think you don't understand what my problem is

I want to show the Team Selection menu when players presses F4 then kill or /switchteam then kill

Код:
public OnPlayerRequestClass(playerid,classid)
{
	if(PInfo[playerid][Logged] == 1)
	{
	    ShowCustomTeamSelection(playerid);
		TogglePlayerSpectating(playerid,1);
	}
	return 1;
}
Its not working,when i press F4 and kill myself it shows me CJ skin