SA-MP Forums Archive
Player spawning in an interior? How can I change it? - 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: Player spawning in an interior? How can I change it? (/showthread.php?tid=195420)



Player spawning in an interior? How can I change it? - Spiral - 02.12.2010

Hey folks,
A new problem.
I got this AddPlayerClass code:
pawn Код:
AddPlayerClass(217,364.0561,2763.7053,82.1048,181.0342,0,0,0,0,0,0);
It spawns me into an interior! The SetPlayerSpawn is just returned 1; and i tried adding some other things to it, like SetPlayerPos and Interior, but it wont work.. Any help?


Re: Player spawning in an interior? How can I change it? - [MWR]Blood - 02.12.2010

Show the code of OnPlayerSpawn...


Re: Player spawning in an interior? How can I change it? - SkizzoTrick - 02.12.2010

pawn Код:
public OnPlayerSpawn(...)
{
SetPlayerPos(playerid,x,y,z);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
return 1;
}
or you could use
pawn Код:
public OnPlayerSpawn(...)
{
SetPlayerSpawn(playerid);
..
..
..
}

forward SetPlayerSpawn(playerid)
public SetPlayerSpawn(playerid)
{
SetPlayerPos(playerid,x,y,z);
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
return 1;
}



Re: Player spawning in an interior? How can I change it? - [MWR]Blood - 02.12.2010

Why do you need 2 same functions?


Re: Player spawning in an interior? How can I change it? - iggy1 - 02.12.2010

What values do x, y and z hold in this code?
pawn Код:
SetPlayerPos(playerid,x,y,z);
Show where you initialise them. (put a value in them)


Re: Player spawning in an interior? How can I change it? - Spiral - 02.12.2010

Where do I use it lol? This is the OnPlayerSpawn:

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid,405.9053,2456.6348,16.5000);
    return 1;
}
I have many SetPlayerPos codes. Does it affect in any way, if they are in OnPlayerRequestClass?


Re: Player spawning in an interior? How can I change it? - SkizzoTrick - 02.12.2010

Show the OnPlayerSpawn,i just made that command because i thought you didn't
Quote:

Why do you need 2 same functions?

You don't,i gave him 2 possibilities!

Quote:

What values do x, y and z hold in this code?
pawn Code:
SetPlayerPos(playerid,x,y,z);
Show where you initialise them. (put a value in them)




Re: Player spawning in an interior? How can I change it? - iggy1 - 02.12.2010

EDIT: lol wires crossed.
You need to put a set of co-ordinates into x, y, z otherwise your code is doing this,
pawn Код:
SetPlayerPos(playerid, 0.0, 0.0, 0.0);



Re: Player spawning in an interior? How can I change it? - SkizzoTrick - 02.12.2010

Quote:
Originally Posted by iggy1
Посмотреть сообщение
When you put "SetPlayerPos(playerid , x, y, z);" i thought the x, y and z was variables. And no SetPlayerPos shouldnt affect OnPlayerRequestClass.
Sorry man,my bad
X,Y and Z, is his requested position
I don't know where he want to spawn the palyers so i putted x,y,z


Re: Player spawning in an interior? How can I change it? - SkizzoTrick - 02.12.2010

But,the problem is that you putted the playerclass and it spawns you in a interior?
Maybe there is a setplayerinterior that you mess,post here the onplayerspawn or search in your script for a SetPlayerInterior