SA-MP Forums Archive
Onplayerspawn setinterior error :( - 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)
+--- Thread: Onplayerspawn setinterior error :( (/showthread.php?tid=509910)



Onplayerspawn setinterior error :( - saikumar - 28.04.2014

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid, 18);
    SetPlayerPos(playerid, 1726.18, -1641.00, 20.23);
}
this is in the script when player spawn he is spawning in the Pos but not in the interior

i want players should spawn in the Atrium Interior

can anybody help me please ?? ??
Thanks in advance


Re: Onplayerspawn setinterior error :( - Guest4390857394857 - 28.04.2014

Try this!
Код:
public OnPlayerSpawn(playerid)
{
     SetPlayerInterior(playerid, 18);
     SetPlayerPos(playerid, 1726.18, -1641.00, 20.23);
     return 1;
}
Working?


Re: Onplayerspawn setinterior error :( - Eth - 28.04.2014

ShivRp you didn't even edit anything...
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid, 18);
SetPlayerPos(playerid, 1710.433715,-1669.379272,20.225049);//check this:http://weedarr.wikidot.com/interior
}



Re: Onplayerspawn setinterior error :( - saikumar - 28.04.2014

Quote:
Originally Posted by ShivRp
Посмотреть сообщение
Try this!
Код:
public OnPlayerSpawn(playerid)
{
     SetPlayerInterior(playerid, 18);
     SetPlayerPos(playerid, 1726.18, -1641.00, 20.23);
}
Working?
Nope


Re: Onplayerspawn setinterior error :( - saikumar - 28.04.2014

Quote:
Originally Posted by Eth
Посмотреть сообщение
ShivRp you didn't even edit anything...
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid, 18);
SetPlayerPos(playerid, 1710.433715,-1669.379272,20.225049);//check this:http://weedarr.wikidot.com/interior
}
already tried this and it didnt work.
so i used coordinates from samp wiki.



Sorry for double Post


Re: Onplayerspawn setinterior error :( - Guest4390857394857 - 28.04.2014

Can you sow us your whole thing under onplayerspawn, because some ither tele variable may event affect this.


Re: Onplayerspawn setinterior error :( - Eth - 28.04.2014

onplayerconnect:
SetPlayerInterior to 18
then onplayerspawn set his position to :1710.433715,-1669.379272,20.225049
or onplayerrequestspawn setplayerinterior to 18
and on player spawn set his position to anything you want.


Re: Onplayerspawn setinterior error :( - Guest4390857394857 - 28.04.2014

Quote:

playerspawn set his position to :1710.433715,-1669.379272,20.225049
or onplayerrequestspawn setplayerinterior to 18
and on player spawn set his position to anything you want.

In cmd

Код:
Public OnPlayerConnect(playerid)
{
     SetPlayerInterior(playerid, 18);
}
And now spawning with that interior.

Код:
public OnPlayerSpawn(playerid)
{
     SetPlayerPos(playerid, 1726.18, -1641.00, 20.23);
     return 1;
}
Working?


Re: Onplayerspawn setinterior error :( - saikumar - 28.04.2014

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid, 18);
    if(IsPlayerNPC(playerid)) return 1;
    SetPlayerInterior(playerid,0);
    TogglePlayerClock(playerid,1);
    SetPlayerPos(playerid, 1726.18, -1641.00, 20.23);

    if(Dead[playerid] == 1 && DmID[playerid] == 1)
    {
        SetPlayerInterior(playerid, 1);
        SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377);
        SetPlayerVirtualWorld(playerid, 1);
        Dead[playerid] = 0;
    }
    else if(Dead[playerid] == 1 && DmID[playerid] == 2)
    {
        SetPlayerInterior(playerid, 10);
        SetPlayerPos(playerid, -975.975708,1060.983032,1345.671875);
        SetPlayerVirtualWorld(playerid, 1);
        Dead[playerid] = 0;
    }
    else if(Dead[playerid] == 1 && DmID[playerid] == 3)
    {
        SetPlayerInterior(playerid, 3);
        SetPlayerPos(playerid, 288.745971, 169.350997, 1007.171875);
        SetPlayerVirtualWorld(playerid, 1);
        Dead[playerid] = 0;
    }
    else if(Dead[playerid] == 1 && DmID[playerid] == 4)
    {
        SetPlayerInterior(playerid, 3);
        SetPlayerPos(playerid, -2640.762939, 1406.682006, 906.460937);
        SetPlayerVirtualWorld(playerid, 1);
        Dead[playerid] = 0;
    }
    return 1;
}
this is the whole thing in onplayerspawn


AW: Onplayerspawn setinterior error :( - Macronix - 28.04.2014

Remove this line:
pawn Код:
SetPlayerInterior(playerid,0);
If you want the whole code fixed:
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    TogglePlayerClock(playerid,1);
    SetPlayerInterior(playerid, 18);
    SetPlayerPos(playerid, 1726.18, -1641.00, 20.23);

    if(Dead[playerid] == 1 && DmID[playerid] == 1)
    {
        SetPlayerInterior(playerid, 1);
        SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377);
        SetPlayerVirtualWorld(playerid, 1);
        Dead[playerid] = 0;
    }
    else if(Dead[playerid] == 1 && DmID[playerid] == 2)
    {
        SetPlayerInterior(playerid, 10);
        SetPlayerPos(playerid, -975.975708,1060.983032,1345.671875);
        SetPlayerVirtualWorld(playerid, 1);
        Dead[playerid] = 0;
    }
    else if(Dead[playerid] == 1 && DmID[playerid] == 3)
    {
        SetPlayerInterior(playerid, 3);
        SetPlayerPos(playerid, 288.745971, 169.350997, 1007.171875);
        SetPlayerVirtualWorld(playerid, 1);
        Dead[playerid] = 0;
    }
    else if(Dead[playerid] == 1 && DmID[playerid] == 4)
    {
        SetPlayerInterior(playerid, 3);
        SetPlayerPos(playerid, -2640.762939, 1406.682006, 906.460937);
        SetPlayerVirtualWorld(playerid, 1);
        Dead[playerid] = 0;
    }
    return 1;
}