SA-MP Forums Archive
Help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help. (/showthread.php?tid=338444)



Help. - Ohioboii614 - 29.04.2012

Everytime someone dies in my server they get bugged to LV and it says "stay within the world boundaries" and they got to relog.


Re: Help. - FalconX - 29.04.2012

Quote:
Originally Posted by Ohioboii614
Посмотреть сообщение
Everytime someone dies in my server they get bugged to LV and it says "stay within the world boundaries" and they got to relog.
Well you must show your OnPlayerSpawn and OnPlayerDeath code, we might help you with it.

-FalconX


Re: Help. - Ohioboii614 - 29.04.2012

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        Wounded[playerid] = 1;
        SetPlayerPos(playerid, 0);
        SetPlayerInterior(playerid, 0);
        SendClientMessage(playerid, 0xFFFFFFFF, "The hospital has treated your wound, the medical bill has been taken out your account");
        SendClientMessage(playerid, 0xFFFFFFFF, "Medical Bill: -$50");
        GivePlayerMoney(playerid, -50);
    }
    SetPlayerColor(playerid,COLOR_CIVILIAN);
    SetPlayerDrunkLevel(playerid, 0);
    WantedPoints[playerid] = 0;
    InShamal[playerid] = 0;
    InAndrom[playerid] = 0;
    CopOnDuty[playerid] = 0;
    PlayerCuffed[playerid] = 0;
    TruckDelivering[playerid] = 0;
    PlayerTazed[playerid] = 0;
    PlayerTied[playerid] = 0;
    IsUsingAnim[playerid] = 0;
    SwatOnDuty[playerid] = 0;
    PlayerTazed[playerid] = 0;
    MedicOnDuty[playerid] = 0;
    IsSmoking[playerid] = 0;
    Seatbelt[playerid] = 0;
    GuardOnDuty[playerid] = 0;
    if(FarmerVar[playerid] != 0) { FarmerVar[playerid] = 0; DisablePlayerCheckpoint(playerid); }
    if(TruckDelivering[playerid] != 0) { TruckDelivering[playerid] = 0; DisablePlayerCheckpoint(playerid); }
    if(gPlayerUsingLoopingAnim[playerid]) { gPlayerUsingLoopingAnim[playerid] = 0; }
    if(AdminDuty[playerid] == 1) { PlayerInfo[playerid][pHospital] = 0; }
    if(PlayerInfo[playerid][pJailed] > 0)
    {
        if(PlayerInfo[playerid][pJailed] == 1)
        {
            SetPlayerVirtualWorld(playerid,2);
            SetPlayerInterior(playerid,6);
            SetPlayerPos(playerid,264.5743,77.5118,1001.0391);
            SetPlayerHealth(playerid,100);
        }
        else if(PlayerInfo[playerid][pJailed] == 2)
        {
            SetPlayerVirtualWorld(playerid,10);
            SetPlayerInterior(playerid,3);
            SetPlayerPos(playerid,198.3940,162.0881,1003.0300);
        }
        else if(PlayerInfo[playerid][pJailed] == 3)
        {
            SetPlayerVirtualWorld(playerid,2);
            SetPlayerInterior(playerid,10);
            SetPlayerPos(playerid,219.4495,110.0645,999.0156);
        }
        else if(PlayerInfo[playerid][pJailed] == 4)
        {
            SetPlayerVirtualWorld(playerid,0);
            SetPlayerInterior(playerid,0);
            new AjailRand = random(4);
            if(AjailRand == 0)
            {
                SetPlayerPos(playerid, 1040.6840,1017.3040,55.3047);
            }
            if(AjailRand == 1)
            {
                SetPlayerPos(playerid, 1048.6038,1016.7516,55.3047);
            }
            if(AjailRand == 2)
            {
                SetPlayerPos(playerid, 1048.0579,1007.3638,55.3047);
            }
            if(AjailRand == 3)
            {
                SetPlayerPos(playerid, 1040.3180,1007.6415,55.3047);
            }
            SetPlayerVirtualWorld(playerid,0);
        }
    }
    if(PlayerInfo[playerid][pHeadValue] > 0)
    {
        if(IsPlayerConnected(killerid))
        {
            if(PlayerInfo[killerid][pFaction] == HITMAN)
            {
                if(GoChase[killerid] == playerid)
                {
                    new hitname[MAX_PLAYER_NAME];
                    new killer[MAX_PLAYER_NAME];
                    new string[128];
                    GetPlayerName(killerid, killer, sizeof(killer));
                    GivePlayerCash(killerid, PlayerInfo[playerid][pHeadValue]);
                    format(string,sizeof(string),"** %s has fulfilled the contract on %s and collected $%d",killer,hitname,PlayerInfo[playerid][pHeadValue]);
                    SendFactionMessage(9, COLOR_WHITE, string);
                    PlayerInfo[playerid][pHeadValue] = 0;
                    GotHit[playerid] = 0;
                    GetChased[playerid] = 999;
                    GoChase[killerid] = 999;
                }
            }
        }
    }
    if(AdminDuty[playerid] == 1){ Wounded[playerid] = 0; }
    if(Planted[playerid] == 1)
    {
        DestroyObject(C4[playerid]);
        Bomb[playerid] = 0;
        Planted[playerid] = 0;
    }
    return 1;
}
OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid,0);
    SetPlayerPos(playerid,1742.8767,-1863.5521,13.5749);
    if(PlayerInfo[playerid][pTut] == 0)
    {
        PlayerInfo[playerid][pLevel] = 1;
        PlayerInfo[playerid][pBank] = 500;
        PlayerInfo[playerid][pFight] = 0;
        PlayerInfo[playerid][pTalk] = 0;
        PlayerInfo[playerid][pBan] = 0;
        Wounded[playerid] = 0;
        IsUsingAnim[playerid] = 0;
        SetPlayerCash(playerid,PlayerInfo[playerid][pCash]);
        TogglePlayerControllable(playerid, 0);
        TutorialStage[playerid] = 1;
    }
    if(!gPlayerAnimLibsPreloaded[playerid])
    {
        PreloadAnimLib(playerid,"BOMBER");
        PreloadAnimLib(playerid,"RAPPING");
        PreloadAnimLib(playerid,"SHOP");
        PreloadAnimLib(playerid,"RIOT");
        PreloadAnimLib(playerid,"BEACH");
        PreloadAnimLib(playerid,"SMOKING");
        PreloadAnimLib(playerid,"FOOD");
        PreloadAnimLib(playerid,"ON_LOOKERS");
        PreloadAnimLib(playerid,"DEALER");
        PreloadAnimLib(playerid,"CRACK");
        PreloadAnimLib(playerid,"BEACH");
        PreloadAnimLib(playerid,"MISC");
        PreloadAnimLib(playerid,"OTB");
        PreloadAnimLib(playerid,"SWEET");
        PreloadAnimLib(playerid,"CARRY");
        PreloadAnimLib(playerid,"COP_AMBIENT");
        PreloadAnimLib(playerid,"PARK");
        PreloadAnimLib(playerid,"INT_HOUSE");
        PreloadAnimLib(playerid,"HEIST9");
        PreloadAnimLib(playerid,"FOOD");
        PreloadAnimLib(playerid,"PED");
        PreloadAnimLib(playerid,"GHANDS");
        PreloadAnimLib(playerid,"FIGHT_D");
        PreloadAnimLib(playerid,"STRIP");
        PreloadAnimLib(playerid,"BLOWJOBZ");
        PreloadAnimLib(playerid,"BSKTBALL");
        PreloadAnimLib(playerid,"BASEBALL");
        PreloadAnimLib(playerid,"GRAVEYARD");
        PreloadAnimLib(playerid,"FAT");
        PreloadAnimLib(playerid,"GANGS");
        PreloadAnimLib(playerid,"COLT45");
        PreloadAnimLib(playerid,"TEC");
        PreloadAnimLib(playerid,"BOX");
        PreloadAnimLib(playerid,"SUNBATHE");
        PreloadAnimLib(playerid,"CAR");
        PreloadAnimLib(playerid,"BD_Fire");
        PreloadAnimLib(playerid,"BIKES");
        gPlayerAnimLibsPreloaded[playerid] = 1;
    }
    if(gPlayerLogged[playerid])
    {
        SetPlayerSpawn(playerid);
        SetPlayerHealth(playerid,100);
    }
    return 1;
}



