SA-MP Forums Archive
(HELP) Binco 'done' REST????! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: (HELP) Binco 'done' REST????! (/showthread.php?tid=270735)



(HELP) Binco 'done' REST????! - spaty2 - 21.07.2011

Hey, when I searching in binco clothes shop for new skin and write "done"
after I find... I'm going to rest in hospital like when I Die.... why
there you have script of my hospital rest

pawn Код:
if(FirstSpawn[playerid] != 1)
            {
                PlayerInfo[playerid][pVirWorld] = 0;
                SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirWorld]);
                PlayerInfo[playerid][pDeaths] += 1;
                SetPlayerHealth(playerid, 25.0);
                SetPlayerInterior(playerid, 3);
                PlayerInfo[playerid][pInt] = 3;
                rand = random(sizeof(gMedicSpawns));
                SetPlayerPos(playerid, gMedicSpawns[rand][0], gMedicSpawns[rand][1], gMedicSpawns[rand][2]); // 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 ...", 30000, 3);
                JustDied[playerid] = 1;
                MedicTime[playerid] = 1;
                ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                if(PlayerInfo[playerid][pDonateRank] > 0)
                {
                    NeedMedicTime[playerid] = 20;
                }
                else
                {
                    NeedMedicTime[playerid] = 30;
                }
                PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
                return 1;
            }



Re: (HELP) Binco 'done' REST????! - spaty2 - 21.07.2011

pawn Код:
}
        else if ((strcmp("done", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("done")))
        {
            if(ChangePos2[playerid][1] == 1)
            {
                SetPlayerInterior(playerid, ChangePos2[playerid][0]);
                SetPlayerPos(playerid, ChangePos[playerid][0],ChangePos[playerid][1],ChangePos[playerid][2]);
                ChangePos2[playerid][1] = 0;
          //return 0;
      }
            MedicBill[playerid] = 0;
            PlayerInfo[playerid][pModel] = ChosenSkin[playerid];
            PlayerInfo[playerid][pChar] = ChosenSkin[playerid];
            SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel],0.0,0.0,0.0,0,0,0,0,0,0,0);
            gTeam[playerid] = PlayerInfo[playerid][pTeam];
            SetPlayerToTeamColor(playerid);
            MedicBill[playerid] = 0;
            SpawnPlayer(playerid);
            MedicBill[playerid] = 0;
            SelectCharPlace[playerid] = 0;
            SelectCharID[playerid] = 0;
            SelectChar[playerid] = 0;
            SetPlayerVirtualWorld(playerid,0);
            SetTimerEx("backtoclothes", 500, false, "i", playerid);
            MedicBill[playerid] = 0;
            return 0;
        }
Maybe this can help too


Re: (HELP) Binco 'done' REST????! - MadeMan - 21.07.2011

There should be this

pawn Код:
MedicBill[playerid] = 1;
under

pawn Код:
if(newstate == PLAYER_STATE_SPAWNED)
Move it under

pawn Код:
if(newstate == PLAYER_STATE_WASTED)



Re: (HELP) Binco 'done' REST????! - spaty2 - 21.07.2011

Waiiit


Re: (HELP) Binco 'done' REST????! - spaty2 - 21.07.2011

Don't works, when i die now, i'm not spawn in hospital, but at home


Re: (HELP) Binco 'done' REST????! - Memoryz - 21.07.2011

pawn Код:
SetPVarInt(playerid, "NoHospital", 1);
under the command you use to go to the binco.

Place the following at the location in your script where it puts you out of the binco:

pawn Код:
SetPVarInt(playerid, "NoHospital", 0);
Then, change this:

pawn Код:
if(FirstSpawn[playerid] != 1)
to:

pawn Код:
if(FirstSpawn[playerid] != 1 && GetPVarInt(playerid, "NoHospital") != 1)



Re: (HELP) Binco 'done' REST????! - spaty2 - 21.07.2011

Works !!!!! Thx


Re: (HELP) Binco 'done' REST????! - Ehab1911 - 21.07.2011

So the whore thing was changing number 0 to 1


Re: (HELP) Binco 'done' REST????! - spaty2 - 21.07.2011

No, it was fucky, i don't know why...