02.04.2013, 13:55
Alright, I tried this and it works for me. I may overdid it, but give a try!
I tested and everytime I used f4 and /kill, it didn't teleport me to the class selection as it should do that, but it spawned me instead. I'm sure it will work for you!
pawn Код:
new
isDead[ MAX_PLAYERS ],
class_selection[ MAX_PLAYERS ]
;
public OnPlayerRequestClass( playerid, classid )
{
class_selection[ playerid ] = 1;
if( isDead[ playerid ] == 1 && class_selection[ playerid ] == 1 )
{
SetSpawnInfo( ... ); // Edit it
SpawnPlayer( playerid );
return 1;
}
// rest of setting up the place
return 1;
}
public OnPlayerConnect( playerid )
{
isDead[ playerid ] = 0;
class_selection[ playerid ] = 0;
return 1;
}
public OnPlayerSpawn( playerid )
{
SetPlayerInterior( playerid, 0 );
SetCameraBehindPlayer( playerid );
if( isDead[ playerid ] == 1 && class_selection[ playerid ] == 1 )
{
isDead[ playerid ] = 0;
class_selection[ playerid ] = 0;
}
if( isDead[ playerid ] == 1 ) isDead[ playerid ] = 0;
if( class_selection[ playerid ] == 1 ) class_selection[ playerid ] = 0;
return 1;
}
public OnPlayerDeath( playerid, killerid, reason )
{
isDead[ playerid ] = 1;
return 1;
}