Jemand killt dich, und du willst wissen wer?
KillCam , man Blickt 5 Sekunden lang auf denn Spieler der dich gekillt hat.
public OnPlayerDeath(playerid, killerid, reason)
{
new string[125];
format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~r~You Are Dead!");
GameTextForPlayer(playerid, string, 5000, 4);
if(killerid != INVALID_PLAYER_ID)
{
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
SetTimerEx("deathspec", 5000, false, "i", playerid);
}
return 1;
}
forward deathspec(playerid);
public deathspec(playerid)
{
TogglePlayerSpectating(playerid, 0);
return 1;
}
Wie lange Spielte der Spieler?
public OnPlayerConnect(playerid)
return SetPVarInt(playerid, "zeit", GetTickCount());
public OnPlayerDisconnect(playerid)
{
new h, m, s, name[MAX_PLAYER_NAME], str[80];
GetPlayerName(playerid, name, sizeof name);
ConvertMS(GetTickCount()-GetPVarInt(playerid, "zeit"), h, m, s);
format(str, sizeof str, "Spieler %s hat den server verlassen, er spielte %02d:%02d:%02d", name, h, m, s);
SendClientMessageToAll(-1, str);
return 1;
}
stock ConvertMS(Miliseconds, &hours, &minutes, &seconds)
{
hours = Miliseconds / 3600000;
Miliseconds -= hours * 3600000;
minutes = Miliseconds / 60000;
Miliseconds -= minutes * 60000;
seconds = Miliseconds / 1000;
Miliseconds -= seconds * 1000;
}