SA-MP Forums Archive
[HELP] Bleeding system - 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)
+--- Thread: [HELP] Bleeding system (/showthread.php?tid=317292)



[HELP] Bleeding system - ServerScripter - 10.02.2012

Hi , i wanna whene a player hit an other one , attach blood to hited player 3 or 6 times . how to do it thanks ?

NB : if you know a tutorial just give me it please .


Re: [HELP] Bleeding system - Sufyan - 11.02.2012

you mean this?
Код:
new oid[ 10 ]; 
public OnPlayerTakeDamage( playerid, issuerid, Float: amount, weaponid )
{
    new Float:P[3];

    GetPlayerPos(playerid, P[0], P[1], P[2]);
    new Float: hp ;
    GetPlayerHealth(playerid, hp), hp -= amount;
    if( amount >= 3  ) 
   {
     			oid [ 0 ] = CreateObject ( 18668 , P [ 0 ] , P [ 1 ], P [ 2 ], 0 , 0, 0, 25.0 ) ;
			oid [ 1 ] = CreateObject ( 18668 , P [ 0 ]+2 , P [ 1 ], P [ 2 ] , 0 , 0, 0, 25.0 ) ;
			oid [ 2 ] = CreateObject ( 18668 , P [ 0 ] , P [ 1 ]+2, P [ 2 ] , 0 , 0, 0, 25.0 ) ;
			oid [ 3 ] = CreateObject ( 18668 , P [ 0 ] , P [ 1 ], P [ 2 ]+2 , 0 , 0, 0, 25.0 ) ;
			oid [ 4 ] = CreateObject ( 18668 , P [ 0 ] , P [ 1 ], P [ 2 ]-2 , 0 , 0, 0, 25.0 ) ;
			oid [ 5 ] = CreateObject ( 18668 , P [ 0 ] , P [ 1 ]-2, P [ 2 ] , 0 , 0, 0, 25.0 ) ;
			oid [ 6 ] = CreateObject ( 18668 , P [ 0 ]-2 , P [ 1 ], P [ 2 ] , 0 , 0, 0, 25.0 ) ;
            SetTimerEx("DestroyObj",2000,false,"i",playerid);
    }
    return 1;
}
forward DestroyObj();
public DestroyObj()
{
for(new i; i < 7 ; i++)
{
DestroyObject(oid[i]);
}
return 1;
}



Re: [HELP] Bleeding system - ServerScripter - 11.02.2012

can you explain to me the code ?