Stay within the world boundaries bug
#1

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?
Reply
#2

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

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

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
Reply
#5

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
Reply
#6

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.
Reply
#7

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.
Reply
#8

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

Check if you have on ongamemodinit

SetGameModeText("fgdfgdf");
Reply
#10

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); }
Reply
#11

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

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?
Reply
#13

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)