[FilterScript] (Useful) DeathBody base code - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] (Useful) DeathBody base code (
/showthread.php?tid=448355)
(Useful) DeathBody base code -
iJumbo - 04.07.2013
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)
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
There is some test commands in the script
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!
Re: (Useful) DeathBody base code -
Pottus - 04.07.2013
Good but not useful for most people.
Re: (Useful) DeathBody base code -
iJumbo - 04.07.2013
useful for who want do some with death body
Re: (Useful) DeathBody base code -
Passout - 04.07.2013
this is cool for roleplay
Re: (Useful) DeathBody base code -
xqz - 04.07.2013
Quote:
Originally Posted by iJumbo
useful for who want do some with death body
|

Nekro..
Cool! It's very useful for roleplay's serwers!
Re: (Useful) DeathBody base code -
dEcooR - 04.07.2013
heheheh nice idea to make some this