SA-MP Forums Archive
Class selection not disappearing - 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: Class selection not disappearing (/showthread.php?tid=584394)



Class selection not disappearing - sjames - 04.08.2015

I set my player TogglePlayerSpecating(playerid, 1); when he connects. This he chooses his class with textdraw, and disable the spectating:

Код:
printf("Setting player class to: %d", gClass[playerid]);
			CancelSelectTextDraw(playerid);
			
			SendClientMessage(playerid, C_GREY, "Class chosen.");
			TogglePlayerControllable(playerid, 1);
			TogglePlayerSpectating(playerid, 0);
			StopAudioStreamForPlayer(playerid);
			HideClassSelection(playerid);
			IsPlayerChoosingClass[playerid] = 0;
Now he goes to OnPlayerRequestClass.

Код:
public OnPlayerRequestClass(playerid, classid)
{
	printf("Player requesting class.. team: %d, class: %d", gTeam[playerid], gClass[playerid]);
	SpawnPlayer(playerid);
  	return 1;
}
The issue is.. there still are the arrows and 'Spawn' button. I dont want the default spawn button and arrows.. I want him straight to spawn but it isn't happening.


Re: Class selection not disappearing - Fancy - 04.08.2015

Код:
printf("Setting player class to: %d", gClass[playerid]);
			CancelSelectTextDraw(playerid);

			SendClientMessage(playerid, C_GREY, "Class chosen.");
			TogglePlayerControllable(playerid, 1);
			TogglePlayerSpectating(playerid, 0);
			StopAudioStreamForPlayer(playerid);
			HideClassSelection(playerid);
			IsPlayerChoosingClass[playerid] = 0;
			printf("Player requesting class.. team: %d, class: %d", gTeam[playerid], gClass[playerid]);
	        SpawnPlayer(playerid);
and

Код:
public OnPlayerRequestClass(playerid, classid)
{
  	return 1;
}



Re: Class selection not disappearing - sjames - 04.08.2015

pawn Код:
CancelSelectTextDraw(playerid);
            printf("Setting player class to: %d", gClass[playerid]);
            SendClientMessage(playerid, C_GREY, "You have chosen your class and are now spawned.");

            TogglePlayerControllable(playerid, 1);
            TogglePlayerSpectating(playerid, 0);
            StopAudioStreamForPlayer(playerid);
            HideClassSelection(playerid);
            IsPlayerChoosingClass[playerid] = 0;
            SpawnPlayer(playerid);
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    return 1;
}
Still need to press the spawn button to get spawned.


Re: Class selection not disappearing - sjames - 04.08.2015

EDIT: Problem was that the player wasn't spawning because the spawn info wasn't set (custom team selection, didn't use AddPlayerClass).