04.07.2013, 03:41
DeathBody base code
Link: http://pastebin.com/3nZ30PbL
You can create a DeathBody using the function listed down
Note: You need mapandreas plugin (https://sampforum.blast.hk/showthread.php?tid=120013)
There is some test commands in the script
CHANGELOG:
none
For suggestions just post!
Link: http://pastebin.com/3nZ30PbL
You can create a DeathBody using the function listed down
Note: You need mapandreas plugin (https://sampforum.blast.hk/showthread.php?tid=120013)
pawn Code:
Function CreateDeathBody(Float:X, Float:Y, Float:Z, Expire_Seconds = 60)
This function create a death body in the x y z position
you can also add a expire time (default 60 seconds)
Function DeleteDeathBody(DeathBody_ID)
This function delete a death body by giving a deathbody ID
Function DeleteAllDeathBody()
This function delete all existing death body
Function FindFreeDeathBody()
This function find a free death body id from the MAX_DEATH_BODY
Function FindNearDeathBodyID(playerid,Float:Range)
This function find a near body you can give the range
Function PickupDeathBody(playerid)
This function pickup a body from the ground
Function DropDeathBody(playerid)
This function drop a body to the ground
pawn Code:
/*
Create a normal death body (60 sec expire)
*/
if(strcmp(cmdtext,"/TestDeathBody",true) == 0)
{
new Float:POS[3];
GetPlayerPos(playerid,POS[0],POS[1],POS[2]);
CreateDeathBody(POS[0],POS[1],POS[2]);
return 1;
}
/*
Create a timed death body (5 sec expire)
*/
if(strcmp(cmdtext,"/TestDeathBody5",true) == 0)
{
new Float:POS[3];
GetPlayerPos(playerid,POS[0],POS[1],POS[2]);
CreateDeathBody(POS[0],POS[1],POS[2],5);//Check CreateDeathBody function
return 1;
}
/*
Pickup the death body from the ground
*/
if(strcmp(cmdtext,"/pickupbody",true) == 0)
{
PickupDeathBody(playerid);
return 1;
}
/*
Drop the death body in the ground and the timing for exipre will start again
*/
if(strcmp(cmdtext,"/dropbody",true) == 0)
{
DropDeathBody(playerid);
return 1;
}
CHANGELOG:
none
For suggestions just post!