06.05.2011, 22:02
(
Последний раз редактировалось Audiophr3ak; 07.05.2011 в 11:48.
)
I have a problem with my death timer, it wont work after the first death. Looks as the same crap with animations when they wont apply from the first command.
Here is the part of code:
forward Death(playerid);
public Death(playerid)
{
aInfo[playerid][Status] = 0;
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a);
SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), x, y, z, a, GetPlayerWeapon(playerid), GetPlayerAmmo(playerid), 0, 0, 0, 0);
aInfo[playerid][Status] = 1;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(aInfo[playerid][Status] == 1)
{
ApplyAnimation(playerid, "PED", "KO_skid_back", 4, 0, 1, 1, 1, 0, 1);
TogglePlayerControllable(playerid, 0);
DeathTimer[playerid] = SetTimerEx("Death", 60000, 0, "i", playerid);
}
return 1;
}
Here is the part of code:
forward Death(playerid);
public Death(playerid)
{
aInfo[playerid][Status] = 0;
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Float, Float:y, Float:z, Float:a; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a);
SetSpawnInfo(playerid, 0, GetPlayerSkin(playerid), x, y, z, a, GetPlayerWeapon(playerid), GetPlayerAmmo(playerid), 0, 0, 0, 0);
aInfo[playerid][Status] = 1;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(aInfo[playerid][Status] == 1)
{
ApplyAnimation(playerid, "PED", "KO_skid_back", 4, 0, 1, 1, 1, 0, 1);
TogglePlayerControllable(playerid, 0);
DeathTimer[playerid] = SetTimerEx("Death", 60000, 0, "i", playerid);
}
return 1;
}