Heyho,
ich arbeite gerade an einem Totensystem
entweder er ist schwer verletzt oder er ist Tod.
Wenn der Spieler Schwer verletzt ist geht alles aber wenn er stirbt spawnt er.
hier mal mein Code:
public OnPlayerDeath(playerid, killerid, reason)
{
new Arzte;
Arzte = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(sSpieler[i][Fraktion] == 1)
{
Arzte += 1;
}
}
if(Arzte == 0)
{
sSpieler[playerid][TodZeit] = 5;
}
if(Arzte == 1)
{
sSpieler[playerid][TodZeit] = 10;
}
if(Arzte == 2 || Arzte > 2)
{
sSpieler[playerid][TodZeit] = 15;
}
new Tod[MAX_PLAYERS];
Tod[playerid] = random(1);
if(Tod[playerid] == 1)
{
ApplyAnimation(playerid,"CRACK","crckdeth2", 4.0,1,1,1,1,1);
GetPlayerPos(playerid, TodX[playerid], TodY[playerid], TodZ[playerid]);
SendClientMessage(playerid, Rot, "Du bist Schwer verletzt.");
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, TodX[playerid], TodY[playerid], TodZ[playerid]);
ApplyAnimation(playerid,"CRACK","crckdeth2", 4.0,1,1,1,1,1);
SetPlayerCameraPos(playerid, TodX[playerid], TodY[playerid], TodZ[playerid]+10);
SetPlayerCameraLookAt(playerid, TodX[playerid], TodY[playerid], TodZ[playerid]);
ApplyAnimation(playerid,"CRACK","crckdeth2", 4.0,1,1,1,1,1);
Tod[playerid] = 0;
return 1;
}
else
{
GetPlayerPos(playerid, TodX[playerid], TodY[playerid], TodZ[playerid]);
Totenpickup[playerid] = AddStaticPickup(1254, 1, TodX[playerid], TodY[playerid], TodZ[playerid], 0);
SendClientMessage(playerid, Rot, "Du bist Gestorben.");
SetPlayerPos(playerid,1582.1160,1768.7952,10.8203);
SetPlayerVirtualWorld(playerid, 1);
SetPlayerHealth(playerid, 100);
SetPlayerWeather(playerid,16);
return 1;
}
}