PlayerInfo[playerid][PlayerHospital]
PlayerInfo[playerid][PlayerHospital] = GetPlayerHospital(playerid);
public OnPlayerSpawn(playerid){
SetPlayerHealth(playerid, 99.0);
DarArmasProf(playerid);
if(PlayerPolicial[playerid][Fardado] == 1) return SetPlayerSkin(playerid, PlayerPolicial[playerid][SkinFardada]);
else SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
if(PlayerPolicial[playerid][ProcuradoMorreu] == true)
{
PlayerPolicial[playerid][ProcuradoMorreu] = false;
MostrarTextoPreso(playerid);
Prender(playerid, PlayerInfo[playerid][SegundosPreso]);
}
if(PlayerInfo[playerid][EstaPreso] == 1)
{
MostrarTextoPreso(playerid);
Prender(playerid, PlayerInfo[playerid][SegundosPreso]);
}
//---------------------------------------------------------------------------------------------------------------------------------//
if(PlayerInfo[playerid][PlayerHospital] == 0)
{
SetPlayerPos(playerid, 1173.1145,-1323.7125,15.3962);
SetPlayerFacingAngle(playerid, 268.1490);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][PlayerHospital] = -1;
MensagemAposMorrer(playerid);
}
else if(PlayerInfo[playerid][PlayerHospital] == 1)
{
SetPlayerPos(playerid, 2036.5521,-1412.5513,16.9922);
SetPlayerFacingAngle(playerid, 135.5749);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][PlayerHospital] = -1;
MensagemAposMorrer(playerid);
}
else if(PlayerInfo[playerid][PlayerHospital] == 2)
{
SetPlayerPos(playerid, 1607.4396,1819.1462,10.8280);
SetPlayerFacingAngle(playerid, 359.6572);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][PlayerHospital] = -1;
MensagemAposMorrer(playerid);
}
else if(PlayerInfo[playerid][PlayerHospital] == 3)
{
SetPlayerPos(playerid, -2665.0503,636.5155,14.4531);
SetPlayerFacingAngle(playerid, 177.0288);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][PlayerHospital] = -1;
MensagemAposMorrer(playerid);
}
else if(PlayerInfo[playerid][PlayerHospital] == 4)
{
SetPlayerPos(playerid, -315.0838,1050.7095,20.3403);
SetPlayerFacingAngle(playerid, 359.3905);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][PlayerHospital] = -1;
MensagemAposMorrer(playerid);
}
else if(PlayerInfo[playerid][PlayerHospital] == 5)
{
SetPlayerPos(playerid, -1514.6455,2523.4263,55.8138);
SetPlayerFacingAngle(playerid, 359.6804);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][PlayerHospital] = -1;
MensagemAposMorrer(playerid);
}
else if(PlayerInfo[playerid][PlayerHospital] == 6)
{
SetPlayerPos(playerid, -2208.2485,-2286.8516,30.6250);
SetPlayerFacingAngle(playerid, 319.4752);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][PlayerHospital] = -1;
MensagemAposMorrer(playerid);
}
else if(PlayerInfo[playerid][PlayerHospital] == 7) // Favela
{
new rand = random(sizeof(FavelaSpawns));
SetPlayerPos(playerid, FavelaSpawns[rand][0], FavelaSpawns[rand][1], FavelaSpawns[rand][2]);
SetPlayerFacingAngle(playerid, FavelaSpawns[rand][3]);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][PlayerHospital] = -1;
}
if(EspiandoPID[playerid] != INVALID_PLAYER_ID)
{
if(EspiandoPID[playerid] != INVALID_PLAYER_ID) EspiandoPID[playerid] = INVALID_PLAYER_ID;
TogglePlayerControllable(playerid, true);
return 1;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(Player[playerid][PlayerHospital] == 1)
{
ClearAnimations(playerid);
SetSpawnInfo(playerid, 0, Player[playerid][Skin], 1173.1145, -1323.7125, 15.3962, 270.0000, 0, 0, 0, 0, 0, 0);
PlayerInfo[playerid][PlayerHospital] = -1;
SetCameraBehindPlayer(playerid);
MensagemAposMorrer(playerid);
}
else if(Player[playerid][PlayerHospital] == 2)
{
ClearAnimations(playerid);
// ...
}
return 1;
}
Tem como postar a funзгo GetPlayerHospital(playerid)? Й essencial para fazer debug e descobrir o motivo de continuar em -1.
|
public OnPlayerDeath(playerid, killerid, reason){
if(playerid != killerid) SendDeathMessage(killerid, playerid, reason);
//-------------------------------------------------------------------------------------------------------------------------------------//
if(killerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[killerid][Prof] == PROF_ASSASINO || PlayerInfo[killerid][Prof] == PROF_CHEFAO_DA_MAFIA && !IsPlayerInFavela(killerid) && ArmaIlegalID[killerid] == -1)
{
if(PlayerInfo[playerid][Contratado] > 0)
{
PlayerInfo[playerid][PlayerHospital] = GetPlayerHospital(playerid);
PlayerInfo[playerid][Contratado] --;
PlayerInfo[killerid][EstrelasProcurado] ++;
sGivePlayerCash(killerid, 700);
MensagemFormatadaAll(0xE71434FF, "| DM | {FF8080}%s {E71434}matou {FF8080}%s {E71434}| Estrelas: {FFFF80}%d {E71434}Estrelas!", PlayerName(killerid), PlayerName(playerid), PlayerInfo[killerid][EstrelasProcurado]);
}
else
{
PlayerInfo[killerid][EstrelasProcurado] += 2;
PlayerInfo[playerid][PlayerHospital] = GetPlayerHospital(playerid);
MensagemFormatadaAll(-1, "| DM | Jogador(a) %s matou %s que nгo estava em Contrato e ganhou 2 Estrelas! | %d Estrelas", PlayerName(killerid), PlayerName(playerid), PlayerInfo[killerid][EstrelasProcurado]);
}
return 1;
}
else
{
if(IsPlayerInFavela(playerid)) PlayerInfo[playerid][PlayerHospital] = 7;
//Prender Procurado
if(IsPlayerPolicial(killerid) && PlayerPolicial[killerid][Fardado] == 1)
{
MensagemFormatadaAll(0xFFFFFFAA, "| DEPARTAMENTO | O(A) policial {FFFF80}%s{FFFFFF} matou e prendeu {FFFF80}%s {FFFFFF}que estava sendo procurado(a)!", PlayerName(killerid), PlayerName(playerid));
PlayerPolicial[playerid][ProcuradoMorreu] = true;
//SalvarDadosMySQL(killerid, 5); // Prisхes - RANK
Prender(playerid, 120 * PlayerInfo[playerid][EstrelasProcurado]);
}
if(!IsPlayerInFavela(killerid))/* && !IsPlayerInGangzone(killerid) && ArenaDuelo[killerid] == false && EntrouArenaID[killerid] == -1) */
{
if(ArmaIlegalID[killerid] != -1)
{
if(GetPlayerWeapon(killerid) == ArmaIlegalID[killerid])
{
PlayerInfo[playerid][PlayerHospital] = GetPlayerHospital(playerid);
PlayerInfo[killerid][EstrelasProcurado] ++;
MensagemFormatadaAll(-1, "| DM | {FF8000}%s [ %d ]{FFFFFF} com uma {DA1523}%s Ilegal {FFFFFF}acaba de matar {FF8000}%s[%d] | Quantidade de Estrelas: %d", PlayerName(killerid), killerid, GetWeaponNameByID(ArmaIlegalID[killerid]), PlayerName(playerid), playerid, PlayerInfo[killerid][EstrelasProcurado]);
}
}
}
else
{
if(IsPlayerInFavela(killerid))
{
PlayerInfo[killerid][pMatou] ++;
}
else if(IsPlayerInFavela(playerid))
{
PlayerInfo[playerid][pMorreu] ++;
}
else if(IsPlayerInFavela(killerid) && !IsPlayerInFavela(playerid))
{
PlayerInfo[playerid][PlayerHospital] = GetPlayerHospital(playerid);
return 1;
}
PlayerInfo[playerid][PlayerHospital] = GetPlayerHospital(playerid); // Essa linha que nгo retorna
}
}
}
return 1;
}
PlayerInfo[playerid][PlayerHospital] = GetPlayerHospital(playerid);
if(killerid != INVALID_PLAYER_ID) |