Novidades

9/30/2020

CharaDa_Fox

[Lançamento] Sistema de Taser

 Olá galera, hoje venho trazer um FS para RP/G que talvez poderá diferenciar seu servidor se o mesmo estiver criatividade.


       Esse FS é de Taser poderá ter bugs
                              Obs: A versão v.2.0 estará disponível em breve aqui.

Havia postado no fórum antigo mas foi excluído..
Vídeo: https://youtu.be/mke7BZbLHe4 < Final do vídeo
Código:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <foreach>

#define TEMPO_EFEITO 10000 //10s O tempo durante o qual o jogador atingido está sob o efeito do taser.
#define TEMPO_RECARREGAR 2000 //2s O tempo após o qual o taser será dado novamente.
#define ARMA_TASER WEAPON_SILENCED // A arma que funcionará como um taser.
#define ARMA_SLOTS 2 // O slot da arma escolhida.
#define OBJETO_TASER 347 // O ID do objeto da arma escolhida.

new bool:taser[MAX_PLAYERS];
new GiveTaserAgainTimer[MAX_PLAYERS];
new lastWeapon[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
 taser[playerid] = false;
 GiveTaserAgainTimer[playerid] = 0;
 lastWeapon[playerid] = 0;

 // Pré-carregue as bibliotecas de animação usadas.
 ApplyAnimation(playerid, "SWORD", "null", 0.0, 0, 0, 0, 0, 0);
 ApplyAnimation(playerid, "CRACK", "null", 0.0, 0, 0, 0, 0, 0);
    SendClientMessage(playerid, -1, "Esse Servidor Usa Sistema De Taser De {00FF80} Rosascripter");
 return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
 taser[playerid] = false;
 GiveTaserAgainTimer[playerid] = 0;
 lastWeapon[playerid] = 0;
    return 1;
}

public OnPlayerUpdate(playerid)
{
 new w = GetPlayerWeapon(playerid);
 if (w != lastWeapon[playerid]) OnPlayerChangeWeapon(playerid, w, lastWeapon[playerid]);
 lastWeapon[playerid] = w;
 return 1;
}

forward OnPlayerChangeWeapon(playerid, newWeap, oldWeap);
public OnPlayerChangeWeapon(playerid, newWeap, oldWeap)
{
 if (IsPlayerAttachedObjectSlotUsed(playerid, 0) && taser[playerid]) SetPlayerArmedWeapon(playerid, 0);
 return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
 if (weaponid == ARMA_TASER)
 {
  if (taser[issuerid])
  {
   new Float:health;
   GetPlayerHealth(playerid, health);
   SetPlayerHealth(playerid, health+amount);
  }
 }
 return 1;
}

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
 if (weaponid == ARMA_TASER)
 {
  if (taser[playerid])
  {
   GiveTaserAgainTimer[playerid] = SetTimerEx("GiveTaserAgain", TEMPO_RECARREGAR, 0, "i", playerid);
   ApplyAnimation(playerid, "SWORD", "sword_block", 50.0, 0, 1, 0, 1, 1, 1);
   SetPlayerAttachedObject(playerid, 0, OBJETO_TASER, 6);
   SetPlayerArmedWeapon(playerid, 0);

   if (hittype == BULLET_HIT_TYPE_PLAYER) {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(hitid, x, y, z);
    foreach(Player, i) if(IsPlayerInRangeOfPoint(i, 30.0, x, y, z)) PlayAudioStreamForPlayer(i, "https://a.clyp.it/b0w3dcsr.mp3", x, y, z, 30.0, 1);
    ApplyAnimation(hitid, "CRACK", "crckdeth2", 4.1, 0, 1, 1, 1, TEMPO_EFEITO, 1);
    SetPlayerDrunkLevel(hitid, 5000);
    SetTimerEx("EndTaserEffect", TEMPO_EFEITO, 0, "i", hitid);
   }
  }
 }
 return 1;
}

forward EndTaserEffect(playerid);
public EndTaserEffect(playerid)
{
 new skin = GetPlayerSkin(playerid);
 SetPlayerSkin(playerid, skin);
 ClearAnimations(playerid, 1);
 SetPlayerDrunkLevel(playerid, 0);
 return 1;
}

