Spawn in an Interior [+1 Rep]
#1

Hello,

I have a bit of a problem here. I don't know how to make a certain class spawn in a house, heres the info you might need:
Here, it's about my 1st Grove Class, all info about that:
Quote:

public OnPlayerRequestClass(playerid, classid)
{
PlayerPlaySound(playerid, 1187, 0,0,0);
switch(classid)
{
case 0:
{
SetPlayerPos(playerid, 2499.5300,-1666.4550,13.3500);
SetPlayerCameraPos(playerid, 2481.8308,-1665.9565,13.3393);
SetPlayerFacingAngle(playerid, 90.2208);
SetPlayerCameraLookAt(playerid, 2499.5300,-1666.4550,13.3500);
ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
GameTextForPlayer(playerid, "~g~Grove Street", 3000, 6);
SetPlayerColor(playerid, GROVE_COLOR);
}

And
Quote:

AddPlayerClass(105, 2496.0227,-1697.5411,1014.7344,179.2174,9,1,27,100,29,200);// Grove Spawn 1

NOTE: When i put SetPlayerInterior under OnPlayerRequestClass i get that interior in the Class Selection

The one to fix my problem will get rep ;)
Reply
#2

I think that's what you want.
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
PlayerPlaySound(playerid, 1187, 0,0,0);
switch(classid)
{
case 0:
{
SetPlayerPos(playerid, 2499.5300,-1666.4550,13.3500);
SetPlayerCameraPos(playerid, 2481.8308,-1665.9565,13.3393);
SetPlayerFacingAngle(playerid, 90.2208);
SetPlayerCameraLookAt(playerid, 2499.5300,-1666.4550,13.3500);
ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
SetPlayerInterior(playerid,IDINTERIOR);
GameTextForPlayer(playerid, "~g~Grove Street", 3000, 6);
SetPlayerColor(playerid, GROVE_COLOR);
}
Reply
#3

That did help, but now a 2nd problem occurs, i've made a video which is uploading right now, i can try to describe what went wrong:
1. The Grove Skin Spawns at the good location BUT.
2. The Background (= What you see in class selection) dissapears.
3. All other classes are set too Interior 3 Automatically.
VIDEO:
http://www.youtube.com/watch?v=Orqv0...ature=*********
Reply
#4

On each case, make sure you select the correct interior
Reply
#5

Ok, problem solved thanks guys, both earned rep
Reply
#6

So, that worked, kinda, except for when i respawn:
(Problem is in the video)
http://www.youtube.com/watch?v=KeuKq...p-L7IeIY44A%3D
When i respawn i am placed under the interior

Help please
Reply
#7

Set the "Z" coordinate a little bit higher when you respawn or under OnPlayerSpawn.
Reply
#8

That will be a problem, i don't use OnPlayerSpawn, because i have:
Код:
	// Grove Spawns
	AddPlayerClass(105, 2491.4343,-1700.7295,1014.7498,274.8083,9,1,27,100,29,200);// Grove Spawn 1
    AddPlayerClass(106, 2496.3101,-1709.9065,1014.7422,359.7225,24,90,32,200,30,150); // Grove Spawn 2
    AddPlayerClass(107, 2492.2053,-1702.9137,1018.3438,182.0842,25,100,24,90,4,1); // Grove Spawn 3
    // Ballas Spawns
    AddPlayerClass(102, 414.3369,2537.2246,10.0077,268.8858,27,100,30,150,5,1); // Ballas Spawn 1
    AddPlayerClass(103, 418.3417,2541.7258,10.0000,181.7783,26,60,29,200,33,75); // Ballas Spawn 2
    AddPlayerClass(104, 419.9609,2539.2542,10.0000,181.7783,22,200,6,1,27,100); // Ballas Spawn 3
    // Vagos Spawns
    AddPlayerClass(108,265.5312,1292.7097,1080.2578,100.6043,24,90,30,150,34,100); // Vagos Spawn 1
    AddPlayerClass(109,264.7221,1287.0116,1080.2578,78.3574,23,100,27,100,31,150); // Vagos Spawn 2
    AddPlayerClass(110,255.1049,1292.5039,1080.2578,225.9154,18,10,24,90,29,200); // Vagos Spawn 3
    // Triads Spawns
    AddPlayerClass(117,2327.0254,-1019.0483,1050.2109,123.3069,31,150,29,200,8,1); // Triads Spawn 1
    AddPlayerClass(118,2314.7341,-1013.8354,1050.2109,280.5783,24,90,27,100,4,1); // Triads Spawn 2
That's my 1st part of OnGameModeInit...


And under OnPlayerRequestClass:
Код:
public OnPlayerRequestClass(playerid, classid)
{
        PlayerPlaySound(playerid, 1187, 0,0,0);
        switch(classid)
         {
                case 0:
                {
	   SetPlayerPos(playerid, 2495.8523,-1699.8810,1014.7422);
	   SetPlayerCameraPos(playerid, 2496.3181,-1708.3535,1014.7422);
	   SetPlayerFacingAngle(playerid, 178.0108);
	   SetPlayerCameraLookAt(playerid, 2495.8523,-1699.8810,1014.7422);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,3);
                GameTextForPlayer(playerid, "~g~Grove Street", 3000, 6);
                SetPlayerColor(playerid, GROVE_COLOR);
	   }
                case 1:
                {
	   SetPlayerPos(playerid, 2495.8523,-1699.8810,1014.7422);
	   SetPlayerCameraPos(playerid, 2496.3181,-1708.3535,1014.7422);
	   SetPlayerFacingAngle(playerid, 178.0108);
	   SetPlayerCameraLookAt(playerid, 2495.8523,-1699.8810,1014.7422);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,3);
                GameTextForPlayer(playerid, "~g~Grove Street", 3000, 6);
                SetPlayerColor(playerid, GROVE_COLOR);
                }
                case 2:
                {
	   SetPlayerPos(playerid, 2495.8523,-1699.8810,1014.7422);
	   SetPlayerCameraPos(playerid, 2496.3181,-1708.3535,1014.7422);
	   SetPlayerFacingAngle(playerid, 178.0108);
	   SetPlayerCameraLookAt(playerid, 2495.8523,-1699.8810,1014.7422);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,3);
                GameTextForPlayer(playerid, "~g~Grove Street", 3000, 6);
                SetPlayerColor(playerid, GROVE_COLOR);
                }
                case 3:
                {
	   SetPlayerPos(playerid, 414.7969,2536.0540,10.0000);
	   SetPlayerCameraPos(playerid, 420.0059,2537.1035,10.0000);
	   SetPlayerFacingAngle(playerid, 272.0192);
	   SetPlayerCameraLookAt(playerid, 414.7969,2536.0540,10.0000);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,10);
                GameTextForPlayer(playerid, "~p~Ballas", 3000, 6);
                SetPlayerColor(playerid, BALLA_COLOR);
                }
                case 4:
                {
	   SetPlayerPos(playerid, 414.7969,2536.0540,10.0000);
	   SetPlayerCameraPos(playerid, 420.0059,2537.1035,10.0000);
	   SetPlayerFacingAngle(playerid, 272.0192);
	   SetPlayerCameraLookAt(playerid, 414.7969,2536.0540,10.0000);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,10);
                GameTextForPlayer(playerid, "~p~Ballas", 3000, 6);
                SetPlayerColor(playerid, BALLA_COLOR);
                }
                case 5:
                {
	   SetPlayerPos(playerid, 414.7969,2536.0540,10.0000);
	   SetPlayerCameraPos(playerid, 420.0059,2537.1035,10.0000);
	   SetPlayerFacingAngle(playerid, 272.0192);
	   SetPlayerCameraLookAt(playerid, 414.7969,2536.0540,10.0000);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,10);
                GameTextForPlayer(playerid, "~p~Ballas", 3000, 6);
                SetPlayerColor(playerid, BALLA_COLOR);
                }
                case 6:
                {
	   SetPlayerPos(playerid, 256.2929,1292.7411,1080.2578);
	   SetPlayerCameraPos(playerid, 256.6285,1287.1228,1080.2578);
	   SetPlayerFacingAngle(playerid, 182.6516);
	   SetPlayerCameraLookAt(playerid, 256.2929,1292.7411,1080.2578);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,4);
                GameTextForPlayer(playerid, "~y~Vagos", 3000, 6);
                SetPlayerColor(playerid, VAGOS_COLOR);
                }
                case 7:
                {
	   SetPlayerPos(playerid, 256.2929,1292.7411,1080.2578);
	   SetPlayerCameraPos(playerid, 256.6285,1287.1228,1080.2578);
	   SetPlayerFacingAngle(playerid, 182.6516);
	   SetPlayerCameraLookAt(playerid, 256.2929,1292.7411,1080.2578);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,4);
                GameTextForPlayer(playerid, "~y~Vagos", 3000, 6);
                SetPlayerColor(playerid, VAGOS_COLOR);
                }
                case 8:
                {
	   SetPlayerPos(playerid, 256.2929,1292.7411,1080.2578);
	   SetPlayerCameraPos(playerid, 256.6285,1287.1228,1080.2578);
	   SetPlayerFacingAngle(playerid, 182.6516);
	   SetPlayerCameraLookAt(playerid, 256.2929,1292.7411,1080.2578);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,4);
                GameTextForPlayer(playerid, "~y~Vagos", 3000, 6);
                SetPlayerColor(playerid, VAGOS_COLOR);
                }
                case 9:
                {
	   SetPlayerPos(playerid, 2320.2346,-1017.6614,1050.2109);
	   SetPlayerCameraPos(playerid, 2320.5151,-1024.2710,1050.2109);
	   SetPlayerFacingAngle(playerid, 180.6474);
	   SetPlayerCameraLookAt(playerid, 2320.2346,-1017.6614,1050.2109);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,9);
                GameTextForPlayer(playerid, "~y~Triads", 3000, 6);
                SetPlayerColor(playerid, TRIAD_COLOR);
	   }
                case 10:
                {
	   SetPlayerPos(playerid, 2320.2346,-1017.6614,1050.2109);
	   SetPlayerCameraPos(playerid, 2320.5151,-1024.2710,1050.2109);
	   SetPlayerFacingAngle(playerid, 180.6474);
	   SetPlayerCameraLookAt(playerid, 2320.2346,-1017.6614,1050.2109);
                ApplyAnimation(playerid,"DANCING", "dnce_M_b", 4.0, 1, 1, 1, 0, -1);
                SetPlayerInterior(playerid,9);
                GameTextForPlayer(playerid, "~y~Triads", 3000, 6);
                SetPlayerColor(playerid, TRIAD_COLOR);
                }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)