spawn problem
#1

Hello i made a code comments will explain:

PHP код:
    if(PlayerInfo[playerid][pRegistred] == && IsDied[playerid] == 1//if player already registered and died
    
{
        new 
Random random(sizeof(RandomSpawns));
        
SetPlayerPos(playeridRandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
        
SetPlayerFacingAngle(playeridRandomSpawns[Random][3]);
        
IsDied[playerid] = 0;
     }
    else if(
PlayerInfo[playerid][pRegistred] == && IsDied[playerid] == 0// if player already registred and just joined the game and spawned
    
{
        
SetPlayerPos(playeridPlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
        
SetPlayerFacingAngleplayeridPlayerInfo[playerid][pAngle]);
        
SetPlayerInterior(playeridPlayerInfo[playerid][pInterior]);
        
SetPlayerVirtualWorld(playeridPlayerInfo[playerid][pVirtualWorld]);
        
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]);
     }
    else if(
PlayerInfo[playerid][pRegistred] == && IsDied[playerid] == 0//if player first time registered and first time spawning
    
{
        new 
Random random(sizeof(RandomSpawns));
        
SetPlayerPos(playeridRandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
        
SetPlayerFacingAngle(playeridRandomSpawns[Random][3]);
        
SetPlayerInterior(playerid0);
        
SetPlayerVirtualWorld(playerid0);
        
GivePlayerMoney(playerid15000);
        
GivePlayerWeapon(playerid41);
        
GivePlayerWeapon(playerid22150);
    } 
My problem is when player registred and died it spawns at the last position while it should be spawned in a random spawn point
Reply


Messages In This Thread
spawn problem - by SalmaN97 - 27.11.2015, 00:53
Re: spawn problem - by lucamsx - 27.11.2015, 07:42
Re: spawn problem - by PrO.GameR - 27.11.2015, 08:03
Re: spawn problem - by Sew_Sumi - 27.11.2015, 08:19
Re: spawn problem - by SalmaN97 - 28.11.2015, 22:25
Re: spawn problem - by CmZxC - 28.11.2015, 22:35
Re: spawn problem - by SalmaN97 - 28.11.2015, 22:44
Re: spawn problem - by SalmaN97 - 29.11.2015, 04:34
Re: spawn problem - by ATGOggy - 29.11.2015, 05:08
Re: spawn problem - by SalmaN97 - 29.11.2015, 10:37

Forum Jump:


Users browsing this thread: 1 Guest(s)