Subscribe to this Blog via Email :
Previous
Next Post »

2 Comments

Write Comments
Unknown
AUTHOR
21 janeiro, 2021 02:21 delete

error 025: function heading differs from prototype
error 017: undefined symbol "BULLET_HIT_TYPE_PLAYER"

Reply
avatar
Unknown
AUTHOR
19 outubro, 2021 03:26 delete

#define FILTERSCRIPT

#include
#include
#include

#define TEMPO_EFEITO 10000 //10s O tempo durante o qual o jogador atingido está sob o efeito do taser.
#define TEMPO_RECARREGAR 2000 //2s O tempo após o qual o taser será dado novamente.
#define ARMA_TASER WEAPON_SILENCED // A arma que funcionará como um taser.
#define ARMA_SLOTS 2 // O slot da arma escolhida.
#define OBJETO_TASER 347 // O ID do objeto da arma escolhida.

new bool:taser[MAX_PLAYERS];
new GiveTaserAgainTimer[MAX_PLAYERS];
new lastWeapon[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
taser[playerid] = false;
GiveTaserAgainTimer[playerid] = 0;
lastWeapon[playerid] = 0;

// Pré-carregue as bibliotecas de animação usadas.
ApplyAnimation(playerid, "SWORD", "null", 0.0, 0, 0, 0, 0, 0);
ApplyAnimation(playerid, "CRACK", "null", 0.0, 0, 0, 0, 0, 0);
SendClientMessage(playerid, -1, "Esse Servidor Usa Sistema De Taser De {00FF80} Rosascripter");
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
taser[playerid] = false;
GiveTaserAgainTimer[playerid] = 0;
lastWeapon[playerid] = 0;
return 1;
}

public OnPlayerUpdate(playerid)
{
new w = GetPlayerWeapon(playerid);
if (w != lastWeapon[playerid]) OnPlayerChangeWeapon(playerid, w, lastWeapon[playerid]);
lastWeapon[playerid] = w;
return 1;
}

forward OnPlayerChangeWeapon(playerid, newWeap, oldWeap);
public OnPlayerChangeWeapon(playerid, newWeap, oldWeap)
{
if (IsPlayerAttachedObjectSlotUsed(playerid, 0) && taser[playerid]) SetPlayerArmedWeapon(playerid, 0);
return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if (weaponid == ARMA_TASER)
{
if (taser[issuerid])
{
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health+amount);
}
}
return 1;
}

public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if (weaponid == ARMA_TASER)
{
if (taser[playerid])
{
GiveTaserAgainTimer[playerid] = SetTimerEx("GiveTaserAgain", TEMPO_RECARREGAR, 0, "i", playerid);
ApplyAnimation(playerid, "SWORD", "sword_block", 50.0, 0, 1, 0, 1, 1, 1);
SetPlayerAttachedObject(playerid, 0, OBJETO_TASER, 6);
SetPlayerArmedWeapon(playerid, 0);

if (hittype == BULLET_HIT_TYPE_PLAYER) {
new Float:x, Float:y, Float:z;
GetPlayerPos(hitid, x, y, z);
foreach(Player, i) if(IsPlayerInRangeOfPoint(i, 30.0, x, y, z)) PlayAudioStreamForPlayer(i, "https://a.clyp.it/b0w3dcsr.mp3", x, y, z, 30.0, 1);
ApplyAnimation(hitid, "CRACK", "crckdeth2", 4.1, 0, 1, 1, 1, TEMPO_EFEITO, 1);
SetPlayerDrunkLevel(hitid, 5000);
SetTimerEx("EndTaserEffect", TEMPO_EFEITO, 0, "i", hitid);
}
}
}
return 1;
}

forward EndTaserEffect(playerid);
public EndTaserEffect(playerid)
{
new skin = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, skin);
ClearAnimations(playerid, 1);
SetPlayerDrunkLevel(playerid, 0);
return 1;
}

Reply
avatar