Re: Help. - Ohioboii614 - 01.05.2012

Anyone ?


Re: Help. - varga - 01.05.2012

SetPlayerPos(playerid,0); is not real and it is useless so delete that and it will work.


Re: Help. - Passout - 01.05.2012

I don't know how to fix that but.... this

Код:
if(PlayerInfo[playerid][pJailed] > 0)
    {
        if(PlayerInfo[playerid][pJailed] == 1)
        {
            SetPlayerVirtualWorld(playerid,2);
            SetPlayerInterior(playerid,6);
            SetPlayerPos(playerid,264.5743,77.5118,1001.0391);
            SetPlayerHealth(playerid,100);
        }
        else if(PlayerInfo[playerid][pJailed] == 2)
        {
            SetPlayerVirtualWorld(playerid,10);
            SetPlayerInterior(playerid,3);
            SetPlayerPos(playerid,198.3940,162.0881,1003.0300);
        }
        else if(PlayerInfo[playerid][pJailed] == 3)
        {
            SetPlayerVirtualWorld(playerid,2);
            SetPlayerInterior(playerid,10);
            SetPlayerPos(playerid,219.4495,110.0645,999.0156);
        }
        else if(PlayerInfo[playerid][pJailed] == 4)
        {
            SetPlayerVirtualWorld(playerid,0);
            SetPlayerInterior(playerid,0);
            new AjailRand = random(4);
            if(AjailRand == 0)
            {
                SetPlayerPos(playerid, 1040.6840,1017.3040,55.3047);
            }
            if(AjailRand == 1)
            {
                SetPlayerPos(playerid, 1048.6038,1016.7516,55.3047);
            }
            if(AjailRand == 2)
            {
                SetPlayerPos(playerid, 1048.0579,1007.3638,55.3047);
            }
            if(AjailRand == 3)
            {
                SetPlayerPos(playerid, 1040.3180,1007.6415,55.3047);
            }
            SetPlayerVirtualWorld(playerid,0);
        }
    }
