[Ajuda] Sistem de Hs Bugado
#1

Ola pra quem esta vendo este topico ,entao eu ajeitei um sistema de hs soque ta assim eu atiro na cabзa fala q foi hs se eu acerto na perna leva hs





PHP Code:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
    new 
string[20];
    
format(stringsizeof(string), "~s~-~r~%.0f"amount);
    
GameTextForPlayer(playeridstring10006);
    
GameTextForPlayer(issuerid string10005);
    
PlayerPlaySound(issuerid 178020.00.00.0); 
PHP Code:
    DamageTick[playerid] = TickCounter;
    }
    
    if(
issuerid != INVALID_PLAYER_ID && weaponid == 34 || weaponid == 24 || weaponid == 33 && bodypart == && Arena2[playerid] == && Arena[playerid] == && mortohs[playerid] == false){
    if(
Arena[playerid] != 1) {
      
SetPlayerHealth(playerid0.0);
      new 
wpname[50];
      
GetWeaponName(weaponid,wpname,sizeof(wpname));
      new 
strm[200], matado[MAX_PLAYER_NAME], matador[MAX_PLAYER_NAME];
      
GetPlayerName(issuerid,matador,sizeof(matador));
      
GetPlayerName(playerid,matado,sizeof(matado));
      
format(strm,sizeof(strm),"{FFFFFF}|SERVER|» {FFFF00}%s {FF0000}Levou um Headshot de {FFFF00}%s {FF0000}(%s)",matado,matador,wpname);
      
SendClientMessageToAll(-1,strm);
      
GameTextForPlayer(issuerid"~g~~n~~n~~n~~n~~n~~n~HeadShot Porra!"50006);//Nem Mexe
      
GameTextForPlayer(playerid"~r~~n~~n~~n~~n~~n~~n~HeadShot Porra!"100006);//Nem Mexe
        //PlayAudioStreamForPlayer(playerid, "http://soundfxcenter.com/video-games/counter-strike/7e1521_Counter_Strike_Headshot_Sound_Effect.mp3");//
      
mortohs[playerid] = true;
      }
  }
 return 
1;

eu nao sei se й esse
Code:
Bodyparty
Reply
#2

alguem ajuda ae porfavor
Reply
#3

tenta assim:

se nгo der a funзгo pra verificar se acerto a cabeзa do cara e essa:

Code:
if(bodypart == BODY_PART_HEAD)
PHP Code:
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 || weaponid == 24 || weaponid == 33 && Arena2[playerid] == && Arena[playerid] == && mortohs[playerid] == false)
{
    if(
bodypart == BODY_PART_HEAD)
    {
        if(
Arena[playerid] != 1)
        {        
            
SetPlayerHealth(playerid0.0);
            new 
wpname[50];
            
GetWeaponName(weaponid,wpname,sizeof(wpname));
            new 
strm[200], matado[MAX_PLAYER_NAME], matador[MAX_PLAYER_NAME];
            
GetPlayerName(issuerid,matador,sizeof(matador));
            
GetPlayerName(playerid,matado,sizeof(matado));
            
format(strm,sizeof(strm),"{FFFFFF}|SERVER|» {FFFF00}%s {FF0000}Levou um Headshot de {FFFF00}%s {FF0000}(%s)",matado,matador,wpname);
            
SendClientMessageToAll(-1,strm);
            
GameTextForPlayer(issuerid"~g~~n~~n~~n~~n~~n~~n~HeadShot Porra!"50006);//Nem Mexe
            
GameTextForPlayer(playerid"~r~~n~~n~~n~~n~~n~~n~HeadShot Porra!"100006);//Nem Mexe
            
mortohs[playerid] = true;
        }
    }
    return 
1;

Reply
#4

Sim, й o parвmetro bodypart.
Na condiзгo estб correto, pois o ID da cabeзa й o 9.
Essa condiзгo estб muito grande e acho que й por conta disso que sempre retorna verdadeiro...

Organize melhor sua condicional:
Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) 
{ 

    if(issuerid != INVALID_PLAYER_ID) 
    { 
	    new string[20]; 
	    format(string, sizeof(string), "~s~-~r~%.0f", amount); 
	    GameTextForPlayer(playerid, string, 1000, 6); 
	    GameTextForPlayer(issuerid , string, 1000, 5); 
	    PlayerPlaySound(issuerid , 17802, 0.0, 0.0, 0.0);  
	    DamageTick[playerid] = TickCounter; 

	    if(Arena2[playerid] == 0 && Arena[playerid] == 0)
    	{
		    if(weaponid == 34 || weaponid == 24 || weaponid == 33)
		    {
			    if(bodypart == 9 && mortohs[playerid] == false)
			    { 
				      SetPlayerHealth(playerid, 0.0); 
				      new wpname[50]; 
				      GetWeaponName(weaponid,wpname,sizeof(wpname)); 
				      new strm[200], matado[MAX_PLAYER_NAME], matador[MAX_PLAYER_NAME]; 
				      GetPlayerName(issuerid,matador,sizeof(matador)); 
				      GetPlayerName(playerid,matado,sizeof(matado)); 
				      format(strm,sizeof(strm),"{FFFFFF}|SERVER|» {FFFF00}%s {FF0000}Levou um Headshot de {FFFF00}%s {FF0000}(%s)",matado,matador,wpname); 
				      SendClientMessageToAll(-1,strm); 
				      GameTextForPlayer(issuerid, "~g~~n~~n~~n~~n~~n~~n~HeadShot Porra!", 5000, 6);//Nem Mexe 
				      GameTextForPlayer(playerid, "~r~~n~~n~~n~~n~~n~~n~HeadShot Porra!", 10000, 6);//Nem Mexe 
				      //PlayAudioStreamForPlayer(playerid, "http://soundfxcenter.com/video-games/counter-strike/7e1521_Counter_Strike_Headshot_Sound_Effect.mp3");// 
				      mortohs[playerid] = true; 
			  	}
		  	}
		}
    }
 	return 1; 
}
Reply
#5

