SA-MP Forums Archive
Stupid problems, spawning - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Stupid problems, spawning (/showthread.php?tid=209661)



Stupid problems, spawning - Anthonyx3' - 11.01.2011

Yeah this is like my 5th spawning problem, in past weeks, lol.

pawn Код:
SetSpawnInfo(playerid, 0, UserStats[playerid][Skin], UserStats[playerid][ppos_x], UserStats[playerid][ppos_y], UserStats[playerid][ppos_z], 0.0, 0, 0, 0, 0, 0, 0);
    SpawnPlayer(playerid);
    SetPlayerPos(playerid, UserStats[playerid][ppos_x], UserStats[playerid][ppos_y], UserStats[playerid][ppos_z]);
I load the needed stuff on login, but my player doesnt spawn. It goes as if it was goin to spawn, but then it just shows camera looking at my SetPlayerCameraPos thing. I have this code on my player login function, suggestions on how to fix?


Re: Stupid problems, spawning - _rAped - 11.01.2011

SetCameraBehindPlayer() under OnPlayerSpawn()..? and SetPlayerPos should also be called under OnPlayerSpawn.


Re: Stupid problems, spawning - Anthonyx3' - 11.01.2011

I have it called under my login function atm, is that wrong?


Re: Stupid problems, spawning - _rAped - 11.01.2011

Yes.


Re: Stupid problems, spawning - Anthonyx3' - 11.01.2011

If i did setplayerpos under onplayerspawn, wouldnt that mess with my register?


Re: Stupid problems, spawning - _rAped - 11.01.2011

Make a variable called SpawnType or something.


Re: Stupid problems, spawning - Anthonyx3' - 11.01.2011

pawn Код:
switch(SpawnType[playerid])
{
     case 0:
     {
          // When the player dies
     }
     case 1:
     {
        //login
     }
     case 2:
     {
        //registered
     }
}
Like that right


Re: Stupid problems, spawning - _rAped - 11.01.2011

Yes.


Re: Stupid problems, spawning - Anthonyx3' - 11.01.2011

[img]www.nl-gaming.com/error.png[/img]

Thats what i keep getting.

My code:
pawn Код:
public OnPlayerSpawn(playerid)
{
    switch(SpawnType[playerid])
    {
        case 0:
        {
          // When the player dies
        }
        case 1:
        {
        SetPlayerPos(playerid, UserStats[playerid][ppos_x], UserStats[playerid][ppos_y], UserStats[playerid][ppos_z]);
        SetPlayerScore(playerid, UserStats[playerid][Level]);
        SetPlayerCash(playerid, UserStats[playerid][Money]);
        }
        case 2:
        {
        SetPlayerPos(playerid, -1970.8109,117.8598,27.6875);
        }
}
   
    return 1;
}
Login:
pawn Код:
SetSpawnInfo(playerid, 0, UserStats[playerid][Skin], UserStats[playerid][ppos_x], UserStats[playerid][ppos_y], UserStats[playerid][ppos_z], 0.0, 0, 0, 0, 0, 0, 0);
    SpawnPlayer(playerid);
Help is much needed/appreciated.


Re: Stupid problems, spawning - _rAped - 11.01.2011

Do you define SpawnType OnDialogResponse?