Bugged - +REP for helping
#1



This is the code, why does it do this?

Код:
SetPlayerSpawn(playerid)
{
	if(PlayerInfo[playerid][pReg] == 0)
	{
		gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
		TogglePlayerControllable(playerid,0);
		SetPlayerColor(playerid,COLOR_WHITE);
		SetPlayerPos(playerid, 766.50, -1684.32, -6.86);
		//SetPlayerCameraPos(playerid, 751.93, -1673.95, 16.01);
		//SetPlayerCameraLookAt(playerid, 699.55, -1628.93, 5.88);
		SetPlayerCameraPos(playerid, 1881.0586,-1832.7437,101.6864);
        SetPlayerCameraLookAt(playerid,1981.1537,-1962.5801,16.2211);
   		RegistrationStep[playerid] = 1;
		SendClientMessageEx(playerid, COLOR_GREEN, "Please fill in some information to proceed.");
		SendClientMessageEx(playerid, COLOR_LIGHTGREEN, "Are you a Male or Female? (Type in what you are).");
		SetPlayerVirtualWorld(playerid, 1984);
   		SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel], PlayerInfo[playerid][pSPos][0], PlayerInfo[playerid][pSPos][1], PlayerInfo[playerid][pSPos][2], PlayerInfo[playerid][pSPos][0], 0, 0, 0, 0, 0, 0);
   		SpawnPlayer(playerid);
		return 1;
	}
	return 1;
}
Reply
#2

Your picture is not showing, explain what's happening.
Reply
#3

What does it do?
Reply
#4



'Are you a Male or Female?' (Type in what you are)'

It keeps spamming that.

HINT: Right click the image > Open image in new tab.
Reply
#5

Can you show where you're using this stock/function (SetPlayerSpawn)?

* We cannot even see the image position, it's just like a message for me.
Reply
#6

For people who can't see it.
Also, to show an image correctly, you have to use the direct link, which in imgur you get by clicking on the image:
Reply
#7

Код:
enum pInfo
{
	pKey[129],
	pLevel,
	pAdmin,
	pConnectTime,
	pReg,
	pSex,
	pAge,
	pCash,
	pTut,
	pJob,
	pModel,
	Float: pSPos[4]
};
new PlayerInfo[MAX_PLAYERS+1][pInfo];
Код:
SetPlayerSpawn(playerid)
{
	if(PlayerInfo[playerid][pReg] == 0)
	{
		gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
		TogglePlayerControllable(playerid,0);
		SetPlayerColor(playerid,COLOR_WHITE);
		SetPlayerPos(playerid, 766.50, -1684.32, -6.86);
		//SetPlayerCameraPos(playerid, 751.93, -1673.95, 16.01);
		//SetPlayerCameraLookAt(playerid, 699.55, -1628.93, 5.88);
		SetPlayerCameraPos(playerid, 1881.0586,-1832.7437,101.6864);
        SetPlayerCameraLookAt(playerid,1981.1537,-1962.5801,16.2211);
   		RegistrationStep[playerid] = 1;
		SendClientMessageEx(playerid, COLOR_GREEN, "Please fill in some information to proceed.");
		SendClientMessageEx(playerid, COLOR_LIGHTGREEN, "Are you a Male or Female? (Type in what you are).");
		SetPlayerVirtualWorld(playerid, 1984);
   		SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel], PlayerInfo[playerid][pSPos][0], PlayerInfo[playerid][pSPos][1], PlayerInfo[playerid][pSPos][2], PlayerInfo[playerid][pSPos][0], 0, 0, 0, 0, 0, 0);pSPos
   		SpawnPlayer(playerid);
		return 1;
	}
	return 1;
}
Код:
public OnPlayerSpawn(playerid)
{
	SetPlayerSpawn(playerid);
	return true;
}
Reply
#8

Any suggestions?
Reply
#9

You probably should've used:
pawn Код:
if(RegistrationStep[playerid] == 0)
instead of:
pawn Код:
if(PlayerInfo[playerid][pReg] == 0)
Reply
#10

It happens because this variable (PlayerInfo[playerid][pReg]) is always 0 and because at the of the "SetPlayerSpawn(playerid)" there is "SpawnPlayer(playerid);". So you go again in "public OnPlayerSpawn(playerid)" and so another time in "SetPlayerSpawn(playerid)". That's why the server always send you the same messages
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)