SA-MP Forums Archive
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)
+--- Thread: Spawn (/showthread.php?tid=403974)



Spawn - LoLeC - 01.01.2013

I would need that to me after death figure appears opposite hospital,
But if I die a was I ported on the stored position after death.

Код:
public OnPlayerSpawn(playerid)
{
TogglePlayerClock(playerid, 1);
StopAudioStreamForPlayer(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
SetCameraBehindPlayer(playerid);

if(dead[playerid] == 1)
{
new rand = random(4);
switch(rand)
{
case 0:
{
SetPlayerPos(playerid,1180.8500,-1325.5699,13.5875);
SetPlayerFacingAngle(playerid,270);
}
case 1:
{
SetPlayerPos(playerid,2027.1165,-1421.4835,16.9922);
SetPlayerFacingAngle(playerid,134);
}
case 2:
{
SetPlayerPos(playerid,-2664.4026,626.6102,14.4531);
SetPlayerFacingAngle(playerid,180);
}
case 3:
{
SetPlayerPos(playerid,1581.1609,1769.0256,10.8203);
SetPlayerFacingAngle(playerid,84.74);
}
}
}

if(NewPlayer[playerid] == 1)
{
SetPlayerPos(playerid,1682.7515,-2331.0776,13.5469);
SetPlayerColor(playerid, 0xFFFFFFFF);
SetPlayerFacingAngle(playerid,360);
NewPlayer[playerid] = 0;
}

else
{
SetPlayerInterior(playerid,dUserINT(PlayerName(playerid)).("int")-GetPlayerInterior(playerid));
SetPlayerPos(playerid,
float(dUserINT(PlayerName(playerid)).("x")),
float(dUserINT(PlayerName(playerid)).("y")),
float(dUserINT(PlayerName(playerid)).("z")));
dead[playerid] = 0;
}
return 1;
}