Class selection not disappearing
#1

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.
Reply
#2

Код:
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;
}
Reply
#3

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.
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)