How to disable class selection?
#1

Hi, i have problem. In my RP gamemode if someone dies, he come back to class selection. How to disable that piece of shit?

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
    SetPlayerPos(playerid,  982.1890, -1624.2583, 14.9526);
    SetPlayerFacingAngle(playerid, 90);
    return 1;
}
Reply
#2

pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    SpawnPlayer(playerid);
    return 1;
}
Reply
#3

There's nothing specified here which takes the player back to class selection, but it does if player has pressed 'F4' and then after death, it takes to class selection which is provided by SA-MP.

pawn Код:
new _PlayerSpawns[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
 _PlayerSpawns[playerid] = 0;
 return 1;
}

public OnPlayerRequestClass(playerid)
{
 if(_PlayerSpawns[playerid] == 1) return Spawn(playerid);
 return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
 _PlayerSpawns[playerid] = 1;
 return 1;
}

public OnPlayerSpawn(playerid)
{
 _PlayerSpawns[playerid] = 0;
 return 1;
}
The above code will prevent player from going back to class selection after death even if the player has enabled 'F4'. It might take to class, but will spawn suddenly so that the player won't be able to choose another class. Also, the variable isn't for calculating the number of spawns here, it's to balance it so that player won't go back to spawn selection even if 'F4' is toggled after before death / after death.
Reply
#4

Is
pawn Код:
SetPlayerPos(playerid,  982.1890, -1624.2583, 14.9526);
SetPlayerFacingAngle(playerid, 90);
necessary? When you die your teleport back to your first spawnpoint. If this coods are the same with spawn, then delete it.
Reply
#5

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
Is
pawn Код:
SetPlayerPos(playerid,  982.1890, -1624.2583, 14.9526);
SetPlayerFacingAngle(playerid, 90);
necessary? When you die your teleport back to your first spawnpoint. If this coods are the same with spawn, then delete it.
If i delete it it doesnt tp me when im changing skin at skin select, but after i choose one it tps me to spawnpoint.
Reply
#6

It's set correct, you are done,
Reply
#7

Quote:
Originally Posted by Tamer T
Посмотреть сообщение
pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    SpawnPlayer(playerid);
    return 1;
}
Thanks, i fixed it by this code.
+ repped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)