OnPlayerSpawn bug
#1

Hello everybody,

I have a big problem that I discovered today. It's about OnPlayerSpawn, I'm going to explain the problem :
Supposed that a player was respawned by an admin, he respawns in the correct coordinates (the coordinates that I've put in onplayerspawn)

Supposed that player b was killed, he doesn't respawn correctly ! He respawns in the AddPlayerClass coordinates, I want the player to spawn to the coordinats that I've done ! When I respawn him, he spawns in the addplayerclass coordinates

When I try to respawn the player who got killed, he respawns in the AddPlayerClass ! I don't know seriously the source of this problem....
Reply
#2

Try this:
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(RespawnPlayer[playerid])
    {
         RespawnPlayer[playerid] = 0;
         SetSpawnInfo(playerid, gTeam[playerid], PlayerSkin[playerid], RespawnPlayer_Pos[playerid][0], RespawnPlayer_Pos[1], RespawnPlayer_Pos[2], RespawnPlayer_Pos[3],0,0,0,0,0,0);
         SpawnPlayer(playerid);
         return 1;
    }
    return 1;
}
Basically not using SetSpawnInfo / SpawnPlayer is your problem.
See:
https://sampwiki.blast.hk/wiki/SetSpawnInfo
Reply
#3

Bro. Add It Under The Callback OnPlayerDeath. Something Like This.

public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerPos(playerid, X, Y, Z);
return 1;
}

Where I Have Marked X,Y,Z Add Your Coordinates There.
Reply
#4

Before that, it was working but know, it doesn't work.
What is the matter guys ?
Reply
#5

show me the AddPlayerClass code when player was killed
Reply
#6

AddPlayerClass(25, 1642.7285,-2240.5591,13.4945,180.0272, 0, 0, 0, 0, 0, 0);
Reply
#7

Quote:
Originally Posted by streetpeace
Посмотреть сообщение
AddPlayerClass(25, 1642.7285,-2240.5591,13.4945,180.0272, 0, 0, 0, 0, 0, 0);
Код:
AddPlayerClass(25, 1642.7285,-2240.5591,13.4945, 0, 0, 0, 0, 0, 0);
If you want you can change this cordinate 1642.7285,-2240.5591,13.4945 to your cordinate which you odrder for correct cordinates
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)