(HELP) After rest spawn - 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) After rest spawn (
/showthread.php?tid=270488)
(HELP) After rest spawn -
spaty2 - 20.07.2011
Hello, i have problem, when i have rest and after rest I spawn again in bad, and must rest again and again, but i should spawn in front of hospital
look:
pawn Код:
if(FirstSpawn[playerid] != 1)
{
//new string[256];
new cut = deathcost;
SafeGivePlayerMoney(playerid, -cut);
MedicBill[playerid] = 0;
MedicTime[playerid] = 0;
NeedMedicTime[playerid] = 0;
SetPlayerToTeamColor(playerid);
SetPlayerPos(playerid,1178.0300,-1323.4100,14.0999); // hospital spawn(there i wanna respawn)
SetPlayerFacingAngle(playerid, 0);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pDeaths] += 1;
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] = 30;
}
else
{
NeedMedicTime[playerid] = 40;
}
PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
return 1;
}
I should spawn in front of hospital, but I again spawn in Bad in hospital, why please? what's bad on this script?
Re: (HELP) After rest spawn -
kodiak - 20.07.2011
change coordinates
Re: (HELP) After rest spawn -
spaty2 - 20.07.2011
Why, cahnge coordinates? I don't need change, it is correct, spawn infront of Hostpital, but I spawn again on bad and must wait next the time to be free, but when I should be free I respawn again on bad and again and again.
Re: (HELP) After rest spawn -
Toreno - 20.07.2011
You need to create a variable which tells if the player finished his rest, if so, he'll SetPlayerPos to your specific location. If you might notice, when you SetPlayerPos, under it, it sets it once again, only randomly to one of the bads inside the hospital.
Re: (HELP) After rest spawn -
spaty2 - 21.07.2011
Thanks Eliran, you helped, again