I need help with OnPlayerDeath
#1

I got this

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
   
   
   
    Goto[playerid] = 0;
    InShamal[playerid] = 0;
    OnDuty[playerid] = 0;
    StealBank[playerid] = 999;
    new Random=random(100); // 100%
    if(Goto[playerid] == 0)
    {
        if(Random<=50)
        {
            Account[playerid][pGun0] = 0;
            Account[playerid][pGun1] = 0;
            Account[playerid][pGun2] = 0;
            Account[playerid][pAmmo0] = 0;
            Account[playerid][pAmmo1] = 0;
            Account[playerid][pAmmo2] = 0;
        }
        else { }
    }
    if(IsACop(playerid))
    {
        Account[playerid][pGun0] = 0;
        Account[playerid][pGun1] = 0;
        Account[playerid][pGun2] = 0;
        Account[playerid][pAmmo0] = 0;
        Account[playerid][pAmmo1] = 0;
        Account[playerid][pAmmo2] = 0;
    }
    if(reason == 0 || reason == 1)
    {
        Hospital[playerid]=1;
        NeedMedicTime[playerid] = 14;
    }
    if(reason == 3 || reason == 2 || reason == 53)
    {
        Hospital[playerid]=1;
        NeedMedicTime[playerid] = 18;
    }
    if(reason == 49 || reason == 4 || reason == 5 || reason == 8 || reason == 9 || reason == 41 || reason == 42 || reason == 43 || reason == 44 || reason == 45 || reason == 46)
    {
        Hospital[playerid]=1;
        NeedMedicTime[playerid] = 20;
    }
    if(reason == 10 || reason == 11 || reason == 12 || reason == 13 || reason == 14 || reason == 15)
    {
        Hospital[playerid]=1;
        NeedMedicTime[playerid] = 15;
    }
    if(reason == 23 || reason == 24 || reason == 30 || reason == 32 || reason == 25 || reason == 26 || reason == 28 || reason == 27 || reason == 29 || reason == 31)
    {
        Hospital[playerid]=1;
        NeedMedicTime[playerid] = 30;
    }
    if(reason == 33 || reason == 34 || reason == 35 || reason == 36 || reason == 37 || reason == 38)
    {
        Hospital[playerid]=1;
        NeedMedicTime[playerid] = 36;
    }
    if(reason == 39 || reason == 40 || reason == 16 || reason == 17 || reason == 18)
    {
        Hospital[playerid]=1;
        NeedMedicTime[playerid] = 40;
    }
    if(reason == 19 || reason == 20 || reason == 21 || reason == 22)
    {
        Hospital[playerid]=1;
        NeedMedicTime[playerid] = 44;
    }
    if(reason == 50 || reason == 51 || reason == 54)
    {
        Hospital[playerid]=1;
        NeedMedicTime[playerid] = 46;
    }
    if(DMVTest[playerid] == 1)
    {
        SendClientMessage(playerid,COLOR_LIGHTRED,"You died during a driving test. Therefore, it has been cancelled.");
        DisablePlayerCheckpoint(playerid);
        DMVCP[playerid] = -1;
        DMVTest[playerid] = 0;
        KillTimer(DMVT);
    }
    if(DrivingTestingStart[playerid] == 1)
    {
        DrivingTestingStart[playerid] = 0;
    }
    if(DrivingTestingStartScooter[playerid] == 1)
    {
        DrivingTestingStartScooter[playerid] = 0;
    }
    if(DrivingTestingStart[playerid] == 1)
    {
        DrivingTestingStartBigBike[playerid] = 0;
    }
    new caller = Mobile[playerid];
    if(caller != 255)
    {
        if(caller < 255)
        {
            SendClientMessage(caller,  COLOR_YELLOW2, "The line just went dead....");
            CellTime[caller] = 0;
            CellTime[playerid] = 0;
            Mobile[caller] = 255;
        }
        Mobile[playerid] = 255;
        CellTime[playerid] = 0;
    }
    if (BusrouteEast[playerid][0] != 0 || BusrouteWest[playerid][0] != 0)
    {
        if (BusrouteEast[playerid][0] != 0) BusrouteEnd(playerid, BusrouteEast[playerid][1]);
        else if (BusrouteWest[playerid][0] != 0) BusrouteEnd(playerid, BusrouteWest[playerid][1]);
        else BusrouteEnd(playerid, 0);
    }
    OnPlayerUpdate(playerid);
    if(aduty[playerid]==1)
    {
        SetPlayerColor(playerid,TEAM_ADMIN_COLOR);
        SetPlayerMarkerForPlayer( 42, 1, 0xFFFFFF00 );
    }
    else
    {
        SetPlayerColor(playerid,COLOR_GRAD2);
    }
    return true;
}
and In the SetPlayerSpawn callback, I got this

