public OnPlayerDeath(playerid,killerid,reason)
{
new dbugstring[128];
format(dbugstring,sizeof(dbugstring),"|| DEBUG || %s Onplayerdeathstarted", playerid);
SendClientMessageToAll(COLOR_BRIGHTRED,dbugstring);
print(dbugstring);
TextDrawShowForPlayer(playerid,WideScreenUp);
TextDrawShowForPlayer(playerid,WideScreenDown);
format(dbugstring,sizeof(dbugstring),"|| DEBUG || %s BAR TD SHOWN", playerid);
SendClientMessageToAll(COLOR_BRIGHTRED,dbugstring);
print(dbugstring);
//GameTextForPlayer(playerid,"Wasted", 3000, 2);
new Float:X, Float:Y, Float:Z; //creating some variables
GetPlayerPos(playerid, X, Y, Z);
SetPlayerCameraPos(playerid, X + 22.0, Y + 5.0, Z + 15.0);
SetPlayerCameraLookAt(playerid, X, Y, Z);
format(dbugstring,sizeof(dbugstring),"|| DEBUG || %s CAMERa SET", playerid);
SendClientMessageToAll(COLOR_BRIGHTRED,dbugstring);
print(dbugstring);
SetPlayerWorldBounds(playerid, INFINITY, -INFINITY, INFINITY, -INFINITY);
if(GAMETYPE == 2 && Current != -1 && Player[playerid][pPlaying]) // for TDM
{
Player[playerid][pPlaying] = true;
if(Player[killerid][pTeam] == T_ATT) TDM_DEFScore++;
else if(Player[killerid][pTeam] == T_DEF) TDM_ATTScore++;
}
else Player[playerid][pPlaying] = false;
ViewingBase[playerid] = -1;
SendDeathMessage(killerid,playerid,reason);
ResetPlayerWeapons(playerid);
GivePlayerMoney(playerid, 100);
SetPlayerTeam(playerid,playerid);
TextDrawShowForAll(Baseloading);
GivePlayerMoney(playerid, 100);
if(IsPlayerConnected(killerid)) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); /// This updates player's score when he kills someone
if(KillsCountActive)
{
Kills[killerid]++;
}
format(dbugstring,sizeof(dbugstring),"|| DEBUG || %s STAGE 3", playerid);
SendClientMessageToAll(COLOR_BRIGHTRED,dbugstring);
print(dbugstring);
if(KillzCounter && IsPlayerConnected(killerid) && Player[killerid][pPlaying] == true) Killz[killerid]++;
for(new x=0; x<MAX_SERVER_PLAYERS; x++) {
if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && gSpectateID[x] == playerid) {
StopSpectate(x);
}
}
if(reason == 50)
{
new killername[24],string[STR];
GetPlayerName(killerid,killername,STR);
format(string,STR,"%s has been eliminated for Heli-Killing.",killername);
SendClientMessageToAll(COLOR_BRIGHTRED,string);
SetPlayerHealth(killerid,0);
}
if(reason == 4)
{
new killername[MAX_PLAYER_NAME],playername[MAX_PLAYER_NAME], string[STR], string2[STR];
GetPlayerName(killerid,killername,STR), GetPlayerName(playerid,playername,sizeof(playername));
format(string,STR,"|| Knifage!! || %s has Knifed %s to death in the back!",killername, playername);
SendClientMessageToAll(COLOR_BRIGHTRED,string);
format(string2,STR,"Smart kill there %s, have $250 for killing %s",killername, playername);
SendClientMessage(killerid,COLOR_GREY,string2);
GivePlayerMoney(killerid, 250);
}
if(IsPlayerInCheckpoint(playerid))
{
KillTimer(CountdownTimer);
IsCPTimerStarted=0;
KillTimer(CTime);
}
for(new x=0; x<MAX_SERVER_PLAYERS; x++)
{
if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && gSpectateID[x] == playerid)
{
AdvanceSpectate(x);
}
}
if(!Player[playerid][killedhimself] && killerid != INVALID_PLAYER_ID)
{
new killer[MAX_PLAYER_NAME], killmsg[128];
new Float:armour, Float:health2;
GetPlayerHealth(killerid, health2);
GetPlayerArmour(killerid, armour);
GetPlayerName(killerid,killer,sizeof(killer));
format(killmsg, sizeof(killmsg), "Your killer %s had %.0f health points and %.0f armour.", killer, health2, armour);
SendClientMessage(playerid, AAD_COLOR_RED, killmsg);
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, killerid);
SendClientMessage(playerid,COLOR_LIME,">> Respawning in 5 seconds...");
SetTimerEx("STOPSPECCINGNOW", 5000, false, "d", playerid);
}
if(Player[playerid][pPlaying]== true && FirstRoundKill)
{
GameTextForAll("~r~~n~~n~~n~~n~First Blood",5000,3);
FirstRoundKill = false;
}
format(dbugstring,sizeof(dbugstring),"|| DEBUG || %s Onplayerdeath ENDED", playerid);
SendClientMessageToAll(COLOR_BRIGHTRED,dbugstring);
print(dbugstring);
return 1;
}
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
Maybe use a timer ? |
Originally Posted by [B2K
Hustler ]
Someone has suggested to use timers on irc, but i'd rather not cure it, but rather prevent it in the first place. |
Originally Posted by [B2K
Hustler ]
Quote:
Quote:
|
new Float:X, Float:Y, Float:Z; //creating some variables
GetPlayerPos(playerid, X, Y, Z);
SetPlayerCameraPos(playerid, X + 22.0, Y + 5.0, Z + 15.0);
SetPlayerCameraLookAt(playerid, X, Y, Z);
Originally Posted by DeathOnaStick
Heyho.
Little question first: What should this part do: Код:
new Float:X, Float:Y, Float:Z; //creating some variables GetPlayerPos(playerid, X, Y, Z); SetPlayerCameraPos(playerid, X + 22.0, Y + 5.0, Z + 15.0); SetPlayerCameraLookAt(playerid, X, Y, Z); |
Originally Posted by ♣ ⓐⓢⓢ
you should try to use SetCameraBehindPlayer in OnPlayerSpawn
|