SA-MP Forums Archive
Stay within the world boundaries bug - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Stay within the world boundaries bug (/showthread.php?tid=208139)



Stay within the world boundaries bug - Ice-cup - 07.01.2011

I get a textbox saying "Stay within the world boundaries", whenever I press on "spawn".
My player is gplayerlogged and I get this weird textbox.

This is the code before people can press spawn:

Quote:

RegistrationStep[playerid] = 0;
TogglePlayerControllable(playerid,1);
PlayerInfo[playerid][pRegistered] = 1;
gPlayerLogged[playerid] = 1;
return 1;
}

Quote:

public OnPlayerRequestSpawn(playerid)
{
if(gPlayerLogged[playerid] == 1)
{
return 1;
}
else
{
if(SpawnAttempts[playerid] >= MAX_SPAWN_ATTEMPTS)
{
KickPlayer(playerid,"System","Repeated attempts to spawn without logging in.");
return 1;
}
SendClientMessage(playerid,COLOR_RED,"[INFO:] You must login before you can spawn!");
SpawnAttempts[playerid] ++;
return 0;
}
}

That is onplayerrequestspawn ofc.


Any idea?


Re: Stay within the world boundaries bug - Ash. - 07.01.2011

Just a thought, where is your player (where are they set) in OnPlayerConnect ?


Re: Stay within the world boundaries bug - Ice-cup - 07.01.2011

There is no SetPlayerPos or what soever to set the player's position in OnPlayerConnect.
Guess he's connecting?


Re: Stay within the world boundaries bug - Ash. - 07.01.2011

Well, when a player connects, by default the player gets put in a certain position, along with the camera to give the "Class Selection" view. For example, check the Grand Larceny Gamemode for an example


Re: Stay within the world boundaries bug - Ice-cup - 07.01.2011

Guess you're talking about:

Quote:

gPlayerCitySelection[playerid] = -1;
gPlayerHasCitySelected[playerid] = 0;
gPlayerLastCitySelectionTick[playerid] = GetTickCount();

Right?

For some reason I do understand that part, but can't find the connection to my problem. Sorry :P


Re: Stay within the world boundaries bug - Ash. - 07.01.2011

Well, depending on the way you have your world boundaries set up, depending on where the player is placed for class selection, it could be that which is causing the problem.


Re: Stay within the world boundaries bug - Ice-cup - 07.01.2011

Alright I've put this inside the onplayerrequestspawn:

Quote:

if(gPlayerLogged[playerid] == 1)
{
SetPlayerPos(playerid,1050.3650,-1606.5372,20.5192);
return 1;
}

So the player is set to the position where the camera is set at.
The camera at the end of the registration thing (see first script snippet) is also set to this point.

Still doesn't work.


Re: Stay within the world boundaries bug - Ice-cup - 08.01.2011

Even tried it when setting the camera pos near that playerpos in onplayerrequest.
Everything I tried didn't work out.
Please help me


Re: Stay within the world boundaries bug - Lorenc_ - 08.01.2011

Check if you have on ongamemodinit

SetGameModeText("fgdfgdf");


Re: Stay within the world boundaries bug - Ice-cup - 08.01.2011

Yup I do got SetGameModeText(sendcmd); in Ongamemodeinit.
To be precise; in the following context:
Код:
if (!strcmp("Yes", GAMEMODE_USE_VERSION, true)) { format(sendcmd, sizeof(sendcmd), "%s - %s", GAMEMODE,VERSION); SetGameModeText(sendcmd); }
else { SetGameModeText(GAMEMODE); }



Re: Stay within the world boundaries bug - Kwarde - 08.01.2011

Guys I ever had the same problem. Someone helped me out
Add an "AddPlayerClass"


Re: Stay within the world boundaries bug - Ice-cup - 08.01.2011

Ye guess it works now, thanks!

By the way I got this problem too:

I got my dcmd included:

#include <dcmd>

But it doesn't work, it gives me this error:

Код:
fatal error 100: cannot read from file: "dcmd"
When I compile my dcmd.inc it doesnt gives me any errors after I put in an empty callback (coz it gave me the error that it needed callbacks before).

Any idea?


Re: Stay within the world boundaries bug - Kwarde - 08.01.2011

Add this file into your 'pawno/plugins' folder. It contains SSCANF and the DCMD include:
http://rpdsamp.nl/get/gta/sa/mp/serv...e/dcmd.inc.zip