[ajuda] Ir para o hospital apуs a morte
#1

Acontece que no gamemode que estou usando, quando o player й morto por outro, ele sempre volta para o o local de onde ele spawnou no dia. Mas o gamemode usa a variavel MedicBill que quando й = 1 manda o player para o hospital. Dai eu coloco no OnPlayerDeath para setar MedicBill para 1, mas nгo adianta.

Aqui tem a public SetPlayerSpawn
pawn Код:
public SetPlayerSpawn(playerid)
{
    new string[128];
    if(IsPlayerConnected(playerid))
    {
        if(!IsPlayerNPC(playerid))
        {
            if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0)
            {
                if(PlayerInfo[playerid][pAdminDuty] == 1) return 1;
                if(FirstSpawn[playerid] != 1)
                {
                    SetRealMoney(playerid, ScriptMoney[playerid]);
                    PlayerInfo[playerid][pDeaths] += 1;
                    SetPlayerHealth(playerid, 50.0);
                    SafeSetPlayerInterior(playerid, 3);
                    SafeSetPlayerPos(playerid, 348.8042,162.5563,1014.6947); // Warp the player
                    SetPlayerFacingAngle(playerid, 0);
                    TogglePlayerControllable(playerid, 0);
                    GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~You need to rest now ...", 5000, 3);
                    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                    if(PlayerInfo[playerid][pVIP] == 1)
                    {
                        SetTimerEx("ReleaseFromHospital", 20000, 0, "i", playerid);
                    }
                    else if(PlayerInfo[playerid][pVIP] == 2)
                    {
                        SetTimerEx("ReleaseFromHospital", 17500, 0, "i", playerid);
                    }
                    else if(PlayerInfo[playerid][pVIP] == 3)
                    {
                        SetTimerEx("ReleaseFromHospital", 15000, 0, "i", playerid);
                    }
                    else if(PlayerInfo[playerid][pAdmin] >= 1)
                    {
                        SetTimerEx("ReleaseFromHospital", 12500, 0, "i", playerid);
                    }
                    else if(PlayerInfo[playerid][pAdmin] >= 4)
                    {
                        SetTimerEx("ReleaseFromHospital", 10000, 0, "i", playerid);
                    }
                    else
                    {
                        SetTimerEx("ReleaseFromHospital", 25000, 0, "i", playerid);
                    }
                    PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
                    return 1;
                }
            }
E a public OnPlayerDeact

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[killerid][pKills] += 1;
    PlayerInfo[playerid][pDeaths] += 1;
    MedicBill[playerid] = 1;
    new string[128];
    new name[MAX_PLAYER_NAME];
    new name2[MAX_PLAYER_NAME];
    new deathreason[20];
    new y, m, d;
    new h,mi,s;
    getdate(y,m,d);
    gettime(h,mi,s);
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(killerid, name2, sizeof(name2));
    new playercash;
    new victimteam = gTeam[playerid];
    new Float:px,Float:py,Float:pz;
    new killerteam = gTeam[killerid];
    ScriptMoneyUpdated[playerid] = 1;
    TextDrawHideForPlayer(playerid, Textdraw39[playerid]);
    TextDrawHideForPlayer(playerid, Textdraw40[playerid]);
    gPlayerSpawned[playerid] = 0;
Ambas nгo coloquei atй o fim pois talvez nгo seja necessбrio, se for necessбrio me digam.
E antes de tudo Muito Obrigado a quem ler e que pelo menos tenha passado na cabeзa a vontade de ajudar.
Obrigado mesmo.
Reply


Messages In This Thread
[ajuda] Ir para o hospital apуs a morte - by Liba.Nakajima - 10.10.2011, 23:11
Re: Ir para o hospital apуs a morte - by Dolby - 10.10.2011, 23:19
Re: Ir para o hospital apуs a morte - by Liba.Nakajima - 10.10.2011, 23:27
Re: Ir para o hospital apуs a morte - by ceesar90 - 11.10.2011, 00:21
Re: Ir para o hospital apуs a morte - by Liba.Nakajima - 11.10.2011, 00:30
Re: [ajuda] Ir para o hospital apуs a morte - by Liba.Nakajima - 11.10.2011, 13:50

Forum Jump:


Users browsing this thread: 1 Guest(s)