Player is inside of a car, but at the same time he isn't
#1

Hello,

When i respawn / put the player into another vehicle, he gets in there, but he is invisible, it is like he isn't inside of the car, also he cant exit it, since he isn't really in there, but camera pos and controlling the vehicle works, just no character model to be seen.

Maybe anyone can tell me what possible reasons could be, because i have no clue.

onPlayerSpawn / onPlayerDeath ar empty, just saying. And before putting the player into the vehicle i check if he is spawned, if not i spawn him. I also make sure he isn't in spectatormode:

PHP код:
spawnPlayer(playerid)
{
    
TogglePlayerSpectating(playerid0);
    
    if(!
IsPlayerSpawned(playerid))
    {
        
SpawnPlayer(playerid);
    }
    
    new 
mode playerMode[playerid];
    switch(
mode)
    {
        case 
GAMEMODE_DM:
        {
            new 
newVehicle CreateVehicle(411modeState[playersMode][spawnX], modeState[playersMode][spawnY], modeState[playersMode][spawnZ], modeState[mode][spawnRotation], -1, -1, -1);
            
SetVehicleVirtualWorld(newVehicleGetPlayerVirtualWorld(playerid));
            
PutPlayerInVehicle(playeridnewVehicle0);
        }
        
//...
    
}

greetings Marcel
Reply
#2

Код:
new mode = playerMode[playerid]; 

    switch(mode) 
    { 
        case GAMEMODE_DM: 
        { 
            new newVehicle = CreateVehicle(411, modeState[playersMode][spawnX], modeState[playersMode][spawnY], modeState[playersMode][spawnZ], modeState[mode][spawnRotation], -1, -1, -1); 
            SetVehicleVirtualWorld(newVehicle, GetPlayerVirtualWorld(playerid)); 
            PutPlayerInVehicle(playerid, newVehicle, 0); 
        } 
        //... 
    }
try putting it inside OnPlayerSpawn
Reply
#3

That's not an option because the player doesn't neccessarily have to die to be "respawned"

Edit: NVM i could just call "SpawnPlayer" (onPlayerSpawn) which then calls "spawnPlayer" ... gonna try that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)