How do i set the interior for a class spawn?
#1

The player spawns on the coordinates, but ofcourse the interior doesn't show. I tried to set grove street in the Johnson's House and they dont spawn there but in the middle of nowhere in the air and the character falls down.

Код:
new const Float:g_SpawnGrove[][4] = {
	{220.9889,1241.6044,1082.1406,245.6888},
	{220.9889,1241.6044,1082.1406,245.6888},
	{220.9889,1241.6044,1082.1406,245.6888}
};
what should i change in the coordinates to also have the right interior set so the grove street member spawns in the johnsons house?
Reply
#2

Do you want to spawn Grove Street members to spawn inside the CJ's House?

put this in onplayerspawn if its a grove member
Код:
SetPlayerPos(playerid, 2496.049804, -1695.238159, 1014.742187); //coordinates of cjs house interior taken from http://weedarr.wikidot.com/interiornl672...r(playerid, 3); //This is how you put player in right interior
Reply
#3

i cant place SetPlayerInterior(playerid, 3); in


Код:
new const Float:g_SpawnGroves[][4] = {
	{2495.9788,-1709.5435,1014.7422,359.6140},
	{2495.9788,-1709.5435,1014.7422,359.6140},
	{2495.9788,-1709.5435,1014.7422,359.6140}
};
i want to know how to set the interior for those cordinates, if i place SETPLAYERINTERIOR under the coordinate line pawno just crashes i dont want to use

Код:
    SetPlayerPos(playerid, 2495.9788,-1709.5435,1014.7422,359.6140);
    SetPlayerInterior(playerid, 3);
because this crashes my pawno it doesnt work someone tell me how to set the interior correctly only for {2495.9788,-1709.5435,1014.7422,359.6140}, cuz other codes like that setplayerpos dont work for this line
Reply
#4

SetPlayerPos only has 4 arguments. The final cordinate is the angle which is set with a different function.

Код:
SetPlayerPos(playerid, 2495.9788, -1709.5435, 1014.7422); // X, Y, Z
SetPlayerFacingAngle(playerid, 359.6140); // Angle
SetPlayerInterior(playerid, 3);
Reply
#5

PHP код:
new const Float:g_SpawnGroves[][4] = {
    {
2495.9788,-1709.5435,1014.7422,359.6140interiorid},
    {
2495.9788,-1709.5435,1014.7422,359.6140interiorid},
    {
2495.9788,-1709.5435,1014.7422,359.6140interiorid}
}; 
its ezy make it like this
PHP код:
 new rpos random(sizeof(g_SpawnGroves));
       
SetPlayerPos(playeridg_SpawnGroves[rpos][0], g_SpawnGroves[rpos][1], g_SpawnGroves[rpos][2]);
    
SetPlayerInterior(playeridg_SpawnGroves[rpos][3]); 
Try it will work as u want
Reply
#6

Quote:
Originally Posted by CaptainBoi
Посмотреть сообщение
PHP код:
new const Float:g_SpawnGroves[][4] = {
    {
2495.9788,-1709.5435,1014.7422,359.6140interiorid},
    {
2495.9788,-1709.5435,1014.7422,359.6140interiorid},
    {
2495.9788,-1709.5435,1014.7422,359.6140interiorid}
}; 
its ezy make it like this
PHP код:
 new rpos random(sizeof(g_SpawnGroves));
       
SetPlayerPos(playeridg_SpawnGroves[rpos][0], g_SpawnGroves[rpos][1], g_SpawnGroves[rpos][2]);
    
SetPlayerInterior(playeridg_SpawnGroves[rpos][3]); 
Try it will work as u want
Not with the code you have provided! For a start you'll get an error if you insert the interior ID, which is an integer value into the array because the array is for floating point numbers. SetPlayerInterior will also only accept an integer value.

