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
#2

paste the onplayerrequestclass code on onplayerconnect
Reply
#3

I dont know what you mean, but here is my ''OnPlayerConnect'' Code.

pawn Код:
public OnPlayerConnect(playerid)
{
    isDead[ playerid ] = 0;
    class_selection[ playerid ] = 0;
    new name[MAX_PLAYER_NAME+1];
    oEdit[playerid] = 0;
    oEditID[playerid] = 0;
    GetPlayerName(playerid, name, sizeof(name));
    if(fexist(UserPath(playerid)))
    {
       INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
       if(PlayerInfo[playerid][pBanned]==1)
       {
          SendClientMessage(playerid, COLOR_RED, "You are banned from Counter Strike - Sniper Rampage Beta. Feel free to post an ban appeal on www.socialtube.nl");
          Kick(playerid);
       }
       else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Welcome on CS Beta - Sniper Rampage, Please login to continue!","Login","Quit");
    }
    else
    {
       ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Register",""COL_WHITE"Welcome on CS Beta - Sniper Rampage\n please, type a password below to register!","Register","Quit");
    }

    VHealth[playerid] = TextDrawCreate(498.000000, 220.000000, "~r~Health~w~:");
    TextDrawBackgroundColor(VHealth[playerid], 255);
    TextDrawFont(VHealth[playerid], 1);
    TextDrawLetterSize(VHealth[playerid], 0.330000, 0.699999);
    TextDrawColor(VHealth[playerid], -1);
    TextDrawSetOutline(VHealth[playerid], 0);
    TextDrawSetProportional(VHealth[playerid], 1);
    TextDrawSetShadow(VHealth[playerid], 1);

    Stats[playerid] = TextDrawCreate(494.000000, 195.000000, "                     ~<~~y~Stats~w~~>~                                                                                          ");
    TextDrawBackgroundColor(Stats[playerid], 255);
    TextDrawFont(Stats[playerid], 1);
    TextDrawLetterSize(Stats[playerid], 0.450000, 1.200000);
    TextDrawColor(Stats[playerid], -1);
    TextDrawSetOutline(Stats[playerid], 0);
    TextDrawSetProportional(Stats[playerid], 1);
    TextDrawSetShadow(Stats[playerid], 1);
    TextDrawUseBox(Stats[playerid], 1);
    TextDrawBoxColor(Stats[playerid], 95);
    TextDrawTextSize(Stats[playerid], 608.000000, -58.000000);

    VLevel[playerid] = TextDrawCreate(498.000000, 228.000000, "~r~Level~w~:");
    TextDrawBackgroundColor(VLevel[playerid], 255);
    TextDrawFont(VLevel[playerid], 1);
    TextDrawLetterSize(VLevel[playerid], 0.330000, 0.699999);
    TextDrawColor(VLevel[playerid], -1);
    TextDrawSetOutline(VLevel[playerid], 0);
    TextDrawSetProportional(VLevel[playerid], 1);
    TextDrawSetShadow(VLevel[playerid], 1);

    VCash[playerid] = TextDrawCreate(498.000000, 236.000000, "~r~Cash~w~:");
    TextDrawBackgroundColor(VCash[playerid], 255);
    TextDrawFont(VCash[playerid], 1);
    TextDrawLetterSize(VCash[playerid], 0.330000, 0.699999);
    TextDrawColor(VCash[playerid], -1);
    TextDrawSetOutline(VCash[playerid], 0);
    TextDrawSetProportional(VCash[playerid], 1);
    TextDrawSetShadow(VCash[playerid], 1);

    VArmour[playerid] = TextDrawCreate(498.000000, 243.000000, "~r~Armour~w~:");
    TextDrawBackgroundColor(VArmour[playerid], 255);
    TextDrawFont(VArmour[playerid], 1);
    TextDrawLetterSize(VArmour[playerid], 0.330000, 0.699999);
    TextDrawColor(VArmour[playerid], -1);
    TextDrawSetOutline(VArmour[playerid], 0);
    TextDrawSetProportional(VArmour[playerid], 1);
    TextDrawSetShadow(VArmour[playerid], 1);

    VPlayer[playerid] = TextDrawCreate(515.000000, 196.000000, "~g~Player");
    TextDrawBackgroundColor(VPlayer[playerid], 255);
    TextDrawFont(VPlayer[playerid], 1);
    TextDrawLetterSize(VPlayer[playerid], 0.500000, 1.000000);
    TextDrawColor(VPlayer[playerid], -1);
    TextDrawSetOutline(VPlayer[playerid], 0);
    TextDrawSetProportional(VPlayer[playerid], 1);
    TextDrawSetShadow(VPlayer[playerid], 1);


    CreatePickup(1239, 1, 49.5787, 401.7574, 2.4079, -1);
    CreatePickup(1239, 1, 49.5787, 401.7574, 12.7378, -1);
    CreatePickup(1239, 1, 49.5626, 401.4964, 23.2279, -1);
    CreatePickup(1239, 1, 194.1673, 401.2836, 2.4079, -1);
    CreatePickup(1239, 1, 194.1673, 401.2836, 12.7379, -1);
    CreatePickup(1239, 1, 194.1673, 401.2836, 23.2279, -1);

    Create3DTextLabel("/elevator \n to use this elevator", COLOR_BLUE, 49.5787, 401.7574, 2.4079, 40.0, 0, 0);
    Create3DTextLabel("/elevator \n to use this elevator", COLOR_BLUE, 49.5787, 401.7574, 12.7378, 40.0, 0, 0);
    Create3DTextLabel("/elevator \n to use this elevator", COLOR_BLUE, 49.5787, 401.7574, 23.2279, 40.0, 0, 0);
    Create3DTextLabel("/elevator \n to use this elevator", COLOR_BLUE, 194.1673, 401.2836, 2.4079, 40.0, 0, 0);
    Create3DTextLabel("/elevator \n to use this elevator", COLOR_BLUE, 194.1673, 401.2836, 12.7379, 40.0, 0, 0);
    Create3DTextLabel("/elevator \n to use this elevator", COLOR_BLUE, 194.1673, 401.2836, 23.2279, 40.0, 0, 0);
    return 1;
}
Reply
#4

OnPlayerDeath ?
Reply
#5

Show the "OnPlayerDeath" code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)