SpawnPlayer() bug when in vehicle
#1

Problem: When using native SpawnPlayer() function on player who is in vehicle, strange things happen. If player is on foot, he is spawned properly.

Probably OnPlayerSpawn() isn't called, but I can't explain why the character is holding bottle/cigar.

pawn Code:
COM(spawnplayer) //spawnplayer command
{
    MOD;
    new pid;
    if (sscanf(params, "u", pid)) return ERROR("Usage: /SpawnPlayer [player]");
    if (pid == INVALID_PLAYER_ID) return ERROR("Invalid player id");
    SpawnPlayer(pid);
    return 1;
}
Proof:
Reply
#2

Known one, just eject him before you SpawnPlayer him :P
Reply
#3

This bug also happens sometimes if someone dies inside a vehicle and is pressing fire key... the player is spawned with bottle/cigar.
Reply
#4

Quote:
Originally Posted by RobinOwnz
View Post
Known one, just eject him before you SpawnPlayer him :P
There is no other way ?
Reply
#5

Use this, it's works
Code:
SetPlayerPos(playerid, 0, 0, 0);
SpawnPlayer(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)