SA-MP Forums Archive
[Tutorial] Funзхes novas 0.3z RC - 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)
+----- Forum: Lançamentos/Releases (https://sampforum.blast.hk/forumdisplay.php?fid=56)
+----- Thread: [Tutorial] Funзхes novas 0.3z RC (/showthread.php?tid=488223)



Funзхes novas 0.3z - JonathanFeitosa - 17.01.2014

@ATUALIZADO PARA 0.3Z RC4

- Fixed problem where long distance shots might go missing
- Nametag LoS tests will also apply to server objects
- OnPlayerGiveDamage is now called for NPCs
- Added GetPlayerLastShotVectors for extended information on bullet shots
- Added legacy mode for shot firing (shotcompmode 2 server.cfg setting) which uses only the camera for aiming and allows joypad auto-aiming
- Fixed: players could not be shot while surfing a vehicle
- Added some extended player camera information like aspect ratio and zoom level (for sniper)
- Extended 'netstats' functions so the script can get lower level network information without having to parse the stats string

pawn Код:
native GetPlayerLastShotVectors(playerid, &Float:fOriginX, &Float:fOriginY, &Float:fOriginZ, &Float:fHitPosX, &Float:fHitPosY, &Float:fHitPosZ);

native Float:GetPlayerCameraAspectRatio(playerid);
native Float:GetPlayerCameraZoom(playerid);

// Extended admin network stats
native NetStats_GetConnectedTime(playerid);
native NetStats_MessagesReceived(playerid);
native NetStats_BytesReceived(playerid);
native NetStats_MessagesSent(playerid);
native NetStats_BytesSent(playerid);
native NetStats_MessagesRecvPerSecond(playerid);
native Float:NetStats_PacketLossPercent(playerid);
native NetStats_ConnectionStatus(playerid);
native NetStats_GetIpPort(playerid, ip_port[], ip_port_len);
@ATUALIZADO PARA 0.3Z RC3

Fixed: Joypad target switching still enabled autoaiming.
- Fixed: Sniper bullets were not working when vectored outside the SA land area.
- Extra server data for investigating any player shot data corruption.
- Added VectorSize pawn function.

# Depois edito, estou ocupado.

@ATUALIZADO PARA 0.3Z RC2

Eu disse lб em baixo do tуpico e ele leu ! AEUHAEUHAEUH JoyPad Jб Era, e nгo existe mais tiro no LAG. :/
Foi Adicionado um quarto parвmetro em OnPlayerWeaponShot.
Sabe aqueles RakNet que enchem o servidor de IP falsos? Poiser, agora pode ser evitado nessa versгo. Tentaram arrumar no 0.3e, mas nгo conseguiram.


Fala pessoal, tгo sabendo que o SA:MP lanзou o 0.3z BETA repleto de BUG's e algumas novidades nй?
Entгo, й sobre essas novidades que irei criar esse tуpico bem simpleszinho pra todos entenderem.

pawn Код:
forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart); // bodypart add
forward OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart); // bodypart add
OnPlayerWeaponShot

Facilmente explicando, ela detecta tiro acertado em players, objetos e veнculos.

pawn Код:
#define BULLET_HIT_TYPE_NONE            0 // DETECT FAIL, SE FODEU kkk'.
#define BULLET_HIT_TYPE_PLAYER          1 // DETECTAR TIRO AO PLAYER
#define BULLET_HIT_TYPE_VEHICLE         2 / DETECTAR TIRO AO VEICULO
#define BULLET_HIT_TYPE_OBJECT          3 // DETECTAR TIRO AO OBJETO
#define BULLET_HIT_TYPE_PLAYER_OBJECT   4 // DETECTAR TIRO APENAS NOS OBJETOS QUE APARECE PARA UM DETERMINADO PLAYER
forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
// weaponid = Vocк pode escolher uma arma especial para destroir tal objeto.
// hittype = Sгo as 4 defines que botei acima. vocк pode indentificar por ID ou nome.
// hitid = Й o alvo(veiculos, objetos..) acertado.
SISTEMA SIMPLES DE DESTRUIR O CARRO SEM NINGUЙM DENTRO




Todo mundo sabe que o carro sу destroi com alguem dentro no SAMP... Na 0.3z nгo mais!

pawn Код:
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
{
        if(hittype = BULLET_HIT_TYPE_VEHICLE) // Ao acertar qualquer veiculo com tiro
        {
            SetVehicleHealth(hitid, 7); // ele irб comeзar a pegar FOGO.
        }
        return true;
}
SISTEMA DE DESTRUIR OBJETO COM UM TIRO




Que tal fazer o objeto sumir com um tiro ?

pawn Код:
public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ )
{
    if(hittype == BULLET_HIT_TYPE_OBJECT) // Detecta tiro ao objeto
    {
        if( IsValidObject( hitid ) ) // Ver se o objeto й vбlido.
        {
            SendClientMessage( playerid, -1, "Vocк acertou o objeto e ele vazou!" );
            DestroyObject( hitid ); // Destrou o Objeto acertado.
        }
    }
    return 1;
}

