[FilterScript] (Useful) DeathBody base code
#1

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


Messages In This Thread
(Useful) DeathBody base code - by iJumbo - 04.07.2013, 03:41
Re: (Useful) DeathBody base code - by Pottus - 04.07.2013, 03:53
Re: (Useful) DeathBody base code - by iJumbo - 04.07.2013, 03:55
Re: (Useful) DeathBody base code - by Passout - 04.07.2013, 04:29
Re: (Useful) DeathBody base code - by xqz - 04.07.2013, 06:52
Re: (Useful) DeathBody base code - by dEcooR - 04.07.2013, 07:15

Forum Jump:


Users browsing this thread: 1 Guest(s)