Should also go into OnPlayerSpawn aswell...


AW: Help. - Ohioboii614 - 01.05.2012

This is my current OnPlayerDeath - Same thing happends :S.. Now you just spawn at ASGS but it asks u to "<< >>" "Spawn" ..

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        SetPlayerPos(playerid, 1183.5145,-1323.8738,13.5768);
        SetPlayerInterior(playerid, 0);
        SendClientMessage(playerid, 0xFFFFFFFF, "The hospital has treated your wound, the medical bill has been taken out your account");
        SendClientMessage(playerid, 0xFFFFFFFF, "Medical Bill: -$1000");
        GivePlayerMoney(playerid, -1000);
    }
    SetPlayerColor(playerid,COLOR_CIVILIAN);
    SetPlayerDrunkLevel(playerid, 0);
    WantedPoints[playerid] = 0;
    InShamal[playerid] = 0;
    InAndrom[playerid] = 0;
    CopOnDuty[playerid] = 0;
    PlayerCuffed[playerid] = 0;
    TruckDelivering[playerid] = 0;
    PlayerTazed[playerid] = 0;
    PlayerTied[playerid] = 0;
    IsUsingAnim[playerid] = 0;
    SwatOnDuty[playerid] = 0;
    PlayerTazed[playerid] = 0;
    MedicOnDuty[playerid] = 0;
    IsSmoking[playerid] = 0;
    Seatbelt[playerid] = 0;
    GuardOnDuty[playerid] = 0;
    if(FarmerVar[playerid] != 0) { FarmerVar[playerid] = 0; DisablePlayerCheckpoint(playerid); }
    if(TruckDelivering[playerid] != 0) { TruckDelivering[playerid] = 0; DisablePlayerCheckpoint(playerid); }
    if(gPlayerUsingLoopingAnim[playerid]) { gPlayerUsingLoopingAnim[playerid] = 0; }
    if(AdminDuty[playerid] == 1) { PlayerInfo[playerid][pHospital] = 0; }
    if(PlayerInfo[playerid][pJailed] > 0)
    {
        if(PlayerInfo[playerid][pJailed] == 1)
        {
            SetPlayerVirtualWorld(playerid,2);
            SetPlayerInterior(playerid,6);
            SetPlayerPos(playerid,264.5743,77.5118,1001.0391);
            SetPlayerHealth(playerid,100);
        }
        else if(PlayerInfo[playerid][pJailed] == 2)
        {
            SetPlayerVirtualWorld(playerid,10);
            SetPlayerInterior(playerid,3);
            SetPlayerPos(playerid,198.3940,162.0881,1003.0300);
        }
        else if(PlayerInfo[playerid][pJailed] == 3)
        {
            SetPlayerVirtualWorld(playerid,2);
            SetPlayerInterior(playerid,10);
            SetPlayerPos(playerid,219.4495,110.0645,999.0156);
        }
        else if(PlayerInfo[playerid][pJailed] == 4)
        {
            SetPlayerVirtualWorld(playerid,0);
            SetPlayerInterior(playerid,0);
            new AjailRand = random(4);
            if(AjailRand == 0)
            {
                SetPlayerPos(playerid, 1040.6840,1017.3040,55.3047);
            }
            if(AjailRand == 1)
            {
                SetPlayerPos(playerid, 1048.6038,1016.7516,55.3047);
            }
            if(AjailRand == 2)
            {
                SetPlayerPos(playerid, 1048.0579,1007.3638,55.3047);
            }
            if(AjailRand == 3)
            {
                SetPlayerPos(playerid, 1040.3180,1007.6415,55.3047);
            }
            SetPlayerVirtualWorld(playerid,0);
        }
    }
    if(PlayerInfo[playerid][pHeadValue] > 0)
    {
        if(IsPlayerConnected(killerid))
        {
            if(PlayerInfo[killerid][pFaction] == HITMAN)
            {
                if(GoChase[killerid] == playerid)
                {
                    new hitname[MAX_PLAYER_NAME];
                    new killer[MAX_PLAYER_NAME];
                    new string[128];
                    GetPlayerName(killerid, killer, sizeof(killer));
                    GivePlayerCash(killerid, PlayerInfo[playerid][pHeadValue]);
                    format(string,sizeof(string),"** %s has fulfilled the contract on %s and collected $%d",killer,hitname,PlayerInfo[playerid][pHeadValue]);
                    SendFactionMessage(9, COLOR_WHITE, string);
                    PlayerInfo[playerid][pHeadValue] = 0;
                    GotHit[playerid] = 0;
                    GetChased[playerid] = 999;
                    GoChase[killerid] = 999;
                }
            }
        }
    }
    if(AdminDuty[playerid] == 1){ Wounded[playerid] = 0; }
    if(Planted[playerid] == 1)
    {
        DestroyObject(C4[playerid]);
        Bomb[playerid] = 0;
        Planted[playerid] = 0;
    }
    return 1;
}



Re: AW: Help. - FalconX - 01.05.2012

Do one thing, just use CTRL+F and find "stay within limits" you will surely find it, when you find post the lines here.

-FalconX


Re: Help. - Ohioboii614 - 01.05.2012

Searched it all - It isn't there .


Re: Help. - FalconX - 01.05.2012

Quote:
Originally Posted by Ohioboii614
Посмотреть сообщение
Searched it all - It isn't there .
What script are you using? And check in includes.