Please help with this!
#1

hey could someone Make me a KillCam i have no idea how to do this xD
like when the player dies they spec a player for ten seconds then you can Press "Space" to skip it


thanks guys
Reply
#2

It's so easy.
Just make a camera like OnPlayerRequestClass (SetPlayerCameraPos, etc.),
and set a timer after 5 seconds to destroy the player camera (SetCameraBehindPlayer);
PM me for any future help.
Reply
#3

Quote:
Originally Posted by IST BarMaN
It's so easy.
Just make a camera like OnPlayerRequestClass (SetPlayerCameraPos, etc.),
and set a timer after 5 seconds to destroy the player camera (SetCameraBehindPlayer);
PM me for any future help.
Can you please give me a code?
Reply
#4

You can do a camera, but why do that when you can spectate.

pawn Код:
new playerSpecTimer[MAX_PLAYERS] = {-1};
public OnPlayerDeath(playerid, killerid, reason)
{
  TogglePlayerSpectating(playerid, 1);
  PlayerSpectatePlayer(playerid, killerid); //spectate their killer
  playerSpecTimer[playerid] = SetTimerEx("TogglePlayerSpectating", 10000, false, "dd", playerid, 0);
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  //You can't choose space, see https://sampwiki.blast.hk/wiki/GetPlayerKeys
  if(newkeys & KEY_SPRINT && playerSpecTimer[playerid]!=-1)
  {
     KillTimer(playerSpecTimer[playerid]);
     TogglePlayerSpectating(playerid, 0);
  }
}
Reply
#5

Quote:
Originally Posted by mansonh
You can do a camera, but why do that when you can spectate.

pawn Код:
new playerSpecTimer[MAX_PLAYERS] = {-1};
public OnPlayerDeath(playerid, killerid, reason)
{
  TogglePlayerSpectating(playerid, 1);
  PlayerSpectatePlayer(playerid, killerid); //spectate their killer
  playerSpecTimer[playerid] = SetTimerEx("TogglePlayerSpectating", 10000, false, "dd", playerid, 0);
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  //You can't choose space, see https://sampwiki.blast.hk/wiki/GetPlayerKeys
  if(newkeys & KEY_SPRINT && playerSpecTimer[playerid]!=-1)
  {
     KillTimer(playerSpecTimer[playerid]);
     TogglePlayerSpectating(playerid, 0);
  }
}
yeah thats what i ment a spectate :P
thanks man this works
Reply
#6



Now I am note sure about spectate and how it affects spawn, never really used spectate, so hope it works.
Reply
#7

amm.. i dont have pawno here, so i will write an unindent code.
its should work.
it will spectate on a place you choose after death,
you can define the time, XYZ for looking / pos, message, and more.
Код:
// Simple DeathCamera - IST BarMaN, Bar Ohana, Israel.
#define DEF_CameraPos //X,Y,Z of the Camera Position
#define DEF_CameraLookAt //X,Y,Z of the place the camera should look into
#define DEF_CameraTime 5 // The time the camera will turned on, define it
#define DEF_MessageC 0xE6E6E6E6 // A color in hex type, the current is white.
#define DEF_MessageText "" // insert between the barckets your message 

new bool:PlayerCamera[MAX_PLAYERS] = {false,...};

public OnPlayerDeath(playerid)
{
PlayerCamera[playerid] = true;
}

public OnPlayerSpawn(playerid)
{
if(PlayerCamera[playerid] == true)
{
SetPlayerCameraPos(playerid,DEF_CameraPos), SetPlayerCameraLookAt(playerid,DEF_CameraLookAt);
SetTimerEx("ResetPlayerCamera", (DEF_CameraTime * 1000), false, "i", playerid);
}
}

forward ResetPlayerCamera(playerid);
public ResetPlayerCamera(playerid)
{
SetCameraBehindPlayer(playerid), PlayerCamera[playerid] = false;
SendClientMessage(playerid,DEF_MessageC, DEF_MessageText);
}
Reply
#8

Sorry to tell you you wasted your time but he wanted a spectating system ^^
Reply
#9

Ohh. OK, but i didn't understand him.
Reply
#10

lol thanks for trying :P

yes it works well thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)