Scripting help. - Nicholas. - 08.01.2012
Hello there.
Well, I am totally new to scripting. I am 'trying' to develop my own basic role-play script. I have just started a few minutes ago but I am coming across some problems which I'll need help with.
Okay, I've complete a few basic stuff. Now, I am trying to work on the 'OnPlayerRequestClass'
Well, This is what I have -
Quote:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid,11);
SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
SetPlayerFacingAngle(playerid,0.0);
SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
return 1;
}
|
I've compile it with no errors. Now when I go In-game, after selecting my skin of choice and click 'spawn' the map is all blank, I could only see my character and nothing else, it's all blue.
What did I do wrong?
Re: Scripting help. -
Babul - 08.01.2012
the outside world is in interior 0. you simply need to set a players interior depending where you placed the skin after spawning.
Re: Scripting help. -
coole210 - 08.01.2012
Add this on OnPlayerSpawn:
pawn Код:
SetPlayerInterior(playerid,0);
0 is the default interior to see buildings and such, on OnPlayerRequestClass you are setting their interior to 11, which makes the buildings in Interior 0 invisible.
Re: Scripting help. - Nicholas. - 08.01.2012
Thank you, coole2010.
It is fixed now.
Rep +
Re: Scripting help. - Nicholas. - 08.01.2012
Okay, another problem.
I am trying to change the 'SetPlayerInterior' ID to anther, Like I've '11' currently.
but I'll like another interior, like this
http://weedarr.wikidot.com/local--re.../thumbnail.jpg
How do I do this?
Re: Scripting help. -
Scarred - 08.01.2012
Just change the number, but you need to set their position to the interior position aswell.
For that, you will need the following code;
pawn Код:
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, 1.808619, 32.384357, 1199.593750);
As a general rule of thumb, I make sure I set their interior before I set their position. I'm not positive if it matters or not, but it just makes sense.
Re: Scripting help. - Nicholas. - 08.01.2012
Okay thank you.
Rep +
Re: Scripting help. - Nicholas. - 08.01.2012
Hello again, I am needing more help.
Okay, So I am trying to change my 'SetPlayerInterior' to this Francis Intn'l Airport - Ticket sales
Interior - Francis Intn'l Airport - Ticket sales
ID - 14
X - -1827.147338
Y - 7.207418
Z - 1061.143554
https://sampwiki.blast.hk/wiki/InteriorIDs
This is what I currently have.
Quote:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid,11);
SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
SetPlayerFacingAngle(playerid,0.0);
SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
return 1;
}
|
Can someone give me a full example of what I need to do please.
Re: Scripting help. -
Scarred - 08.01.2012
Hi again, lol.
Well, since you've got the interior ID already; Just substitute the ID from the other one, and do the same with the coordinates.
Example (as you need):
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid, -1827.147338, 7.207418, 1061.143554);
SetPlayerFacingAngle(playerid,0.0);
//SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
//SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
//You're going to have to find the camera positions yourself.
return 1;
}
However, if I remember correctly, that interior is bugged and is not solid.
Re: Scripting help. - Nicholas. - 08.01.2012
Okay thank you.
As you said it seems to be bugged.