SA-MP Forums Archive
Death System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Death System (/showthread.php?tid=366913)



Death System - sgtjones12 - 08.08.2012

Hey I need help i am trying to make a death system like when you die your body is left behind but since your actual character cant be left behind i wanna make a dead tied up cop left behind instead I can make all the commands and stuff I just need help to make a cop appear after you die. I also want the words to appear like whos body it is and how long ago they died and what weapon was used basically i want something like this



Re: Death System - Jstylezzz - 08.08.2012

OnPlayerDeath
Create3DTextlabel
CreateObject
Gettime();

this are the functions you are going to need.
if you just look up these functions on ****** and on the wiki, i'm pretty sure you can come very far


Re: Death System - Jarnu - 08.08.2012

pawn Код:
/*ontop */
new Object[MAX_PLAYERS];
new label[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:x,Float:y,Float:z,string[256],Name[MAX_PLAYER_NAME];
GetPlayerPos(playerid, x,y,z);
GetPlayerName(playerid, Name,sizeof(Name));
format(string, sizeof(string),"Body of %s",Name);
label[playerid] = Create3DTextLabel(string, 0xFF0000FF,x,y,z+3,40.0,0,0);
Object[playerid] = CreateObject(3907, x,y,z+1, 0.0, 0.0, 0.0,100.0);
SetTimer("DestroyObject",5000,0);
return 1;
}
forward DestroyObject(playerid);
public DestroyObject(playerid)
{
DestroyObject(object[playerid]);
Delete3DTextLabel(label[playerid]);
return 1;
}
Hope it will work


Re: Death System - sgtjones12 - 08.08.2012

thank you