pawn Код:
if(Hospital[playerid] == 1 && Account[playerid][pJailed] == 0)
        {
            if(FirstSpawn[playerid] != 1)
            {
                /*SetPlayerHealth(playerid, 25.0);
                SetPlayerInterior(playerid, 0);
                Account[playerid][pInt] = 0;
                SendClientMessage(playerid, TEAM_CYAN_COLOR, "Doctor: Hope your feeling better, please be aware next time.");
                TogglePlayerControllable(playerid, true);
                SetPlayerPos(playerid, 1178.1443,-1323.3268,14.1056);
                SetPlayerFacingAngle(playerid, 270.9733);
                SetCameraBehindPlayer(playerid);
                return true;*/

                new rand;
                SetPlayerPos(playerid, 1160.8542,-1330.8306,1499.4673);
                SetPlayerFacingAngle(playerid, 357.6145);
                SetPlayerInterior(playerid, 0);
                Account[playerid][pInt] = 0;
                rand = 1+random(200);
                SetPlayerVirtualWorld(playerid,rand);
                Account[playerid][pVirtualWorld] = rand;
                SetPlayerCameraPos(playerid, 1152.0311,-1325.3153,1498.6328);
                SetPlayerCameraLookAt(playerid,1160.3467,-1332.2661,1498.6328);
                TogglePlayerControllable(playerid, false);
                ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                MedicTime[playerid] = 1;
                //
                TextDrawHideForPlayer(playerid,Textdrawz[playerid]);
                TextDrawSetString(Textdrawz[playerid],"~w~You are resting due ~r~brutally wounds~w~, you will be out when the doctor says so.~n~ The time in, depends on your 'Death Way'");
                //
                TextDrawShowForPlayer(playerid,Textdrawz[playerid]);
                PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
                return true;
            }
        }
This is the full callback