Adicionado Bodypart em OnPlayerGiveDamage e OnPlayerTakeDamage



Simplesmente falando, ele detecta o tiro acertado nas partes do corpo.

SISTEMA DE HEADSHOT

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(bodypart == BODY_PART_HEAD) // Detecta se acertou a cabeзa do PLAYER
    {
        SetPlayerHealth(playerid, 0); // Seta vida 0, morre na hora!
        new
            Recebeu[MAX_PLAYER_NAME],
            Deu[MAX_PLAYER_NAME],
            CelulasJFS[100]
        ;
        GetPlayerName(playerid, Recebeu, sizeof (Recebeu)), GetPlayerName(issuerid, Deu, sizeof (Deu));
        format(CelulasJFS, sizeof(CelulasJFS), "%s Levou um HS do player %s.", Recebeu, Deu);
        SendClientMessageToAll(-1, CelulasJFS);
    }
    return 1;
}
// PS: Sistema nгo testado, qualquer erro sу avisar.
Ouvi falar tambйm que tiraram o tiro no LAG agora nй? acho que nгo pensaram no JoyPad.

Downloads:

0.3z RC3 Client
SA-MP 0.3z RC3 Client Installer

0.3z RC3 Server
SA-MP 0.3z RC3 Windows Server
SA-MP 0.3z RC3 Linux Server

0.3z RC2 Client
SA-MP 0.3z RC2 Client Installer

0.3z RC2 Server
SA-MP 0.3z RC2 Windows Server
SA-MP 0.3z RC2 Linux Server

0.3z RC1 Client
SA-MP 0.3z RC1 Client Installer

0.3z RC1 Server
SA-MP 0.3z RC1 Windows Server
SA-MP 0.3z RC1 Linux Server
Projeto e Dicas

Eu vejo que o SAMP estб decaindo, mas eu irei ajudar de uma forma bem inteligente. Irei criar um site de Divulgaзгo de servidores reunindo mais de 10MIL visitas por semana. Ele irб contar com um sistema bem inovador. Atй a prуxima semana irei apresenta-lo melhor. E й claro, graзas ao Humor GTA.

Agora, eu estou com preguiзa, mais eu espero que criem alguns sistemas inovadores com esse meu mini-tutorial, sendo eles sistema de tiro ao alvo, melhoramento de tirar vida do carro e sistema de apenas Bazuca pode destruir carros blindados dos COP.

Ah, e eu nгo sumi. Sу me adicionar no Skype para contato.


Re: Funзхes novas 0.3z RC - zSuYaNw - 17.01.2014

Atй que enfim alguйm criou algo nesse estilo :P


Re: Funзхes novas 0.3z RC - JonathanFeitosa - 17.01.2014

Quote:
Originally Posted by zSuYaNw
Посмотреть сообщение
Atй que enfim alguйm criou algo nesse estilo :P
Vai codar o servidor auheaehuehua' e adia pro dia 22 isso pra ser melhor


Re: Funзхes novas 0.3z RC - lucas_mdr1235 - 17.01.2014

parabйns pela explicaзгo ! ! ! Vocк esclareceu minha duvida do OnPlayerWeaponShot


Re: Funзхes novas 0.3z RC - Diogo123 - 17.01.2014

Boa,tirou umas dъvidas que eu tinha sobre algumas funзхes.



Re: Funзхes novas 0.3z RC - Dolby - 17.01.2014

De todo meu tempo de SA-MP, definitivamente estб foi a update mais ъtil que Kalcor fez, espero que ele siga o ritmo, apesar de eu ter parado com SA-MP.

Bom tutorial Jhonatan.


Re: Funзхes novas 0.3z RC - ScriptGameS - 17.01.2014

Muito Bom


Re: Funзхes novas 0.3z RC - 22 - 17.01.2014

Bem legal, jб estou usando a 0.3z R2.


Re: Funзхes novas 0.3z RC - n0minal - 17.01.2014

Muito bom JF, na verdade nгo sгo funзхes, sгo apenas novas callbacks com novos parвmetros, mas tб уtimo


Re: Funзхes novas 0.3z RC - JonathanFeitosa - 17.01.2014

Quote:
Originally Posted by n0minal
Посмотреть сообщение
Muito bom JF, na verdade nгo sгo funзхes, sгo apenas novas callbacks com novos parвmetros, mas tб уtimo
Sendo que essas Callbacks "tem suas funзхes", e eu estou explicando elas.
E eu disse logo no inнcio "simpleszinho para que todos entendam", muito poser nгo sabe o que й Callbacks.

Quote:
Originally Posted by Dolby
Посмотреть сообщение
Bom tutorial Jhonatan.
Й JONATHAN :@

Quote:
Originally Posted by 22
Посмотреть сообщение
Bem legal, jб estou usando a 0.3z R2.
Cuidado em..