SA-MP Forums Archive
[Pedido] Super soco - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Super soco (/showthread.php?tid=255188)



[Pedido] Super soco - iacocesar123 - 14.05.2011

Olб venho mais uma vez pedindo um favor, preciso de um sistema de super soco ou seja quando o player bate em outro tira pelomenos 30 de dano.


Re: [Pedido] Super soco - Carl_Thuse - 14.05.2011

#include <OPSP>
Use SEARCHe!


Re: [Pedido] Super soco - The Knight - 14.05.2011

PHP Code:
new
    
Floatx,
    
Floaty,
    
Floatz,
    
Keys,
    
ud,
    
lr,
    
Floathealth,
    
Floatarmour
;
public 
OnPlayerUpdateplayerid )
{
    
GetPlayerKeysplayeridKeysudlr );
    if( 
Keys == KEY_FIRE && GetPlayerWeaponplayerid ) == ) {
        for( new 
i=0500i++ ) {
            if( 
IsPlayerConnected) ) {
                
GetPlayerPosplayeridxy);
                if( 
playerid != ){
                    if( 
IsPlayerInRangeOfPointi1.5xy) ) {
                        
GetPlayerArmourplayeridarmour );
                        
GetPlayerHealthihealth );
                        if( 
armour ) {
                            
SetPlayerArmouriarmour-40 );
                            return 
false;
                        }
                        
SetPlayerHealthihealth-40 );
                    }
                }
            }
        }
    }
    return 
true;

Crйditos: DraKiNs & Higor.


Re: [Pedido] Super soco - Macintosh - 14.05.2011

http://forum.sa-mp.com/showthread.ph...t=soco+drakins


pawn Code:
new
    Float: x,
    Float: y,
    Float: z,
    Keys,
    ud,
    lr,
    Float: health,
    Float: armour
;
public OnPlayerUpdate( playerid )
{
    GetPlayerKeys( playerid, Keys, ud, lr );
    if( Keys == KEY_FIRE && GetPlayerWeapon( playerid ) == 0 ) {
        for( new i=0; i < 500; i++ ) {
            if( IsPlayerConnected( i ) ) {
                GetPlayerPos( playerid, x, y, z );
                if( playerid != i ){
                    if( IsPlayerInRangeOfPoint( i, 1.5, x, y, z ) ) {
                        GetPlayerArmour( playerid, armour );
                        GetPlayerHealth( i, health );
                        if( armour > 0 ) {
                            SetPlayerArmour( i, armour-30 );
                            return false;
                        }
                        SetPlayerHealth( i, health-30 );
                    }
                }
            }
        }
    }
    return true;
}
Editado pra -30 *-*


Re: [Pedido] Super soco - TheGarfield - 14.05.2011

olhe minha assinatura xD