[FS] Headshot
#7

alguem saber arrumar isso tando de ESC o personagem leva hs e fica morrendo ai os cara fica fasendo freekill
e queria muda pra a Desert e a Sniper dar HS


PHP код:
#include <a_samp>
#define SERVER_MAX_PLAYERS 100 //MUDE PARA O NUMERO MAXIMO DE JOGADORES DO SEU SERVIDOR
//#define SHOWPATH //DESCOMENTE ISSO SE QUISER MOSTRAR O RASTRO DA BALA
new RecentlyShot[SERVER_MAX_PLAYERS];
public 
OnFilterScriptInit()
{
    print(
"\n\n__________________________________________________________________");
    print(
" Boom Headshot System by inark loaded!");
    print(
" Copyright SAMPLITE 2013");
    print(
" ---------------------------");
    
LoadModules(0,1);
    print(
"__________________________________________________________________\n\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    print(
"\n\n__________________________________________________________________");
    print(
" Boom Headshot System by inark unloaded!");
    print(
" Copyright SAMPLITE 2013");
    print(
" ---------------------------");
    
LoadModules(0,1);
    print(
"__________________________________________________________________\n\n");
    return 
1;
}
public 
OnPlayerConnect(playerid) {
     
SendClientMessage(playerid0xFFFFFFFF"");
    
LoadModules(playerid,2);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
//GivePlayerWeapon(playerid, 34, 15);
    
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), "{00ff00}Headshot:{ffffff} %s levou um Headshot de {00ff00} %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), "{00ff00}HeadShot: {ffffff}%s levou um Headshot de {00ff00}%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("");
    if(
funcao==2)
    {
        
SendClientMessage(playerid0xFFFFFFFF"");
        
SendClientMessage(playerid0xFFFFFFFF"");
    }

Reply


Messages In This Thread
[FS] Headshot - by Shuffle013 - 26.05.2018, 00:08
Re: [FS] Headshot - by FerrariL - 26.05.2018, 00:13
Re: [FS] Headshot - by AutoMatic2 - 26.05.2018, 00:44
Re: [FS] Headshot - by uliano - 26.05.2018, 00:49
Re: [FS] Headshot - by AutoMatic2 - 26.05.2018, 00:55
Re: [FS] Headshot - by Shuffle013 - 26.05.2018, 02:03
Re: [FS] Headshot - by Shuffle013 - 26.05.2018, 02:45
Re: [FS] Headshot - by JohnBlack - 26.05.2018, 15:00
Re: [FS] Headshot - by RodrigoMSR - 26.05.2018, 15:10

Forum Jump:


Users browsing this thread: 2 Guest(s)