OnPlayerDeath [help]
#1

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
Reply
#2

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!
Reply
#3

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.
Reply
#4

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?
Reply
#5

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
Reply
#6

ohh thanks mate
Reply
#7

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
Reply
#8

the code i gave works perfectly!
Reply
#9

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)