SA-MP Forums Archive
Player unable to spawn after switching class - 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: Player unable to spawn after switching class (/showthread.php?tid=415162)



Player unable to spawn after switching class - Dex007HLH - 12.02.2013

Let me explain what's the problem:
Let's say that Player_X connects to the server, chooses his skin and spawns but then he gets bored of his current skin and he decides to press f4 and use /kill so he can choose a new skin, when he tries to spawn the server doesn't let him, it doesn't matter how many times presses the "spawn" button the server doesn't let he spawn.

What could be the problem?

Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid,classid);
	SetPlayerPos(playerid, 728.0,-1276.2778,13.6484);
	SetPlayerCameraPos(playerid, 733.0,-1276.30,15.077648925781);
	SetPlayerCameraLookAt(playerid, 726.2526,-1276.2778,13.6484);
	SetPlayerFacingAngle( playerid, 270 );

    if(classid == 0 || classid == 1) {
	TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
	TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
	//TextDrawShowForPlayer(playerid, Text-draw2);
	TextDrawHideForPlayer(playerid,Textdraw3[playerid]);
	TextDrawHideForPlayer(playerid,Textdraw4[playerid]);
	//TextDrawHideForPlayer(playerid,Text-draw5);

    } else if(classid == 2 || classid == 3) {
	TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
	TextDrawShowForPlayer(playerid, Textdraw4[playerid]);
	//TextDrawShowForPlayer(playerid, Text-draw5);
	TextDrawHideForPlayer(playerid,Textdraw0[playerid]);
	TextDrawHideForPlayer(playerid,Textdraw1[playerid]);
	//TextDrawHideForPlayer(playerid,Text-draw2);

	}

	if(classid == 0 ) {
        ApplyAnimation(playerid,"SHOP","SHP_Gun_Aim",4.0,1,0,0,0,-1);
        SetPlayerAttachedObject(playerid,0,355,1,0.270000,0.266000,0.037999,75.500198,79.900032,82.399917,1.084998,1.000000,0.990999);

 }

	if(classid == 1 ) {
        SetPlayerAttachedObject(playerid,0,348,6,-0.062999,0.023000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
		ApplyAnimation(playerid,"SHOP","ROB_Loop_Threat",4.0,1,0,0,0,-1);

	}

	if(classid == 2 ) {
        SetPlayerAttachedObject(playerid,0,348,6,-0.062999,0.023000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
		ApplyAnimation(playerid,"SHOP","ROB_Loop",4.0,1,0,0,0,-1);

	}

	if(classid == 3 ) {
        SetPlayerAttachedObject(playerid,0,356,6,-0.062999,0.023000,0.000000,0.000000,0.000000,0.000000,1.000000,1.000000,1.000000);
		ApplyAnimation(playerid,"SHOP","SHP_Gun_Aim",4.0,1,0,0,0,-1);

	}
	return 1;
}



Re: Player unable to spawn after switching class - Dragonborn - 12.02.2013

Show the callback OnPlayerRequestSpawn.


Respuesta: Player unable to spawn after switching class - Dex007HLH - 12.02.2013

I fixed it, thank you a lot