Returning to class selection after next death
#1

Hmm, does anybody of you know what is the key of "Returning to class selection after next death" (F4).

KEY_....

Please, tell me if you know.
Reply
#2

It Isn't mapped, If It is it isn't documented as far as I know.
If you wanna disable It you can't. You can bypass class selection though.
Reply
#3

I think its not defined but just add a printf("newkeys %d", newkeys); in OnPlayerKeyStateChange and press F4 in game, if it prints something (which I dont expect) the key is defined under the printed number
Reply
#4

There is no key defined for it... you can only get control keys by gta sa...
however if you want the player to go back to spawn after next death you can use "ForceClassSelection(playerid)"
Reply
#5

Quote:
Originally Posted by Sascha
Посмотреть сообщение
however if you want the player to go back to spawn after next death you can use "ForceClassSelection(playerid)"
I know, but that's what not the thing I want to do...

But nevermind of it, because now I know that It's impossible. Thanks anyways.
Reply
#6

indeed... if you don't tell us your aim we can't help you the right way lol
Reply
#7

Hmm,

Okay, let me tell you. I have made a teams, and i just made a team balancer. It works like, that if a player joins a team, it adds +1 to a variable, witch checks that if the team has max players. Now, when player wants to change the team, he should do /changeteam, and when he does that, it will check that in what team the player is, and then reduce -1 from the variable. But now, if he press F4, it will not do that step what i just told you, so this will mess up everything, means that all teams will be full, and no one can't join.

Hope you understood what I'm trying to do.
Reply
#8

you can use "OnPlayerSpawn" and set his skin, and team, etc. back to his old team...

e.g.
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(GetPlayerTeam(playerid) == 1)
    {
        SetPlayerSkin(playerid, team1skin);
        SetPlayerColor(playerid, team1color);
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by Sascha
Посмотреть сообщение
you can use "OnPlayerSpawn" and set his skin, and team, etc. back to his old team...
pawn Код:
public OnPlayerSpawn(playerid)
{
    new rand = random(sizeof(TSpawns));
    new rand1 = random(sizeof(GSpawns));
    new rand2 = random(sizeof(RSpawns));
    new rand3 = random(sizeof(SSpawns));
   
    //GangZone Areas
    GangZoneShowForPlayer(playerid, TerroristZone, -16777017);
    GangZoneShowForPlayer(playerid, GanstasZone, 16711888);
    GangZoneShowForPlayer(playerid, RebelZone, -65332);
    GangZoneShowForPlayer(playerid, SwatZone, 65477);
   
    if(TClassID[playerid] == 0)
    {
        if(TeamTestTerror < 8)
        {
            ResetPlayerWeapons(playerid);
            SetPlayerPos(playerid, TSpawns[rand][0], TSpawns[rand][1], TSpawns[rand][2]);
            SetPlayerHealth(playerid, 9999999.9);
            SetPlayerColor(playerid, 0xF50000FF);
            ShowPlayerDialog(playerid, TMENU, DIALOG_STYLE_LIST, "Choose what you want to be below:", "Recon\nMedic\nAssault\nEngineer", "Pick", "Cancel");
            IsTerrorist[playerid] = 1;
            IsInTerror[playerid] = true;
            TeamTestTerror += 1;
        }
        else if(TeamTestTerror == 8)
        {
            ForceClassSelection(playerid);
            SetPlayerHealth(playerid, 0);
        }
    }
    if(TClassID[playerid] == 1)
    {
        if(TeamTestSwat < 8)
        {
            ResetPlayerWeapons(playerid);
            SetPlayerHealth(playerid, 9999999.9);
            SetPlayerColor(playerid, 0x000FFFFF);
            SetPlayerPos(playerid, SSpawns[rand3][0], SSpawns[rand3][1], SSpawns[rand3][2]);
            ShowPlayerDialog(playerid, SMENU, DIALOG_STYLE_LIST, "Choose what you want to be below:", "Recon\nMedic\nAssault\nEngineer", "Pick", "Cancel");
            IsSwat[playerid] = 1;
            IsInSwat[playerid] = true;
            TeamTestSwat += 1;
        }
        else if(TeamTestSwat == 8)
        {
            ForceClassSelection(playerid);
            SetPlayerHealth(playerid, 0);
        }
    }
    if(TClassID[playerid] == 2)
    {
        if(TeamTestGang < 8)
        {
            ResetPlayerWeapons(playerid);
            SetPlayerHealth(playerid, 9999999.9);
            SetPlayerColor(playerid, 0x00FF14FF);
            SetPlayerPos(playerid, GSpawns[rand1][0], GSpawns[rand1][1], GSpawns[rand1][2]);
            ShowPlayerDialog(playerid, GMENU, DIALOG_STYLE_LIST, "Choose what you want to be below:", "Recon\nMedic\nAssault\nEngineer", "Pick", "Cancel");
            IsGansta[playerid] = 1;
            IsInGang[playerid] = true;
            TeamTestGang += 1;
        }
        else if(TeamTestGang == 8)
        {
            ForceClassSelection(playerid);
            SetPlayerHealth(playerid, 0);
        }
    }
    if(TClassID[playerid] == 3)
    {
        if(TeamTestRebel < 8)
        {
            ResetPlayerWeapons(playerid);
            SetPlayerHealth(playerid, 9999999.9);
            SetPlayerColor(playerid, 0xFFFA00FF);
            SetPlayerPos(playerid, RSpawns[rand2][0], RSpawns[rand2][1], RSpawns[rand2][2]);
            ShowPlayerDialog(playerid, RMENU, DIALOG_STYLE_LIST, "Choose what you want to be below:", "Recon\nMedic\nAssault\nEngineer", "Pick", "Cancel");
            IsRebel[playerid] = 1;
            IsInRebel[playerid] = true;
            TeamTestRebel += 1;
        }
        else if(TeamTestRebel == 8)
        {
            ForceClassSelection(playerid);
            SetPlayerHealth(playerid, 0);
        }
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
   
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
   
    //If used /changeteam, else if used F4, it will mess up.
    if(UsedCTeam[playerid] == 1)
    {
        IsTerrorist[playerid] = 0;
        IsRebel[playerid] = 0;
        IsSwat[playerid] = 0;
        IsGansta[playerid] = 0;
       
        TeamTestRebel -= 1;
        TeamTestGang -= 1;
        TeamTestSwat -= 1;
        TeamTestTerror -= 1;
       
        IsInTerror[playerid] = false;
        IsInSwat[playerid] = false;
        IsInGang[playerid] = false;
        IsInRebel[playerid] = false;
    }
Reply
#10

I have the solution but i didn't test it yet

Код:
new PlayerSkin[MAX_PLAYERS];
new Dead[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
  Dead[playerid] = false;
  return 1;
}

public OnPlayerDeath(playerid,killerid,reason)
{
  GetPlayerSkin(playerid,PlayerSkin[playerid]);
  return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
  if(Dead[playerid])
  {
    SpawnPlayer(playerid);
    SetPlayerSkin(playerid,PlayerSkin[playerid]);
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)