Spawn after kill
#1

When I first time die, it's all ok, but second, third etc. something is wrong
Video says it all.
https://*********/AgcrPLQJWGg

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
Died[playerid] = 1;
    return (
true);

PHP код:
public OnPlayerSpawn(playerid)
{
    if(
Died[playerid] == 1)
    {
        
DetermineSpawn(playerid);
        
Died[playerid] = 0;
    }
    return 
1;

PHP код:
stock DetermineSpawn(playerid)
{
    if(
PlayerInfo[playerid][pSpawnPos] == 1)
    {
        
SetPlayerPos(playerid1728.7363,-1911.9559,13.5632);
        
SetPlayerInterior(playerid0);
        
SetPlayerFacingAngle(playerid90);
        
SetPlayerVirtualWorld(playerid0);
    }

Thanks in advance. Rep +
Reply
#2

PHP код:
stock DetermineSpawn(playerid

        
SetPlayerPos(playerid1728.7363,-1911.9559,13.5632); 
        
SetPlayerInterior(playerid0); 
        
SetPlayerFacingAngle(playerid90); 
        
SetPlayerVirtualWorld(playerid0); 

Try this code instead of yours

or try this

PHP код:
stock DetermineSpawn(playerid

    if(
PlayerInfo[playerid][pSpawnPos] == 1
    { 
        
SetPlayerPos(playerid1728.7363,-1911.9559,13.5632); 
        
SetPlayerInterior(playerid0); 
        
SetPlayerFacingAngle(playerid90); 
        
SetPlayerVirtualWorld(playerid0); 
        
PlayerInfo[playerid][pSpawnPos] = 0
    } 

Reply
#3

@Arshman, Dude, you haven't changed anything , you just made ​​worse.
I must use variable for pSpawnPos, and I can't change SpawnPos to "0". Thanks anyway.

Please, someone else? I can't see mistakes in my code. What's wrong?
Reply
#4

Hmm , try adding this in the kill(and /akill) cmd
Код:
Died[otherid] = 1;
change otherid to the variable used in your command
Reply
#5

Quote:
Originally Posted by ZmaXy
Посмотреть сообщение
When I first time die, it's all ok, but second, third etc. something is wrong
Video says it all.
https://*********/AgcrPLQJWGg

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
Died[playerid] = 1;
    return (
true);

PHP код:
public OnPlayerSpawn(playerid)
{
    if(
Died[playerid] == 1)
    {
        
DetermineSpawn(playerid);
        
Died[playerid] = 0;
    }
    return 
1;

PHP код:
stock DetermineSpawn(playerid)
{
    if(
PlayerInfo[playerid][pSpawnPos] == 1)
    {
        
SetPlayerPos(playerid1728.7363,-1911.9559,13.5632);
        
SetPlayerInterior(playerid0);
        
SetPlayerFacingAngle(playerid90);
        
SetPlayerVirtualWorld(playerid0);
    }

Thanks in advance. Rep +
I Think You Forget Re Make this Variable " PlayerInfo[playerid][pSpawnPos] "
You Adding this OnPlayerConnect ?
Reply
#6

Quote:
Originally Posted by xTURBOx
Посмотреть сообщение
Hmm , try adding this in the kill(and /akill) cmd
Код:
Died[otherid] = 1;
change otherid to the variable used in your command
Yeah man, now work with /akill. Thanks, rep + But when died normally thing is the same...Problem is something in OnPlayerDeath., but what?
Reply
#7

hmm change return (true) to return 1; onplayerdeath?
Reply
#8

Problem fixed. I delete "Died" from script, and use only DetermineSpawn in OnPlayerSpawn callback, now all work perfectly.

Thanks guys for helping.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)