How can i do this?
#1

Hello i have a gamemode that has a problem when a player dies the skin gets changed back to CJ and after the first death the class selection does not pop up, so how can i make it so when a player dies the class selection does not happen?
Reply
#2

Quote:
Originally Posted by mtywe
Посмотреть сообщение
Hello i have a gamemode that has a problem when a player dies the skin gets changed back to CJ and after the first death the class selection does not pop up, so how can i make it so when a player dies the class selection does not happen?
it usualy shouldnt, can you show your onPlayerDeath part?
Reply
#3

Here you are
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  	PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
    SafeResetPlayerWeapons(playerid);
    GetPlayerSkin(playerid);
	PlayerInfo[playerid][pCards] = 0;
    PlayerInfo[playerid][pCard1] = 0;
    PlayerInfo[playerid][pCard2] = 0;
    ResetPlayerWantedLevelEx(playerid);
   	InShamal[playerid] = 0;
    InAndrom[playerid] = 0;
    CopOnDuty[playerid] = 0;
   	if(Planted[playerid] == 1)
	{
	    DestroyObject(C4[playerid]);
	    Bomb[playerid] = 0;
	    Planted[playerid] = 0;
	}
	return 1;
}
Reply
#4

lol at above,

you would somthing like this
https://sampwiki.blast.hk/wiki/ForceClassSelection

so like
pawn Код:
Public OnPlayerDeath(playerid, killerid, reason)
{
       ForceClassSelection(playerid);
       //the rest of your stuff here.
}
Reply
#5

But wouldnt that be the cuase of the problem? if its not there after player death or on player spawn.... (in the code)
Reply
#6

Ok, well for a revision of my first post for those who do not undertand, When class selection is shown after a player spawns from a death, their skin changes to CJ... But on the second death the class selection does not popup, and does not change the players skin to CJ. Now i want to know how to make it so that when a player spawns no class selection is shown/available.
Reply
#7

Just leave it blank like this for now, test it. Then, starting adding code blocks, if it keeps happening, then something in your "OnPlayerSpawn" is the problem.

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)