[Ajuda] Sistema De Head Shot So Pega Com Arma Id 34 Como Faзo Pra Pegar Com Outras??
#1

Bem Galera Esse e o Codigo
PHP код:
#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_INTERVAL1);
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    if(
GetPVarInt(playerid"Headshotted") == 1) {
        
SetPVarInt(playerid"Headshotted"0);
        
GameTextForPlayer(playerid"~r~Headshotted"30003);
        
GameTextForPlayer(killerid"~r~Headshott"30003);
    }
    return 
1;
}
forward CheckHeadShot();
public 
CheckHeadShot()
{
    new
        
index;
    for(new 
playeridplayerid maxPlayersplayerid++) {
        if(
IsPlayerConnected(playerid)) {
            new 
Float:npxFloat:npyFloat:npz;
            
GetPlayerPos(playeridnpxnpynpz);
            for(new 
imaxPlayersi++) if(IsPlayerConnected(i) && GetPlayerWeapon(i) == 34 && IsPlayerInRangeOfPoint(i200.0npxnpynpz) && index == 1173 || index == 1175 || index == 1177 || index == 1178) {
                
SetPVarInt(playerid"Headshotted"1);
                
SetPlayerHealth(playerid0);
            }
        }
    }
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)