Ok vo Testar
Reply
#6

esta dando este erro


C:\Users\pc\Desktop\PvP Total S.A\gamemodes\PvP_SA.pwn(7066) : error 017: undefined symbol "Arena2"
C:\Users\pc\Desktop\PvP Total S.A\gamemodes\PvP_SA.pwn(7066) : warning 215: expression has no effect
C:\Users\pc\Desktop\PvP Total S.A\gamemodes\PvP_SA.pwn(7066) : error 001: expected token: ";", but found "]"
C:\Users\pc\Desktop\PvP Total S.A\gamemodes\PvP_SA.pwn(7066) : error 029: invalid expression, assumed zero
C:\Users\pc\Desktop\PvP Total S.A\gamemodes\PvP_SA.pwn(7066) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#7

1° tem que saber se usou o jeito do F1NAL ou a minha mesmo '-'
Reply
#8

consegui arruma man vlw
Reply
#9

Acho que esse

Code:
if(Arena[playerid] != 1)
nгo tem utilidade entгo eu tirei e fico assim:

PHP Code:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
issuerid != INVALID_PLAYER_ID)
    {
        new 
string[20];
        
format(stringsizeof(string), "~s~-~r~%.0f"amount);
        
GameTextForPlayer(playeridstring10006);
        
GameTextForPlayer(issuerid string10005);
        
PlayerPlaySound(issuerid 178020.00.00.0);
        if(
issuerid != INVALID_PLAYER_ID && weaponid == 34 || weaponid == 24 || weaponid == 33 && Arena2[playerid] == && Arena[playerid] == && mortohs[playerid] == false)
        {
            if(
bodypart == BODY_PART_HEAD)
            {
                
SetPlayerHealth(playerid0.0);
                new 
wpname[50];
                
GetWeaponName(weaponid,wpname,sizeof(wpname));
                new 
strm[200], matado[MAX_PLAYER_NAME], matador[MAX_PLAYER_NAME];
                
GetPlayerName(issuerid,matador,sizeof(matador));
                
GetPlayerName(playerid,matado,sizeof(matado));
                
format(strm,sizeof(strm),"{FFFFFF}|SERVER|» {FFFF00}%s {FF0000}Levou um Headshot de {FFFF00}%s {FF0000}(%s)",matado,matador,wpname);
                
SendClientMessageToAll(-1,strm);
                
GameTextForPlayer(issuerid"~g~~n~~n~~n~~n~~n~~n~HeadShot Porra!"50006);//Nem Mexe
                
GameTextForPlayer(playerid"~r~~n~~n~~n~~n~~n~~n~HeadShot Porra!"100006);//Nem Mexe
                
mortohs[playerid] = true;
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)