pawn Код:
public SetPlayerSpawn(playerid)
{
    /*new Float:X,
        Float:Y,
        Float:Z;*/

       
   
    if(IsPlayerConnected(playerid))
    {
        new house = Account[playerid][pPhousekey];
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        SafeResetPlayerWeapons(playerid);
        if(Account[playerid][pTut] == 0)
        {
            Tutorial1[playerid] = TextDrawCreate(179.000000,357.0000,"000");
            TextDrawUseBox(Tutorial1[playerid],1);
            TextDrawBoxColor(Tutorial1[playerid],0x00000066);
            TextDrawTextSize(Tutorial1[playerid],480.000000,0.000000);
            TextDrawAlignment(Tutorial1[playerid],0);
            TextDrawBackgroundColor(Tutorial1[playerid],0x000000ff);
            TextDrawFont(Tutorial1[playerid],1);
            TextDrawLetterSize(Tutorial1[playerid],0.399999,1.000000);
            TextDrawColor(Tutorial1[playerid],0xffffffff);
            TextDrawSetOutline(Tutorial1[playerid],1);
            TextDrawSetProportional(Tutorial1[playerid],1);
            TextDrawSetShadow(Tutorial1[playerid],1);
           
            /*Tutorial1[playerid] = TextDrawCreate(179.000000,124.000000,"000");
            TextDrawUseBox(Tutorial1[playerid],1);
            TextDrawBoxColor(Tutorial1[playerid],0x00000066);
            TextDrawTextSize(Tutorial1[playerid],480.000000,0.000000);
            TextDrawAlignment(Tutorial1[playerid],0);
            TextDrawBackgroundColor(Tutorial1[playerid],0x000000ff);
            TextDrawFont(Tutorial1[playerid],1);
            TextDrawLetterSize(Tutorial1[playerid],0.399999,1.000000);
            TextDrawColor(Tutorial1[playerid],0xffffffff);
            TextDrawSetOutline(Tutorial1[playerid],1);
            TextDrawSetProportional(Tutorial1[playerid],1);
            TextDrawSetShadow(Tutorial1[playerid],1);*/

           
            //371.0000
           
            gOoc[playerid] = 1; gNews[playerid] = 1; gFam[playerid] = 1;
            TogglePlayerControllable(playerid, false);
            SetPlayerPos(playerid, 954.6555,-1702.3538,15.3847);
           
            SetPlayerFacingAngle(playerid, 90);
            SetPlayerCameraPos(playerid, 922.761718, -1703.137817, 15.237014);
            SetPlayerCameraLookAt(playerid, 926.758789, -1702.984741, 15.233889);
            /*SetPlayerCameraPos(playerid, 2177.5269,1285.3782,44.0867);
            SetPlayerCameraLookAt(playerid, 2182.2908,1285.7317,42.9620);*/

            SetPlayerVirtualWorld(playerid,1+random(999));
            RegistrationStep[playerid] = 1;
            ShowPlayerDialog(playerid,300,DIALOG_STYLE_INPUT,"{0080FF}                        Sex","{FFFFFF}What is your gender? {0080FF}Male {FFFFFF}or {0080FF}Female  ","Proceed","Cancel");
            gPlayerLogged[playerid] = 1;
            return true;
        }
        /*if(Account[playerid][pPcarkey1] != 999 || Account[playerid][pPcarkey2] != 999 || Account[playerid][pPcarkey3] != 999)
        {
            new vehid1 = Account[playerid][pPcarkey1];
            new vehid2 = Account[playerid][pPcarkey2];
            new vehid3 = Account[playerid][pPcarkey3];
            if(Account[playerid][pPcarkey1] != 999)
            {
                if(strcmp(VehicleInfo[vehid1][cOwner],name, true ) == 0 ) { }
                else { vehid1 = 999; }
            }
            else if(Account[playerid][pPcarkey2] != 999)
            {
                if(strcmp(VehicleInfo[vehid2][cOwner],name, true ) == 0 ) { }
                else { vehid2 = 999; }
            }
            else if(Account[playerid][pPcarkey3] != 999)
            {
                if(strcmp(VehicleInfo[vehid3][cOwner],name, true ) == 0 ) { }
                else { vehid3 = 999; }
            }
        }*/

        if(Account[playerid][pFMember] == 255 && Account[playerid][pGMember] == 255)
        {
            if(Account[playerid][pJob] == 10)
            {
                Account[playerid][pJob] = 0;
            }
        }
        /*for(new c=0;c<sizeof(VehicleInfo);c++)
        {
            if(strcmp(VehicleInfo[c][cOwner],name, true ) == 0 )
            {
                if(Account[playerid][pPcarkey1] == 999)
                {
                    Account[playerid][pPcarkey1] = c;
                    continue;
                }
                if(Account[playerid][pPcarkey2] == 999)
                {
                    Account[playerid][pPcarkey2] = c;
                    continue;
                }
                if(Account[playerid][pPcarkey3] == 999)
                {
                    Account[playerid][pPcarkey3] = c;
                    break;
                }
            }
        }*/

        /*if(house != 255)
        {
            if(strcmp(Property[house][hOwner],name, true ) == 0 ) { }
            else { house = 255; }
        }*/

        if(Account[playerid][pJailed] == 1)
        {
            SetPlayerInterior(playerid, 6);
            Account[playerid][pInt] = 6;
            TogglePlayerControllable(playerid, true);
            SetPlayerPos(playerid,264.6288,77.5742,1001.0391);
            SendClientMessage(playerid, COLOR_LIGHTRED, "Incomplete Jail Sentence, back to jail.");
            gPlayerLogged[playerid] = 1;
            return true;
        }
        if(Account[playerid][pJailed] == 3)
        {
            SetPlayerInterior(playerid, 0);
            Account[playerid][pInt] = 0;
            TogglePlayerControllable(playerid, true);
            SetPlayerPos(playerid,2525.8032,-1309.8915,1031.4219);
            gPlayerLogged[playerid] = 1;
            return true;
        }
        if(Account[playerid][pJailed] == 2)
        {
            SetPlayerInterior(playerid, 3);
            Account[playerid][pInt] = 3;
            SetPlayerPos(playerid, 1763.6307,-1540.7831,9.2410);
            TogglePlayerControllable(playerid, true);
            SendClientMessage(playerid, COLOR_LIGHTRED, "Incomplete Jail Sentence, back to jail.");
            gPlayerLogged[playerid] = 1;
            return true;
        }
        if(Hospital[playerid] == 1 && Account[playerid][pJailed] == 0)
        {
            if(FirstSpawn[playerid] != 1)
            {
                /*SetPlayerHealth(playerid, 25.0);
                SetPlayerInterior(playerid, 0);
                Account[playerid][pInt] = 0;
                SendClientMessage(playerid, TEAM_CYAN_COLOR, "Doctor: Hope your feeling better, please be aware next time.");
                TogglePlayerControllable(playerid, true);
                SetPlayerPos(playerid, 1178.1443,-1323.3268,14.1056);
                SetPlayerFacingAngle(playerid, 270.9733);
                SetCameraBehindPlayer(playerid);
                return true;*/

                new rand;
                SetPlayerPos(playerid, 1160.8542,-1330.8306,1499.4673);
                SetPlayerFacingAngle(playerid, 357.6145);
                SetPlayerInterior(playerid, 0);
                Account[playerid][pInt] = 0;
                rand = 1+random(200);
                SetPlayerVirtualWorld(playerid,rand);
                Account[playerid][pVirtualWorld] = rand;
                SetPlayerCameraPos(playerid, 1152.0311,-1325.3153,1498.6328);
                SetPlayerCameraLookAt(playerid,1160.3467,-1332.2661,1498.6328);
                TogglePlayerControllable(playerid, false);
                ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                MedicTime[playerid] = 1;
                //
                TextDrawHideForPlayer(playerid,Textdrawz[playerid]);
                TextDrawSetString(Textdrawz[playerid],"~w~You are resting due ~r~brutally wounds~w~, you will be out when the doctor says so.~n~ The time in, depends on your 'Death Way'");
                //
                TextDrawShowForPlayer(playerid,Textdrawz[playerid]);
                PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
                return true;
            }
        }
        if(Account[playerid][pCrashed] == 1)
        {
            Account[playerid][pLocal] = 255;
            TogglePlayerControllable(playerid, true);
            SetPlayerVirtualWorld(playerid,Account[playerid][pVirtualWorld]);
            SetPlayerInterior(playerid,Account[playerid][pInt]);
            Account[playerid][pCrashed] = 0;
            TextDrawHideForPlayer(playerid,Textdrawz[playerid]);
            if(Account[playerid][pQuitOnCar]==1){
                SetPlayerPos(playerid,CrashPos[playerid][0],CrashPos[playerid][1],CrashPos[playerid][2]+4);
                Account[playerid][pQuitOnCar]=0; }
            else {
            SetPlayerPos(playerid,CrashPos[playerid][0],CrashPos[playerid][1],CrashPos[playerid][2]); }
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
            OnPlayerUpdate(playerid);
            gPlayerLogged[playerid] = 1;
            return true;
        }
        if(house !=255)
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerInterior(playerid,Property[house][hInt]);
            SetPlayerPos(playerid, Property[house][hExitx], Property[house][hExity],Property[house][hExitz]); // Warp the player
            Account[playerid][pLocal] = house;
            if(IsAtHouse[playerid]==0){IsAtHouse[playerid]=1;}
            TogglePlayerControllable(playerid, true);
            SetPlayerVirtualWorld(playerid,Property[house][hVirtualWorld]);
            Account[playerid][pVirtualWorld] = Property[house][hVirtualWorld];
            Account[playerid][pInt] = Property[house][hInt];
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
            gPlayerLogged[playerid] = 1;
            return true;
        }
        new renthouse = Account[playerid][pRentKey];
        if(renthouse!=255)
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerInterior(playerid,Property[renthouse][hInt]);
            SetPlayerPos(playerid, Property[renthouse][hExitx], Property[renthouse][hExity],Property[renthouse][hExitz]); // Warp the player
            Account[playerid][pLocal] = renthouse;
            if(IsAtHouse[playerid]==0){IsAtHouse[playerid]=1;}
            TogglePlayerControllable(playerid, true);
            SetPlayerVirtualWorld(playerid,Property[renthouse][hVirtualWorld]);
            Account[playerid][pVirtualWorld] = Property[renthouse][hVirtualWorld];
            Account[playerid][pInt] = Property[renthouse][hInt];
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
            gPlayerLogged[playerid] = 1;
            return true;
        }
        if (Account[playerid][pMember] == 1 || Account[playerid][pLeader] == 1)//Police Force spawn
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerPos(playerid, 1576.6135,-1694.3019,6.2188); // Warp the player
            SetPlayerFacingAngle(playerid, 175.3597);
            SetPlayerInterior(playerid,0);
            Account[playerid][pInt] = 0;
            TogglePlayerControllable(playerid, true);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
            gPlayerLogged[playerid] = 1;
            return true;
        }
        if (Account[playerid][pMember] == 3 || Account[playerid][pLeader] == 3)//National Guard spawn
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, 1318.9393,1253.1924,10.8203);
            Account[playerid][pInt] = 0;
            TogglePlayerControllable(playerid, true);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
            gPlayerLogged[playerid] = 1;
            return true;
        }
        if (Account[playerid][pMember] == 4 || Account[playerid][pLeader] == 4)//Fire/Ambulance spawn
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, 1174.5393,-1322.8113,14.7891);
            Account[playerid][pInt] = 0;
            TogglePlayerControllable(playerid, true);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
            gPlayerLogged[playerid] = 1;
            return true;
        }
        if (Account[playerid][pMember] == 5 || Account[playerid][pLeader] == 5)//flight
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerInterior(playerid, 0);
            SetPlayerPos(playerid, 1893.7687,-2244.4075,13.5469);
            Account[playerid][pInt] = 0;
            TogglePlayerControllable(playerid, true);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
            gPlayerLogged[playerid] = 1;
            return true;
        }
        else if (Account[playerid][pMember] == 9 || Account[playerid][pLeader] == 9) //News spawn
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerPos(playerid, 1409.4679,-1706.0242,13.5469);
            SetPlayerInterior(playerid,0);
            Account[playerid][pInt] = 0;
            TogglePlayerControllable(playerid, true);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
            gPlayerLogged[playerid] = 1;
            return true;
        }
        if (Account[playerid][pMember] == 10 || Account[playerid][pLeader] == 10) //Taxi Cab Company spawn
        {
            SetPlayerToTeamColor(playerid);
            SetPlayerPos(playerid, 2486.2556,-2081.0901,13.5469);
            SetPlayerInterior(playerid,0);
            Account[playerid][pInt] = 0;
            TogglePlayerControllable(playerid, true);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
            gPlayerLogged[playerid] = 1;
            return true;
        }
        if(Account[playerid][pGMember] != 255)
        {

            new gang2 = Account[playerid][pGMember];
            if(GangInfo[gang2][GangTaken] == 0)
            {
                gang2 = 255;
                SetPlayerSpawn(playerid);
                return true;
            }
            else
            {
                if(GangInfo[gang2][GangSpawn][0] == 0.0 && GangInfo[gang2][GangSpawn][1] == 0.0 && GangInfo[gang2][GangSpawn][2] == 0.0)
                {
                    SetPlayerPos(playerid,1642.4680,-2240.2568,13.4952);
                    SetPlayerFacingAngle(playerid, 132.5796);
                    SetPlayerInterior(playerid,0);
                    TogglePlayerControllable(playerid, true);
                    Account[playerid][pInt] = 0;
                    SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
                    SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
                    SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
                    gPlayerLogged[playerid] = 1;
                    return true;
                }
                else
                {
                    SetPlayerToTeamColor(playerid);
                    SetPlayerInterior(playerid, GangInfo[gang2][GangInterior]);
                    Account[playerid][pInt] = GangInfo[gang2][GangInterior];
                    SetPlayerPos(playerid, GangInfo[gang2][GangSpawn][0],GangInfo[gang2][GangSpawn][1],GangInfo[gang2][GangSpawn][2]);
                    SetPlayerFacingAngle(playerid, GangInfo[gang2][GangSpawn][3]);
                    SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
                    SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
                    SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
                    gPlayerLogged[playerid] = 1;
                    return true;
                }
            }
        }
        if(Account[playerid][pFMember] != 255)
        {
            new family = Account[playerid][pFMember];
            if(FamilyInfo[family][FamilyTaken] == 0)
            {
                family = 255;
                SetPlayerSpawn(playerid);
                return true;
            }
            else
            {
                if(FamilyInfo[family][FamilySpawn][0] == 0.0 && FamilyInfo[family][FamilySpawn][1] == 0.0 && FamilyInfo[family][FamilySpawn][2] == 0.0)
                {
                    SetPlayerPos(playerid,1642.4680,-2240.2568,13.4952);
                    SetPlayerFacingAngle(playerid, 132.5796);
                    SetPlayerInterior(playerid,0);
                    TogglePlayerControllable(playerid, true);
                    Account[playerid][pInt] = 0;
                    SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
                    SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
                    SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
                    gPlayerLogged[playerid] = 1;
                    return true;
                }
                else
                {
                TogglePlayerControllable(playerid, true);
                SetPlayerToTeamColor(playerid);
                Account[playerid][pInt] = FamilyInfo[family][FamilyInterior];
                SetPlayerInterior(playerid, FamilyInfo[family][FamilyInterior]);
                SetPlayerPos(playerid, FamilyInfo[family][FamilySpawn][0],FamilyInfo[family][FamilySpawn][1],FamilyInfo[family][FamilySpawn][2]);
                SetPlayerFacingAngle(playerid, FamilyInfo[family][FamilySpawn][3]);
                SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
                SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
                SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
                gPlayerLogged[playerid] = 1;
                return true;
                }
            }
        }
        else
        {
            if(CrashPos[playerid][0] == 0.0 && CrashPos[playerid][1] == 0.0)
            {
                SetPlayerPos(playerid,1642.4680,-2240.2568,13.4952);
                SetPlayerFacingAngle(playerid, 132.5796);
                }
                else
                {
                if(Account[playerid][pQuitOnCar]==1){
                    SetPlayerPos(playerid,CrashPos[playerid][0],CrashPos[playerid][1],CrashPos[playerid][2]+4);
                    Account[playerid][pQuitOnCar]=0; }
                else {
                SetPlayerPos(playerid,CrashPos[playerid][0],CrashPos[playerid][1],CrashPos[playerid][2]); }
                }
            //SetPlayerPos(playerid,1642.4680,-2240.2568,13.4952);
            //SetPlayerFacingAngle(playerid, 132.5796);
            SetPlayerInterior(playerid,Account[playerid][pInt]);
            TogglePlayerControllable(playerid, true);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun0], Account[playerid][pAmmo0]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun1], Account[playerid][pAmmo1]);
            SafeGivePlayerWeapon(playerid, Account[playerid][pGun2], Account[playerid][pAmmo2]);
            gPlayerLogged[playerid] = 1;
            return true;
        }
    }
    return true;
}

When A player die, Instead of spawning him at the hospital, he spaws at his house,, I tried Puting what's in SetPlayerSpawn In OnPlayerSpawn, But didn't work, any help ?
Reply
#2

Anyone ?
Reply
#3

no one can be asked to go through all of that, is all messy!
Your like here's this here's that..

Many things wrong just no point ;X

All i can say is use return something or case to make sure nothing else is called after the position u want
Reply
#4

Organize your code and use a switch & case statement in OnPlayerDeath callback, otherwise no one gonna help you, cause your code is messy.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)