OnPlayerSpawn (if, else if)
#3

Quote:
Originally Posted by K0P
Посмотреть сообщение
Try this:
Код:
if(pInfo[playerid][PosX] == 0.0 && pInfo[playerid][PosY] == 0.0) // new player
{
	new position = random(sizeof(CivilianSpawn));
	SetPlayerPos(playerid, CivilianSpawn[position][0], CivilianSpawn[position][1], CivilianSpawn[position][2]+0.3);
	SetPlayerFacingAngle(playerid, CivilianSpawn[position][3]);
	SetPlayerInterior(playerid, 0);
	SetPlayerVirtualWorld(playerid, 0);
	SetCameraBehindPlayer(playerid);
}
else if(pInfo[playerid][PosX] != 0.0 && pInfo[playerid][PosY] != 0.0) // existing player
{
	SetPlayerPos(playerid, pInfo[playerid][PosX], pInfo[playerid][PosY], pInfo[playerid][PosZ]+1.5);
	SetPlayerFacingAngle(playerid, pInfo[playerid][PosAngle]);
	SetPlayerInterior(playerid, pInfo[playerid][Interior]);
	SetPlayerVirtualWorld(playerid, pInfo[playerid][VirtualWorld]);

	SendClientMessage(playerid, COLOR_GOV, "SERVER: {FFFFFF}Welcome to your last position.");

	if(pInfo[playerid][SkinID] == 0) return ShowModelSelectionMenu(playerid, skinlist, "Select Skin");
}
if(IsBit(pFlag[playerid], pBIT_INJURED))
{
	....
}
else if(IsBit(pFlag[playerid], pBIT_HOSPITALIZED))
{
	....
}
else(IsBit(pFlag[playerid], pBIT_CAGED))
{
	....
}
if(pInfo[playerid][Prison] >= 2)
{
	....
}
EDIT: Updated above code a bit

If the above code doesn't work then change all "else if" statements into "if" statements
Tested, still the same.
And I did with else if too, same problems.. Been fixing this for hours..
Reply


Messages In This Thread
OnPlayerSpawn (if, else if) - by Uberanwar - 15.09.2016, 16:31
Re: OnPlayerSpawn (if, else if) - by K0P - 15.09.2016, 17:03
Re: OnPlayerSpawn (if, else if) - by Uberanwar - 15.09.2016, 17:17
Re: OnPlayerSpawn (if, else if) - by Marricio - 15.09.2016, 17:24
Re: OnPlayerSpawn (if, else if) - by Uberanwar - 15.09.2016, 18:00
Re: OnPlayerSpawn (if, else if) - by Marricio - 15.09.2016, 18:38
Re: OnPlayerSpawn (if, else if) - by Rdx - 16.09.2016, 08:59
Re: OnPlayerSpawn (if, else if) - by JaKe Elite - 16.09.2016, 10:34

Forum Jump:


Users browsing this thread: 2 Guest(s)