20.12.2016, 03:55
I tried everything but yet didnt seem to work.. I even search on old similar posts but didn't find a quite answer..
After i die it spawns my player with a bottle in his hands or a cigarette..
P.S: It spawns correctly and after 2 seconds it re-spawns with bottle/cigarette..
After i die it spawns my player with a bottle in his hands or a cigarette..
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid,playerid,reason);
SystemTimers[playerid][0] = SetTimerEx("SpawnPlayerAfterDeath", 2000, false, "i", playerid);
return 1;
}
PHP код:
function SpawnPlayerAfterDeath(playerid)
{
if(pinfo[playerid][Team] == NO_TEAM)
{
new rnd = random(sizeof(SpawnPoints));
SetSpawnInfo(playerid, pinfo[playerid][Team], pinfo[playerid][Skin], SpawnPoints[rnd][0], SpawnPoints[rnd][1], SpawnPoints[rnd][2], 90.0, 25, 100, 0, 0, 0, 0);
SpawnPlayer(playerid);
SetPlayerPos(playerid, SpawnPoints[rnd][0], SpawnPoints[rnd][1], SpawnPoints[rnd][2]);
ClearAnimations(playerid);
KillTimer(SystemTimers[playerid][0]);
SetHealth(playerid, 100);
}
return true;
}