Мартин
Компетентный
Всем привет. После первой смерти после захода на сервер вызывает OnPlayerRequestClass и нужно нажать кнопку "Spawn" для вызова OnPlayerSpawn, при следующих смертях не вызывается, а сразу вызывается OnPlayerSpawn. В чем может быть проблема?
OnPlayerSpawn:
PHP:
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return 1;
PlayerPlaySound(playerid, 0, 0.0, 0.0, 0.0);
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
return 1;
}
PHP:
public OnPlayerSpawn(playerid)
{
SetPlayerTeam(playerid, 1);
if(!Pl::Info[playerid][pReg])
{
Pl::setCamPos(playerid, Pl::Info[playerid][pCamPos], playerid+99);
}
else if(!Pl::isLogged(playerid))
{
Send(playerid, COLOR_LIGHTRED, "* Извините, но этот сервере требует залогинится перед тем как войти в игру. (Kicked) **");
Kick(playerid);
}
else
{
SetPlayerSkin(playerid, Pl::Info[playerid][pChar]);
if(SuspectKill[playerid])
{
SuspectKill[playerid] = false;
Jailed(playerid, Pl::Info[playerid][pJailTime], Pl::Info[playerid][pJailed]);
SetCameraBehindPlayer(playerid);
}
else if(Pl::Info[playerid][pJailed] > 0)
{
if(Pl::Info[playerid][pJailed] != 2) Jailed(playerid, Pl::Info[playerid][pJailTime]);
else Jailed(playerid, Pl::Info[playerid][pJailTime], Pl::Info[playerid][pJailed]);
Send(playerid, COLOR_LIGHTRED, "* Вы не отсидели свой тюремный срок и были возвращены обратно.");
SetCameraBehindPlayer(playerid);
}
else
{
SelectSpawn(playerid);
Pl::setCamPos(playerid, Pl::Info[playerid][pCamPos], playerid+99);
Send(playerid, -1, "OnPlayerSpawn");
}
if(MedicBill[playerid] && !Pl::Info[playerid][pJailed] && !SuspectKill[playerid])
{
MedicBill[playerid] = false;
Pl::Info[playerid][pDeaths]++;
new cut = Pl::Info[playerid][pLevel]*deathcost;
GiveFracMoney(4, cut);
Rac::GivePlayerMoney(playerid, -cut);
format(temp, sizeof(temp), "*Доктор: я взял с Вас $%i за лечение, хорошего дня!", cut);
Send(playerid, COLOR_CYAN, temp);
}
Pl::SetFracColor(playerid);
SetPlayerWeapons(playerid);
PlayerFixRadio(playerid);
SetPlayerFightingStyle(playerid, Pl::Info[playerid][pFightstyle]);
}
SetPlayerSkillLevel(playerid, 0, 0);
SetPlayerSkillLevel(playerid, 6, 0);
SetPlayerSkillLevel(playerid, 5, 0);
SetPlayerSkillLevel(playerid, 4, 0);
SetPlayerScore(playerid, Pl::Info[playerid][pLevel]);
Pt::Show(playerid, Pt::HealthInfo[playerid]);
Pt::Show(playerid, Pt::ArmourInfo[playerid]);
if(Pl::Info[playerid][pVip] > 0) { Rac::SetPlayerHealth(playerid, 100.0); }
else { Rac::SetPlayerHealth(playerid, 50.0+Pl::Info[playerid][pSHealth]); }
return 1;
}
Последнее редактирование:
