SA-MP Forums Archive
[Ajuda] Ja Procurei Nao Achei Sistema De HeadShot Alguem Me Ajuda - 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: [Ajuda] Ja Procurei Nao Achei Sistema De HeadShot Alguem Me Ajuda (/showthread.php?tid=400677)



Muito Obrigado Fui Ajudado [EDITADO] - joaobgnc - 19.12.2012

por favor presciso urgente


Respuesta: Ja Procurei Nao Achei Sistema De HeadShot Alguem Me Ajuda - .Skool_. - 19.12.2012

Mano, й sу abri o search (:
https://sampforum.blast.hk/showthread.php?pid=802102#pid802102


Re: Ja Procurei Nao Achei Sistema De HeadShot Alguem Me Ajuda - joaobgnc - 19.12.2012

mano nao e so abrir o chear o sistema tem que pegar


Re: Ja Procurei Nao Achei Sistema De HeadShot Alguem Me Ajuda - JowSmith - 19.12.2012

PHP код:
#include <a_samp>
#define SERVER_MAX_PLAYERS 100
//#define SHOWPATH
new RecentlyShot[SERVER_MAX_PLAYERS];
public 
OnFilterScriptInit()
{
    print(
"\n\n__________________________________________________________________");
    print(
" Copyright @sa-mp");
    print(
" ---------------------------");
    
LoadModules(0,1);
    print(
"__________________________________________________________________\n\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    print(
"\n\n__________________________________________________________________");
    print(
" Copyright @sa-mp");
    print(
" ---------------------------");
    
LoadModules(0,1);
    print(
"__________________________________________________________________\n\n");
    return 
1;
}
public 
OnPlayerConnect(playerid) {
    
LoadModules(playerid,2);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
RecentlyShot[playerid] = 0;
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    return 
1;
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys KEY_FIRE && newkeys KEY_HANDBRAKE) {
        if(
RecentlyShot[playerid] == 0) {
            
RecentlyShot[playerid] = 1;
            
SetTimerEx("AntiSpam"1000false"d"playerid);
            if(
GetPlayerWeapon(playerid) == 34) {
                new 
Float:blahxFloat:blahyFloat:blahz;
                
HeadshotCheck(playeridblahxblahyblahz);
                return 
1;
            }
            return 
1;
        }
        return 
1;
    }
    return 
1;
}
forward AntiSpam(playerid);
public 
AntiSpam(playerid) {
    
RecentlyShot[playerid] = 0;
    return 
1;
}
stock PlayerName(playerid) {
    new 
name[24];
    
GetPlayerName(playeridnamesizeof(name));
    return 
name;
}
stock HeadshotCheck(playerid, &Float:x, &Float:y, &Float:z)
{
    new 
Float:fx,Float:fy,Float:fz;
    
GetPlayerCameraFrontVector(playeridfxfyfz);
    new 
Float:cx,Float:cy,Float:cz;
    
GetPlayerCameraPos(playeridcxcycz);
    for(new 
Float:0.0500.5)
    {
        
fx cx;
        
fy cy;
        
fz cz;
        
#if defined SHOWPATH
        
CreatePickup(12394xyz, -1);
        
#endif
        
for(new player 0player SERVER_MAX_PLAYERSplayer ++)
        {
            if(
IsPlayerConnected(playerid))
            {
                if(
player != playerid)
                {
                    if(
GetPlayerSpecialAction(player) == SPECIAL_ACTION_DUCK//CROUCHING
                    
{
                        if(
IsPlayerInRangeOfPoint(player0.3xyz))
                        {
                            new 
string[128];
                            
format(stringsizeof(string), "[NEWS]: %s levou um Headshot do %s"PlayerName(player), PlayerName(playerid));
                            
SendClientMessageToAll(0xFF9900AAstring);
                            
GameTextForPlayer(playerid"~r~HEADSHOT!"20006);
                            
GameTextForPlayer(player"~r~HEADSHOT!"20006);
                            
SetPlayerHealth(player0.0);
                            
CallRemoteFunction("OnPlayerDeath""ddd"playerplayerid34);
                        }
                    }
                    else 
//NOT CROUCHING
                    
{
                        if(
IsPlayerInRangeOfPoint(player0.3xy0.7))
                        {
                            new 
string[128];
                            
format(stringsizeof(string), "[NEWS]: %s levou um Headshot do %s"PlayerName(player), PlayerName(playerid));
                            
SendClientMessageToAll(0xFF9900AAstring);
                            
GameTextForPlayer(playerid"~r~HEADSHOT!"20006);
                            
GameTextForPlayer(player"~r~HEADSHOT!"20006);
                            
SetPlayerHealth(player0.0);
                            
CallRemoteFunction("OnPlayerDeath""ddd"playerplayerid34);
                        }
                    }
                }
            }
        }
    }
    return 
1;
}
stock LoadModules(playerid,funcao)
{
    if(
funcao==1) print(" Copyright LegendsHost");
    if(
funcao==2)
    {
        
SendClientMessage(playerid0xFFFFFFFF">Promoзхes: www.legendshost.com.br<");
    }

Vк ai se vai pegar.



Re: Ja Procurei Nao Achei Sistema De HeadShot Alguem Me Ajuda - joaobgnc - 19.12.2012

jow o outro la nao pego se o teu pegar dou rep


Re: Ja Procurei Nao Achei Sistema De HeadShot Alguem Me Ajuda - tonisantolia - 19.12.2012

Quote:
Originally Posted by joaobgnc
Посмотреть сообщение
jow o outro la nao pego se o teu pegar dou rep
Little clucker n pode dar rep cansei de falar isso hj -.-


Re: Ja Procurei Nao Achei Sistema De HeadShot Alguem Me Ajuda - joaobgnc - 19.12.2012

ixi e msm mesmo assim nao funcionou !!!


Re: Ja Procurei Nao Achei Sistema De HeadShot Alguem Me Ajuda - Gabriel10101 - 19.12.2012

Cara,estou usando esse,sem problemas...Tenta ae:
pawn Код:
#include <a_samp>

/*-------------------------
HeadShot System by Peppe
The faster implementation of a headshot system in SA:MP.
This script requires the new version of SA:MP 0.3b.
------------------------*/


#define TIMER_INTERVAL 150

new
    maxPlayers;

public OnFilterScriptInit()
{
    maxPlayers = GetMaxPlayers();
    SetTimer("CheckHeadShot", TIMER_INTERVAL, 1);
    return 1;
}


public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPVarInt(playerid, "Headshotted") == 1) {
        SetPVarInt(playerid, "Headshotted", 0);
        GameTextForPlayer(playerid, "~r~Headshotted", 3000, 3);
        GameTextForPlayer(killerid, "~r~Headshott", 3000, 3);
    }
    return 1;
}


forward CheckHeadShot();
public CheckHeadShot()
{
    new
        index;
    for(new playerid; playerid < maxPlayers; playerid++) {
        if(IsPlayerConnected(playerid)) {
            new Float:npx, Float:npy, Float:npz;
            GetPlayerPos(playerid, npx, npy, npz);
            index = GetPlayerAnimationIndex(playerid);
            for(new i; i < maxPlayers; i++) if(IsPlayerConnected(i) && GetPlayerWeapon(i) == 34 && IsPlayerInRangeOfPoint(i, 200.0, npx, npy, npz) && index == 1173 || index == 1175 || index == 1177 || index == 1178) {
                SetPVarInt(playerid, "Headshotted", 1);
                SetPlayerHealth(playerid, 0);
            }
        }
    }
    return 1;
}
Obs: Nгo fui eu que fiz.


Re: Ja Procurei Nao Achei Sistema De HeadShot Alguem Me Ajuda - joaobgnc - 20.12.2012

bom amigo ele funciona com todas as armas por que so to vendo ali getplayerweapon 34 pode me informa obrigado!!!