SA-MP Forums Archive
OnPlayerDeath [help] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerDeath [help] (/showthread.php?tid=177215)



OnPlayerDeath [help] - Karl1195 - 16.09.2010

Hey guys i got kinda an idea can some one help me please: Okay here is my idea... I want that when some one die he leave's an object behind him of a dead cop object or some thing i can get the object id not a problem but can some one show me how to do it please.

Thanks a lot Karl1195

Msn: khibs@hotmail.com
Skype : khibs11


Re: OnPlayerDeath [help] - [L3th4l] - 16.09.2010

Well, first search for the dead cop object, then do something like so:

pawn Код:
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CreateObject(DEADCOPOBJECTHERE, X, Y, Z, 0.0, 0.0, 0.0, 100.0);
And if you want to delete that object, make a timer!


Re: OnPlayerDeath [help] - Toni - 16.09.2010

This is quite easy, but I'm not in the mood of finding the cop object id, I'm just going to give you the basic idea.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new
        Float:X, Float:Y, Float:Z
    ;
    GetPlayerPos(playerid);
    CreateObject(modelid, X, Y, Z, 0.0, 0.0, 0.0, 100.0);
    return 1;
}
And of course, replace modelid, with the cop object id.

Edit: Lethal Beat me.


Re: OnPlayerDeath [help] - Karl1195 - 16.09.2010

ohh okay but can i do /sendtohaven or some thing for every one so who is in range of that body can remove it?

it's okay toni thanks mate =] thanks both

EDIT: X, Y, Z, 0.0, 0.0, 0.0, 100.0); what u mean by that ? it means that the createobject is in rage of where the player was before he died?


Re: OnPlayerDeath [help] - Toni - 16.09.2010

Quote:
Originally Posted by Karl1195
Посмотреть сообщение
ohh okay but can i do /sendtohaven or some thing for every one so who is in range of that body can remove it?

it's okay toni thanks mate =] thanks both

EDIT: X, Y, Z, 0.0, 0.0, 0.0, 100.0); what u mean by that ? it means that the createobject is in rage of where the player was before he died?
X, Y, Z is the player's position,

and if you look at the params of CreateObject, You will see the 3 zeros after I entered, are the rotations


Re: OnPlayerDeath [help] - Karl1195 - 16.09.2010

ohh thanks mate


Re: OnPlayerDeath [help] - Karl1195 - 17.09.2010

Sorry for duble posting but it's kinda changing discussion.


Okay it compiled now when i entered in the server i kill my self and the object didn't show up i did like this:

Код:
GetPlayerPos(playerid, X, Y, Z);
CreateObject(3092, X, Y, Z, 1976.17431641, -2775.10180664, -0.00731313, 100.0);
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new Float:X, Float:Y, Float:Z;
i am not going to say it didn't work or some thing.. a cigar will come or else a vodka bottle i check twice and the deadcop object is 3029 so i don't know whats wrong


Re: OnPlayerDeath [help] - [L3th4l] - 17.09.2010

the code i gave works perfectly!


Re: OnPlayerDeath [help] - Toni - 17.09.2010

Quote:
Originally Posted by Karl1195
Посмотреть сообщение
Sorry for duble posting but it's kinda changing discussion.


Okay it compiled now when i entered in the server i kill my self and the object didn't show up i did like this:

Код:
GetPlayerPos(playerid, X, Y, Z);
CreateObject(3092, X, Y, Z, 1976.17431641, -2775.10180664, -0.00731313, 100.0);
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	new Float:X, Float:Y, Float:Z;
i am not going to say it didn't work or some thing.. a cigar will come or else a vodka bottle i check twice and the deadcop object is 3029 so i don't know whats wrong
I don't think 1976.1, -2775.1, and -0.0 are valid rotation coordinates lol,

Try starting from 1-50.


Re: OnPlayerDeath [help] - Karl1195 - 17.09.2010

ohh ok let me try i will edit this


EDIT : I CAN ONLY SEE A VODKA BOTTLE... AND I LEFT EVERYTHING EXACTLY LIKE LEATHAL GAVE ME.. I JUST CHANGED OBJECT