Problem with spawn
#1

I have problem with spawn for players. When player die or spectate it's give him to choose skin again and every time when he die it need to select skin. How to fix that?
Reply
#2

Check under public OnPlayerDeath if there is something called ForceClassSelection(playerid); remove it...and make sure u dont press F4 before dying...it ll take u to class selection

Good Luck
Reply
#3

Check under public OnPlayerDeath if there is something called ForceClassSelection(playerid); remove it...and make sure u dont press F4 before dying...it ll take u to class selection

Good Luck
Reply
#4

I check but dont have this and i'm sure i dont press F4.. This is my code :

Код:
//==============================================================================
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPVarInt(playerid, "Headshotted") == 1)
    {
        SetPVarInt(playerid, "Headshotted", 0);
        GameTextForPlayer(playerid, "~r~Headshotted", 3000, 3);
        GameTextForPlayer(killerid, "~r~Headshottttt", 3000, 3);
    }
    
            #pragma unused reason
        if(killerid != INVALID_PLAYER_ID)
        {
                SetPlayerScore (killerid, GetPlayerScore (killerid) + 1);
                SetPlayerStarRang(playerid);
        }

     joined[playerid] = 0;
                        leavefunction(playerid);

                        new szString[128];
                    kills2[killerid]++;
                    format(szString,sizeof(szString),"Kills :%d",kills2[killerid]);
                    TextDrawSetString(Kill_Streak[killerid],szString);

                        SetPlayerScore(killerid,GetPlayerScore(killerid) +1);
                        SetPlayerScore(playerid,0);
                        if(GetPlayerScore(killerid) == 2)
                        {
                                SetPlayerHealth(killerid,100);
                                SetPlayerArmour(killerid,100);
                                GivePlayerWeapon(killerid, 23, 500);
                                GameTextForPlayer(killerid, "~r~LEVEL UP", 3500, 5);
                                SetPlayerArmedWeapon(playerid, 23);
                                return 1;
                        }
                        if(GetPlayerScore(killerid) == 3)
                        {
                                SetPlayerHealth(killerid,150);
                            SetPlayerArmour(killerid,150);
                            GivePlayerWeapon(killerid,24,200);
                                GameTextForPlayer(killerid, "~r~LEVEL UP", 3500, 5);
                            return 1;
                        }
                        if(GetPlayerScore(killerid) == 4)
                        {
                            SetPlayerHealth(killerid,150);
                            SetPlayerArmour(killerid,150);
                            GivePlayerWeapon(killerid, 27, 500);
                                GameTextForPlayer(killerid, "~r~LEVEL UP", 3500, 5);
                            return 1;
                        }
                        if(GetPlayerScore(killerid) == 5)
                        {
                                SetPlayerHealth(killerid,150);
                            SetPlayerArmour(killerid,150);
                                GivePlayerWeapon(killerid,28,500);
                                GameTextForPlayer(killerid, "~r~LEVEL UP", 3500, 5);
                                SetPlayerArmedWeapon(playerid, 28);
                                return 1;
                        }
                        if(GetPlayerScore(killerid) == 6)
                        {
                                GivePlayerWeapon(killerid, 32, 500);
                                SetPlayerHealth(killerid, 100);
                                SetPlayerArmour(killerid, 100);
                                GameTextForPlayer(killerid, "~r~LEVEL UP", 3500, 5);
                                SetPlayerArmedWeapon(playerid, 32);
                            return 1;
                        }
    new string[256];
    new Float: X, Float: Y, Float: Z;
	GivePlayerCash(playerid, -2000);
	HitID[playerid] = killerid;
    PlayerInfo[playerid][pDeaths] += 1;
	Kills[playerid] = 0;
	GetPlayerPos(playerid, X, Y, Z);
	PlayerKilled[playerid] = 1;
	SendDeathMessage(killerid, playerid, reason);
	if(Bounty[playerid] > 0)
	{
        Bounty[playerid] = 0;
        format(string, sizeof(string), "Този играч има награда за главата си: %d$", Bounty[playerid]);
	    SendClientMessage(killerid, COLOR_YELLOW2, string);
	    GivePlayerCash(killerid, Bounty[playerid]);
	}

	Kills[killerid]++;
	
	if(killerid != 255)
	{
	    if(PlayerInfo[killerid][pMember] != TEAM_SPECIALFORCE)
	    {
			if(GetPlayerState(killerid) == 2)
			{
			    new kickname[MAX_PLAYER_NAME];
				GetPlayerName(killerid, kickname, sizeof(kickname));
				format(string, 256, "BGW SERVER: %s[%d]уби %s[%d] със Drive-By и убиеца беше SLAY-ed." ,kickname,killerid,PlayerName(playerid),playerid);
				ABroadCast(COLOR_YELLOW, string, 1);
				SetPlayerHealth(killerid,0);
				return 1;
			}
		}
	}
    if(reason == 50)
	{
		new kickname[MAX_PLAYER_NAME];
		if(IsPlayerConnected(killerid))
		{
			BladeKill[killerid] += 1;
			if(BladeKill[killerid] >= 1)
			{
			    GetPlayerName(killerid, kickname, sizeof(kickname));
			    format(string, 256, "BGW SERVER: %s was kicked, reason: Excesive Blade Killing." ,kickname);
			    SendClientMessageToAll(COLOR_LIGHTRED, string);
			    SetPlayerHealth(killerid,0);
			}
		}
	}
	PlayerInfo[killerid][pKills] += 1;
	SetPlayerScore(killerid, PlayerInfo[killerid][pKills]);
	Kills[killerid]++;
	if(Kills[killerid] > 3) Bounty[killerid] += 1000 * Kills[killerid];
	new bonus = 500 * Kills[killerid];
	GivePlayerCash(killerid, bonus);
	if(Kills[killerid] == 3) format(string,sizeof(string),"~W~%s IS DOMINATING!", PlayerName(killerid));
    if(Kills[killerid] == 10) format(string,sizeof(string),"~W~%s IS ON A KILLING SPREE!", PlayerName(killerid));
    if(Kills[killerid] == 15) format(string,sizeof(string),"~W~%s HAS A MONSTER KILL!!!", PlayerName(killerid));
    if(Kills[killerid] == 21) format(string,sizeof(string),"~W~%s IS ~r~GODLIKE!", PlayerName(killerid));
    if(Kills[killerid] == 27) format(string,sizeof(string),"~W~%s IS ~R~WICKED SICK!", PlayerName(killerid));
    if(Kills[killerid] >= 40) format(string,sizeof(string),"~R~%s HOLY SHIT WITH %d KILLS!",PlayerName(killerid), Kills[killerid]);
    GameTextForAll(string, 5000, 4);
	SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid));
	if(Kills[killerid] > PlayerInfo[killerid][pSpree]) PlayerInfo[killerid][pSpree] = Kills[killerid];
    if (gTeam[killerid] != gTeam[playerid])
	{
	    new Float:x, Float:y, Float:z;
        TeamInfo[gTeam[killerid]][RivalsKilled]++;
        TeamInfo[gTeam[playerid]][HomiesDied]++;
        TeamInfo[gTeam[killerid]][TeamScore]++;
        TeamInfo[gTeam[playerid]][TeamScore]--;
		GetPlayerPos(playerid, x, y, z);
		GetPlayerPos(killerid, x, y, z);
	    for (new i = 0; i < MAX_TURFS; i++)
	    {
	        if (IsPlayerInTurf(playerid, turfs[i][zMinX], turfs[i][zMinY], turfs[i][zMaxX], turfs[i][zMaxY]) &&
			IsPlayerInTurf(killerid, turfs[i][zMinX], turfs[i][zMinY], turfs[i][zMaxX], turfs[i][zMaxY])  )
	        {
                if (turfs[i][TurfWarStarted] != 1 && !IsPlayerInAnyVehicle(killerid))
                {
                    TurfInfo[i][gTeam[killerid]][TurfKills]++;
                    if (TurfInfo[i][gTeam[killerid]][TurfKills] == ATTACK_KILLS)
                    {
                        if (turfs[i][TurfOwner] == gTeam[killerid])
						{
                            for (new a = 0; a < MAX_TEAMS; a++) TurfInfo[i][a][TurfKills] = 0;
							return 1;
                        }
                        turfs[ i ][ TurfAttacker ] = gTeam[killerid];
                        for (new b = 0; b < 500; b++)
	                    {
                            if (gTeam[b] == turfs[i][TurfAttacker])
							{
                                new msg1[256];
	                            format(msg1,sizeof(msg1), "~w~We have provoked a turfwar ~w~in ~y~%s ( %s ) ~w~against the ~r~%s",
								turfs[i][turfName], turfs[i][cityName], TeamInfo[turfs[i][TurfOwner]][TeamName]);
                                new Text:txt1 = TextDrawCreate(139.0, 350.0, msg1 );
                                TextDrawFont(txt1, 1);
                                TextDrawLetterSize(txt1, 0.29, 1.0);
                                TextDrawSetShadow(txt1, 0);
                                TextDrawSetOutline(txt1, 1);
                                TextDrawColor(txt1, COLOR_WHITE);
                                TimeTextForPlayer(b, txt1, 6000);
                                GangZoneFlashForPlayer(b, turfs[i][turfID], COLOR_FLASH );
                            }
                            else if (gTeam[b] == turfs[ i ][ TurfOwner ])
							{
                                new msg2[256];
	                            format(msg2,sizeof(msg2), "~r~The ~y~%s ~r~have attacked our turf in ~y~%s ( %s )!",
                                TeamInfo[turfs[i][TurfAttacker]][TeamName], turfs[i][turfName], turfs[i][cityName]);
                                new Text:txt2 = TextDrawCreate(139.0, 364.0, msg2);
                                TextDrawFont(txt2, 1);
                                TextDrawLetterSize(txt2, 0.29, 1.0);
                                TextDrawSetShadow(txt2, 0);
                                TextDrawSetOutline(txt2, 1);
                                TextDrawColor(txt2, COLOR_RED);
                                TimeTextForPlayer(b, txt2, 6000);
                                GangZoneFlashForPlayer(b, turfs[i][turfID], COLOR_FLASH);
                            }
                            else GangZoneFlashForPlayer(b, turfs[i][turfID], COLOR_FLASH2);
	                    }
	                    SetTimerEx("EndWar", ATTACK_TIME, false ,"iii", i, turfs[i][TurfAttacker], turfs[i][TurfOwner] );
	                    turfs[i][TurfWarStarted] = 1;
	                    for(new c = 0; c < MAX_TEAMS; c++) { TurfInfo[i][c][TurfKills] = 0; TurfInfo[i][c][TurfAttackKills] = 0; }
                        return 1;
                    }
                }
                else if (turfs[i][TurfWarStarted] == 1 && !IsPlayerInAnyVehicle(killerid) &&
                (turfs[i][TurfAttacker] == gTeam[killerid]) || turfs[i][TurfOwner] == gTeam[killerid])
                {
                    TurfInfo[i][gTeam[killerid]][TurfAttackKills]++;
                    return 1;
                }
	        }
	    }
	}
	if(PlayerInfo[killerid][pAdmin] < 1)
	{
	    for (new weap = 1; weap < 2; weap++)
        {
            if(GetPlayerWeapon(killerid) == weap && HaveWeapon(killerid, weap) != weap)
            {
                new weapname[32];
                GetWeaponName(weap, weapname, sizeof(weapname));
                format(string, sizeof(string), "BGW SERVER: %s was banned, reason: Weapon Hacking (%s).", PlayerName(killerid), weapname);
			    SendClientMessageToAll(COLOR_LIGHTRED, string);
			    PlayerInfo[killerid][pBanned] = 1;
			    format(string, sizeof(string), "Weapon Hacking (%s).", weapname);
			    BanEx(killerid, string);
            }
        }
	}
	return 1;
}
Reply
#5

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

I added but still have the problem..
Reply
#7

Yes they select skin without problem nothing weird.
Reply
#8

Come on please help me..
Reply
#9

Please help me to fix this problem..
Reply
#10

You have to save the skin in you register system and then get it with a stock such as "getskin(playerid)" that you have to put in OnPlayerSpawn
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)