Player position problem
#1

Hello, my probleme is whene a player need spawn, he spawns in another place , but i've edited the place... but doesn't working Please HELP.
Code of my Players position:
Код:
public OnGameModeExit()
{
	//-----------------------ZOMBIES----------------------------------
    AddPlayerClass(230,101.4661,1909.9695,18.3610,277.1736,0,0,0,0,0,0); //
	AddPlayerClass(33,101.4661,1909.9695,18.3610,277.1736,0,0,0,0,0,0); //
	//--------------------------------------------------------------//
	////Human Skin://///////////---291+43+299-------------------------------
	AddPlayerClass(291,249.8150,1887.1572,20.6406,61.2849,0,0,0,0,0,0); //
	AddPlayerClass(43,249.8150,1887.1572,20.6406,61.2849,0,0,0,0,0,0); //
	AddPlayerClass(299,249.8150,1887.1572,20.6406,61.2849,0,0,0,0,0,0); //
	 //-----------S.T.A.R.S Skin:/--------285+287------------------//
	 AddPlayerClass(285,249.8150,1887.1572,20.6406,61.2849,0,0,0,0,0,0); //
	 AddPlayerClass(287,249.8150,1887.1572,20.6406,61.2849,0,0,0,0,0,0); //
	 //-------------U.C Skin:---294+295------------------------//
	 AddPlayerClass(294,21.9061,-242.7543,2.4126,2.3485,0,0,0,0,0,0);
     AddPlayerClass(295,21.9061,-242.7543,2.4126,2.3485,0,0,0,0,0,0);

	 //----------Tyrant Skin:------217--------------//
	 AddPlayerClass(217,101.4661,1909.9695,18.3610,277.1736,0,0,0,0,0,0); //
	return 1;
}
and the code of my public OnPlayerRequestClass(playerid, classid):
Код:
public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 258.4893,-41.4008,1002.0234);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}
Reply
#2

You need the callback
pawn Код:
OnPlayerRequestSpawn(playerid)
If you use SetPlayerPos in there, the player will spawn at that position
Reply
#3

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
You need the callback
pawn Код:
OnPlayerRequestSpawn(playerid)
If you use SetPlayerPos in there, the player will spawn at that position
ok Wesley but how?
Reply
#4

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

SetupPlayerForClassSelection(playerid)
{
    SetPlayerPos(playerid, 258.4893,-41.4008,1002.0234);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
}
Reply
#5

doesn't working it spawns in other position
Reply
#6

Put that different location in OnPlayerSpawn
Reply
#7

Quote:

OnGameModeExit()

Should be?:
Quote:

OnGameModeInit()

top of the script:
pawn Код:
new Float:RandomSpawns[] []=
{
{x, y, z};
};
onplayerspawn:
pawn Код:
new rand = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[0], RandomSpawns[1], RandomSpawns[2]);
Reply
#8

What i do? setplayerposition(playerid, the position?);
Reply
#9

yea Gazmull! that is the problem i need put:
Код:
//-----------------------ZOMBIES----------------------------------
    AddPlayerClass(230,101.4661,1909.9695,18.3610,277.1736,0,0,0,0,0,0); //
	AddPlayerClass(33,101.4661,1909.9695,18.3610,277.1736,0,0,0,0,0,0); //
	//--------------------------------------------------------------//
	////Human Skin://///////////---291+43+299-------------------------------
	AddPlayerClass(291,249.8150,1887.1572,20.6406,61.2849,0,0,0,0,0,0); //
	AddPlayerClass(43,249.8150,1887.1572,20.6406,61.2849,0,0,0,0,0,0); //
	AddPlayerClass(299,249.8150,1887.1572,20.6406,61.2849,0,0,0,0,0,0); //
	 //-----------S.T.A.R.S Skin:/--------285+287------------------//
	 AddPlayerClass(285,249.8150,1887.1572,20.6406,61.2849,0,0,0,0,0,0); //
	 AddPlayerClass(287,249.8150,1887.1572,20.6406,61.2849,0,0,0,0,0,0); //
	 //-------------U.C Skin:---294+295------------------------//
	 AddPlayerClass(294,21.9061,-242.7543,2.4126,2.3485,0,0,0,0,0,0);
     AddPlayerClass(295,21.9061,-242.7543,2.4126,2.3485,0,0,0,0,0,0);

	 //----------Tyrant Skin:------217--------------//
	 AddPlayerClass(217,101.4661,1909.9695,18.3610,277.1736,0,0,0,0,0,0); //
in:OnGameModeInit()
not: OnGameModeExit()

thank u all for helping me again !
Reply
#10

Np ,
And at SetPlayerPos();, Put the Float random spawns there example:
pawn Код:
SetPlayerPos(playerid, RandomSpawns[0], RandomSpawns[1], RandomSpawns[2]); //S.T.A.R.S. Spawn points
EDIT:
Put the spawn points of each classes example:
S.T.A.R.S. spawn points
pawn Код:
new Float:STARspawns[] [] =
{
{1234.000, 1223.456, 1212.232},
{2222.222, 3333.333, 444.4444};
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)