Death Bug, r+
#4

Oh, sorry, here:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    switch(PlayerInfo[playerid][pSpawn])
    {
        case 0: //DEFAULT SPAWN
        {
            new RandSpawn = random(sizeof(gRandomSpawns));
            SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], gRandomSpawns[RandSpawn][0], gRandomSpawns[RandSpawn][1], gRandomSpawns[RandSpawn][2], gRandomSpawns[RandSpawn][3], 0, 0, 0, 0, 0, 0);
        }
        case 1: //HOUSE SPAWN,
        {
            if(PlayerInfo[playerid][pHouse] > -1 && !strcmp(HouseInfo[PlayerInfo[playerid][pHouse]][hOwner], GetName(playerid)))
            {
                SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], HouseInfo[PlayerInfo[playerid][pHouse]][hExitx], HouseInfo[PlayerInfo[playerid][pHouse]][hExity], HouseInfo[PlayerInfo[playerid][pHouse]][hExitz], HouseInfo[PlayerInfo[playerid][pHouse]][hExita], 0, 0, 0, 0, 0, 0);
            }
            else // IF HOUSE SPAWN ENABLED BUT PLAYER HAS NO HOUSE
            {
                PlayerInfo[playerid][pSpawn] = 0;
                new RandSpawn = random(sizeof(gRandomSpawns));
                SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], gRandomSpawns[RandSpawn][0], gRandomSpawns[RandSpawn][1], gRandomSpawns[RandSpawn][2], gRandomSpawns[RandSpawn][3], 0, 0, 0, 0, 0, 0);
            }
        }
        //case 2: //
    }

    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    switch(PlayerInfo[playerid][pSpawn])
    {
        case 1:
        {
            if(PlayerInfo[playerid][pHouse] > -1 && !strcmp(HouseInfo[PlayerInfo[playerid][pHouse]][hOwner], GetName(playerid)))
            {
                SetPlayerInterior(playerid, HouseInfo[PlayerInfo[playerid][pHouse]][hInterior]);
                SetPlayerVirtualWorld(playerid, HouseInfo[PlayerInfo[playerid][pHouse]][hVirtualWorld]);
                InsideHouse[playerid] = PlayerInfo[playerid][pHouse];
            }
        }
    }
   
    SetPlayerColor(playerid, 0xFFFFFFFF);
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    SetCameraBehindPlayer(playerid);
   
    if(LoggedIn[playerid] == 0)
    {
        SendClientMessage(playerid, -1, "Spawn is not allowed before you log in.");
        Kick(playerid);
    }
    if(GetPlayerMoney(playerid)!=SafeGetPlayerMoney(playerid))
    {
        ResetPlayerMoney(playerid);
        GivePlayerMoney(playerid, SafeGetPlayerMoney(playerid));
    }
    return 1;
}
Reply


Messages In This Thread
Death Bug - by erminpr0 - 13.01.2015, 17:20
Re: Death Bug, r+ - by acade - 13.01.2015, 18:41
Re: Death Bug, r+ - by CalvinC - 13.01.2015, 19:02
Re: Death Bug, r+ - by erminpr0 - 13.01.2015, 19:25
Re: Death Bug, r+ - by erminpr0 - 13.01.2015, 21:37
Re: Death Bug, r+ - by CalvinC - 14.01.2015, 05:45
Re: Death Bug, r+ - by erminpr0 - 14.01.2015, 11:07

Forum Jump:


Users browsing this thread: 2 Guest(s)