Код:
new Float:g_SpawnGroves[][4] = {
	{2495.9788, -1709.5435, 1014.7422, 359.6140}, // X, Y, Z, Angle
	{2495.9788, -1709.5435, 1014.7422, 359.6140},
	{2495.9788, -1709.5435, 1014.7422, 359.6140}
};
Код:
new rpos = random(sizeof(g_SpawnGroves));
SetPlayerPos(playerid, g_SpawnGroves[rpos][0], g_SpawnGroves[rpos][1], g_SpawnGroves[rpos][2]); // X, Y, Z
SetPlayerFacingAngle(playerid, g_SpawnGroves[rpos][3]); // Angle
SetPlayerInterior(playerid, 3); // set the interior
Reply
#7

hmm thanks for crrecting it
Reply
#8

The guy who posted the thread seems new to scripting, why not try to explain it to him with the code you provided but just post it? I'm not sure if he's new or not but his join date is Nov 2017, because some people (including me) have lost their old forum account and opened a new one, but by his posts and register date he seems new, I would recommend you to explain it to him.
Reply
#9

PHP код:
new Float:g_SpawnGroves[][4] = {//we will make a variable containt of spawn locations as we select X, Y, Z, Angle
    
{2495.9788, -1709.54351014.7422359.6140}, // X, Y, Z, Angle
    
{2495.9788, -1709.54351014.7422359.6140},
    {
2495.9788, -1709.54351014.7422359.6140},
        {
XYZANGLE}
};

new 
rpos random(sizeof(g_SpawnGroves));//we will make a new varaible in which we will make the spawn location random so we can able to get the player position in SetPlayerPos
SetPlayerPos(playeridg_SpawnGroves[rpos][0], g_SpawnGroves[rpos][1], g_SpawnGroves[rpos][2]); //Here we will set the position as X, Y, Z (0, 1, 2) [we are using 0, 1, 2 becuz we have (XYZ ANGLE = 4 positions] [0 = X] [1=Y] [2=Z] [3=Angle] so placed it see the code
SetPlayerFacingAngle(playeridg_SpawnGroves[rpos][3]); // we will put the angle from another function cuz their is not function to set the angle in SetPlayerPos well you can make it ezly if you want to learn that then you can reply here.
SetPlayerInterior(playerid3); //As same as Angle we dont have function of interior in SetPlayerPos so we will use the SetPlayerInterior to set the player spawn interior well here the function i m talking about below. 
PHP код:
stock SetPlayerPosEx(playeridFloat:XFloat:YFloat:ZFloat:Angleinteriorid)
{
 
SetPlayerPos(playeridXYZ);
 
SetPlayerFacingAngle(playeridAngle);
 
SetPlayerInterior(playeridinteriorid);
}

//SetPlayerPosEx(playerid, X, Y, Z, Angle, interiorid);
[its simple then above isn't it :D] 
Reply
#10

Quote:
Originally Posted by JuWo
Посмотреть сообщение
i cant place SetPlayerInterior(playerid, 3); in


Код:
new const Float:g_SpawnGroves[][4] = {
	{2495.9788,-1709.5435,1014.7422,359.6140},
	{2495.9788,-1709.5435,1014.7422,359.6140},
	{2495.9788,-1709.5435,1014.7422,359.6140}
};
i want to know how to set the interior for those cordinates, if i place SETPLAYERINTERIOR under the coordinate line pawno just crashes i dont want to use

Код:
    SetPlayerPos(playerid, 2495.9788,-1709.5435,1014.7422,359.6140);
    SetPlayerInterior(playerid, 3);
because this crashes my pawno it doesnt work someone tell me how to set the interior correctly only for {2495.9788,-1709.5435,1014.7422,359.6140}, cuz other codes like that setplayerpos dont work for this line
Server doesn't crash for no reason, does your code compile without error? Also you're kinda not making any sense, I think it's your English or you're missing something here.

EDIT: I thought your gamemode crashed, if pawno crashed, try to remove the line you added so you'd know which line caused the crash.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)