20.02.2013, 15:18
(
Последний раз редактировалось Joshman543; 20.02.2013 в 20:26.
)
Hello everyone well here is my problem. I created a death system so that when a user dies they spawn where they die and are frozen until paramedics arrive. The problem is that when a player logs in they automatically freeze and spawn at 0.000,0.000,0.000. Here is the code for OnPlayerDeath:
Now here is the SpawnChar() function part:
I need this fixed ASAP, you will be given REP if you assist me at all.
PHP код:
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
DeathPosX[playerid] = X;
DeathPosY[playerid] = Y;
DeathPosZ[playerid] = Z;
PlayerInfo[playerid][pArmor] = 0;
PlayerInfo[playerid][pDead] = 1;
}
PHP код:
if(PlayerInfo[playerid][pDead] == 1)
{
SetPlayerPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
SetPlayerCameraPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]+5);
ClearAnimations(playerid);
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE", 4.0, 0, 0, 0, 1, 0);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "~r~Injured~n~~w~/accept death or /call 911", 5000, 3);
SetPlayerHealth(playerid, 50);
}
else
{
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
SetCameraBehindPlayer(playerid);
SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
// HP and Armor
if(PlayerInfo[playerid][pHealth] <= 0) PlayerInfo[playerid][pHealth] = 1;
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
}