OnPlayerSpawn bug -
streetpeace - 14.02.2015
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....
Re: OnPlayerSpawn bug -
Puppy - 14.02.2015
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
Re: OnPlayerSpawn bug -
Karan007 - 14.02.2015
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.
Re : OnPlayerSpawn bug -
streetpeace - 14.02.2015
Before that, it was working but know, it doesn't work.
What is the matter guys ?
Re: OnPlayerSpawn bug -
bigboy81 - 14.02.2015
show me the AddPlayerClass code when player was killed
Re : OnPlayerSpawn bug -
streetpeace - 14.02.2015
AddPlayerClass(25, 1642.7285,-2240.5591,13.4945,180.0272, 0, 0, 0, 0, 0, 0);
Re: Re : OnPlayerSpawn bug -
bigboy81 - 14.02.2015
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