Guten Abend,
Ich Arbeite gerade an meinem Todes System.
Und zwar, sobald man Stirbt soll man auf dem Boden Liegen und nichts machen können.
Leider klappt das ganze aber noch nicht wirklich.
Ich zeige euch mal den Code:
public OnPlayerSpawn(playerid)
{
PreloadPlayerAnims(playerid);
SetPlayerSkin(playerid,sInfo[playerid][sSkin]);
if(sInfo[playerid][sIsDeath] == 1)
{
ClearAnimations(playerid);
SetPlayerVirtualWorld(playerid, sInfo[playerid][sDeathWorld]);
SetPlayerInterior(playerid, sInfo[playerid][sDeathInterior]);
SetPlayerPos(playerid, sInfo[playerid][sDeathPosX], sInfo[playerid][sDeathPosY], sInfo[playerid][sDeathPosZ]);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 0, 0, 0, 0, 0);
SetTimerEx("DeathTimer", 1000*60*2, false, "i", playerid);
TogglePlayerControllable(playerid,1);
return 1;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
sInfo[playerid][sIsDeath] = 1;
GetPlayerPos(playerid, sInfo[playerid][sDeathPosX], sInfo[playerid][sDeathPosY], sInfo[playerid][sDeathPosZ]);
sInfo[playerid][sDeathInterior] = GetPlayerInterior(playerid);
sInfo[playerid][sDeathWorld] = GetPlayerVirtualWorld(playerid);
if(GetPVarInt(playerid,"Duty") == 1)
{
SetPVarInt(playerid,"Duty",0);
SetPlayerColor(playerid,FARBE_WEISS);
return 1;
}
sInfo[playerid][sDeath] += 1;
sInfo[killerid][sKill] += 1;
return 1;
}
Das ganze Klappt leider nicht wie Beschrieben.
MfG. Dome