SA-MP Forums Archive
Bugged - +REP for helping - 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: Bugged - +REP for helping (/showthread.php?tid=566956)



Bugged - +REP for helping - MrCallum - 09.03.2015



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;
}



Re: Bugged - +REP for helping - Beckett - 09.03.2015

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


Re: Bugged - +REP for helping - biker122 - 09.03.2015

What does it do?


Re: Bugged - +REP for helping - MrCallum - 09.03.2015



'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.


Re: Bugged - +REP for helping - biker122 - 09.03.2015

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.


Re: Bugged - +REP for helping - CalvinC - 09.03.2015

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:



Re: Bugged - +REP for helping - MrCallum - 09.03.2015

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



Re: Bugged - +REP for helping - MrCallum - 09.03.2015

Any suggestions?


Re: Bugged - +REP for helping - biker122 - 09.03.2015

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



Re: Bugged - +REP for helping - ReshiramZekrom - 09.03.2015

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