Spawn Problem
#1

Hello, its first time i deal with spawns, so i have a question.
If i put OnPlayerConnect - TogglePlayerSpectating(playerid, true);
And OnPlayerSpawn TogglePlayerSpectating(playerid, false);
my character will spawn at some 50 50 50 coords loose all health and then respawn at old position.
And i wonder whys that?
Whatever i do after TogglePlayerSpectating(playerid, false); like SetSpawnInfo, SpawnPlayer, SetPlayerPos it wont prevent loosing health and respawning player or just spawn at 50 50 50 and loosing health and respawning at 50 50 50 position...
So can you explane me how to solve ''position'' problem? And evade player loose all his health and die?
Reply
#2

BUMP!
Reply
#3

I never see this, but you tried use a timer in OnPlayerSpawn with the correctly coordinates?
Reply
#4

Yes i did, and yet it spawns me at farm near 0 0 0 actualy 50 50 50 coords... But only if i use TogglePlayerSpectating() function, is there any solution to disable ''spawn'' button i dont care if is visible or not just i want to disable on click to spawn the player...
Reply
#5

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerInterior(playerid,0); SetPlayerPos(playerid,323.4,305.6,999.1);
    SetPlayerFacingAngle(playerid, 90.0);
    TogglePlayerSpectating(playerid, 1);
    SetTimerEx("NoSpawnBoutton", 100, false, "i", playerid);
    return 1;
}
forward NoSpawnBoutton(playerid);
public NoSpawnBoutton(playerid)
{
    SetPlayerCameraPos(playerid,-200.4289,1371.9462,67.0541);
    SetPlayerCameraLookAt(playerid,203.4058,0,0);
    return 1;
}
Reply
#6

I dont use OnPlayerRequest like that, i defined it redirect on spawn.

pawn Код:
public OnPlayerRequestClass(playerid, classid) return SpawnPlayer(playerid);
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(pInfo[playerid][RegisterStep] == 1)
    {
        SetPlayerPos(playerid, 1109.3157, -1796.3719, 16.5938);              
        pInfo[playerid][RegisterStep] = 0;
    }
    else if(pInfo[playerid][RegisterStep] == 0)
    {
        SetPlayerPos(playerid, pInfo[playerid][Pos_X], pInfo[playerid][Pos_Y], pInfo[playerid][Pos_Z] + 1);
    }
    SetSkin(playerid, pInfo[playerid][Skin]);
    GiveHealth(playerid, pInfo[playerid][Health]);
    GiveArmour(playerid, pInfo[playerid][Armour]);
    SetPlayerCash(playerid, pInfo[playerid][HandMoney]);
    return true;
}
And i did try OnPlayerConnect, spectating true and at top of OnPlayerSpawn spectating false...
@Clad i did like you posted and yet it was same...
Reply
#7

If you want it to remove the spawn boutton do as I posted otherwise it's impossible to remove it.
Reply
#8

Try delete this
pawn Код:
public OnPlayerRequestClass(playerid, classid) return SpawnPlayer(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)