Player spawning in an interior? How can I change it?
#1

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

Show the code of OnPlayerSpawn...
Reply
#3

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

Why do you need 2 same functions?
Reply
#5

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

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

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)

Reply
#8

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)