OnPlayerDeath
#1

Well, i got this now on PlayerSpawn
pawn Код:
public OnPlayerSpawn( playerid )
{
    SetPlayerInterior( playerid, 0 );
    SetCameraBehindPlayer( playerid );
    if( isDead[ playerid ] == 1 && class_selection[ playerid ] == 1 )
    {
        isDead[ playerid ] = 0;
        class_selection[ playerid ] = 1;
    }
    if( isDead[ playerid ] == 1 ) isDead[ playerid ] = 0;
    if( class_selection[ playerid ] == 1 ) class_selection[ playerid ] = 1;
    TextDrawShowForPlayer(playerid, VHealth[playerid]);
    TextDrawShowForPlayer(playerid, Stats[playerid]);
    TextDrawShowForPlayer(playerid, VArmour[playerid]);
    TextDrawShowForPlayer(playerid, VLevel[playerid]);
    TextDrawShowForPlayer(playerid, VCash[playerid]);
    TextDrawShowForPlayer(playerid, VPlayer[playerid]);
    GivePlayerWeapon(playerid, 24, 50);
    return 1;
}
This is On Player Request Class

pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
   if(class_selection[ playerid ] == 0)
   {
    new string[128];
    SetPlayerPos(playerid, 786.2990,845.2061,176.7938);
    SetPlayerCameraPos(playerid, 779.6148,845.5803,180.1051);
    SetPlayerCameraLookAt(playerid, 786.2990,845.2061,176.7938);
    if( isDead[ playerid ] == 1 ) SpawnPlayer( playerid );
    if(classid == 0)
    {
        format(string, sizeof(string), "~r~Terrorists");
        GameTextForPlayer(playerid, string, 3000, 6);
        SetPlayerSkin(playerid, 294);
        PlayerInfo[playerid][pTeam] = 1;
        SetPlayerColor(playerid, COLOR_RED);
        return 0;
    }
    else if(classid == 1)
    {
        format(string, sizeof(string), "~b~Counter-Terrorists");
        GameTextForPlayer(playerid, string, 3000, 6);
        SetPlayerSkin(playerid, 285);
        PlayerInfo[playerid][pTeam] = 2;
        SetPlayerColor(playerid, COLOR_BLUE);
        return 0;
    }
   }
   else if( isDead[ playerid ] == 1 && class_selection[ playerid ] == 1 )
   {
     if(PlayerInfo[playerid][pAdmin] == 1)
     {
        SetSpawnInfo( playerid, 0, 294, 195.5586, 427.2332, 12.7379, 269.15, 0, 0, 0, 0, 24, 50 );
        SpawnPlayer( playerid );
     }
     else if(PlayerInfo[playerid][pTeam] == 2)
     {
        SetSpawnInfo( playerid, 0, 285, 49.1121, 423.5605, 12.7379, 269.15, 0, 0, 0, 0, 24, 50 );
        SpawnPlayer( playerid );
     }
     return 1;
   }
   return 1;
}
Ehhm..
Well. If i die, It's returning to class selection :S

But i want only a class selection, when someone joins the server.
Not when he dies.
Can somebody help me out?
Reply


Messages In This Thread
OnPlayerDeath - by faff - 02.04.2013, 19:51
Re: OnPlayerDeath - by Kestro - 02.04.2013, 19:55
Re: OnPlayerDeath - by faff - 02.04.2013, 19:56
Re: OnPlayerDeath - by park4bmx - 02.04.2013, 20:22
Re: OnPlayerDeath - by Private200 - 02.04.2013, 20:55

Forum Jump:


Users browsing this thread: 1 Guest(s)