Jump to content
News ticker
  • Bienvenue sur le nouveau forum VeryGames
  • Welcome to the new VeryGames forum
  • VeryNews

    tazer help


    Clement76

    Recommended Posts

    Bonjour ,

     

    voila 'jai un plugin tazer mes c'est pas lui je voudrai sa me donne un glock et quand je tire dessus sa le taze et moi jvoudrai la commande !tazer donc j'aimerais avoir de l'aide pour modifier voila merci !

     

     

    /* 
    * 
    * 
    * VISIT hd-gamer.de
    */
    #include <sourcemod>
    #include <cstrike>
    #include <sdkhooks>
    #include <sdktools>
    #include <morecolors>
    #include <smlib>
    new Handle:g_hTimer[MAXPLAYERS+1]
    new Handle:g_hTeam = INVALID_HANDLE;
    new Handle:g_hWeapon = INVALID_HANDLE;
    new Handle:g_hDamage = INVALID_HANDLE;
    new Handle:g_hTazerTime = INVALID_HANDLE;
    new Handle:g_hTazerLaserLifetime = INVALID_HANDLE;
    new Handle:g_hTazerGodmode = INVALID_HANDLE;
    new Handle:g_hTazerClip = INVALID_HANDLE;
    new Handle:g_hTazerAmmo = INVALID_HANDLE;
    new bool:g_bInTazer[MAXPLAYERS+1] = false;
    new g_sprite;
    #include "tazor/tazerfuncs.sp"
    public Plugin:myinfo = 
    {
    name = "Tazer",
    author = "Jackmaster",
    description = "asdfmoviez",
    version = "1.0",
    url = "hd-gamer.de"
    }
    public OnPluginStart()
    {
    HookEvent("player_hurt", PlayerHurt);
    HookEvent("round_end", RoundEnd);
    HookEvent("weapon_fire", WeaponFire);
    g_hWeapon = CreateConVar("sm_tazer_wep", "glock", "Weaponname (without weapon_)");
    g_hTeam = CreateConVar("sm_tazer_team", "3", "2=t, 3=ct, allows ppl tazer", _, true, 2.0, true, 3.0);
    g_hDamage = CreateConVar("sm_tazer_dmg", "1.0", "Damage of tazer", _, true, 1.0);
    g_hTazerTime = CreateConVar("sm_tazer_time", "10.0", "how long player is tazered", _, true, 0.0);
    g_hTazerLaserLifetime = CreateConVar("sm_tazer_life", "0.5", "lifetime of laser(0.0 = off)", _, true, 0.0);
    g_hTazerGodmode = CreateConVar("sm_tazer_godmode", "1", "tazered has godmode", _, true, 0.0);
    g_hTazerClip = CreateConVar("sm_tazer_clip", "2", "clipammo", _, true, 0.0);
    g_hTazerAmmo = CreateConVar("sm_tazer_ammo", "1", "ammo to reload", _, true, 0.0);
    AutoExecConfig(true, "tazer");
    LoadTranslations("tazer.phrases");
    RegConsoleCmd("sm_tazer", Tazor, "Tazer");
    CreateConVar("sm_tazer_version", "1.0", "version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
    for(new i=1;i<MaxClients;i++)
    {
     if(IsClientValid(i))
     {
      SDKHook(i, SDKHook_OnTakeDamage, OnTakeDamagePre);
      SDKHook(i, SDKHook_WeaponCanUse, OnWeaponCanUse);
     }
    }
    g_sprite = PrecacheModel("materials/sprites/laser.vmt");
    
    }
    public OnMapStart()
    {
    g_sprite = PrecacheModel("materials/sprites/laser.vmt");
    }
    public Action:Tazor(client, args)
    {
    new t = GetConVarInt(g_hTeam);
    new pteam = GetClientTeam(client);
    if(pteam == t)
    {
     if(GetPlayerWeaponSlot(client, 1) == -1)
     {
      new String:Weapon[128];
      new String:g_sTemp[128]
      GetConVarString(g_hWeapon, Weapon, sizeof(Weapon))
      Format(g_sTemp, sizeof(g_sTemp), "weapon_%s", Weapon)
      GivePlayerItem(client, g_sTemp);
     }
     else
     {
      CPrintToChat(client, "%t", "HATBEREITSSECONDARY")
     }
     return Plugin_Handled;
    }
    return Plugin_Handled;
    }
    public OnClientPutInServer(client)
    {
    SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamagePre);
    SDKHook(client, SDKHook_WeaponCanUse, OnWeaponCanUse);
    }
    public Action:OnTakeDamagePre(victim, &attacker, &inflictor, &Float:damage, &damagetype)
    {
    new Float:g_iDamage = GetConVarFloat(g_hDamage);
    new String:g_sWeapon[128];
    GetConVarString(g_hWeapon, g_sWeapon, sizeof(g_sWeapon))
    if (IsClientValid(victim) && IsClientValid(attacker))
    {
     new String:sWeapon[128];
     new String:temp[256];
     if(IsClientValid(inflictor) && IsPlayerAlive(inflictor))
     {
      GetClientWeapon(inflictor, sWeapon, sizeof(sWeapon))
      Format(temp, sizeof(temp), "weapon_%s", g_sWeapon)
      if(StrEqual(sWeapon, temp))
      {
       damage = g_iDamage;
       return Plugin_Changed;
      }
     }
    }
    return Plugin_Continue;
    }
    public Action:PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
    {
    new cli = GetClientOfUserId(GetEventInt(event, "userid"));
    new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
    new String:sWeapon[64];
    GetEventString(event, "weapon", sWeapon, sizeof(sWeapon));
    new String:g_sWeapon[128];
    GetConVarString(g_hWeapon, g_sWeapon, sizeof(g_sWeapon))
    if(IsClientValid(cli) && IsClientValid(attacker))
    {
     if(IsPlayerAlive(cli))
     {
      if(!g_bInTazer[cli])
      {
       if(StrEqual(sWeapon, g_sWeapon))
       {
        new Float:g_fTazerTime = GetConVarFloat(g_hTazerTime);
        SetBeam(cli, attacker)
        EnableGod(cli)
        stripweps(cli);
        SetEntityMoveType(cli, MOVETYPE_NONE);
        SetEntityRenderMode(cli, RENDER_TRANSCOLOR);
        SetEntityRenderColor(cli,0, 255, 0, 255);
        g_hTimer[cli] = CreateTimer(g_fTazerTime, resetclient, cli);
        CPrintToChatAll("%t", "ALL_WURDEGETAZERT", attacker, cli)
        g_bInTazer[cli]=true;
       }
      }
      else
      {
       //CPrintToChat(attacker, "Dieser Spieler ist getazert!");
      }
     }
    }
    return Plugin_Continue;
    }
    public Action:resetclient(Handle:timer, any:i)
    {
    if (IsClientInGame(i) && IsPlayerAlive(i))
    {
     GivePlayerItem(i,"weapon_knife");
     SetEntityRenderMode(i, RENDER_TRANSCOLOR);
     SetEntityRenderColor(i, 255, 255, 255, 255);
     SetEntityMoveType(i, MOVETYPE_WALK);
     DisableGod(i)
     g_bInTazer[i]=false;
     CPrintToChat(i, "%t", "NORMAL")
    }
    g_hTimer[i] = INVALID_HANDLE;
    }
    public OnClientDisconnect(client)
    {
    if (g_hTimer[client] != INVALID_HANDLE)
    {
     CloseHandle(g_hTimer[client]);
     g_hTimer[client] = INVALID_HANDLE;
    }
    g_bInTazer[client]=false;
    }
    public Action:OnWeaponCanUse(client, weapon)
    {
    new String:Weapon[128];
    new String:g_sTemp[128]
    GetConVarString(g_hWeapon, Weapon, sizeof(Weapon))
    Format(g_sTemp, sizeof(g_sTemp), "weapon_%s", Weapon)
    new String:gweapon[64];
    GetEntityClassname(weapon, gweapon, sizeof(gweapon))
    new t = GetConVarInt(g_hTeam);
    if(StrEqual(gweapon, g_sTemp))
    {
     if(IsClientValid(client) && IsPlayerAlive(client))
     {
      if(GetClientTeam(client) != t)
      {
       return Plugin_Handled;
      }
     }
    }
    return Plugin_Continue;
    }
    public Action:RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
    {
    for(new i=1;i<MaxClients;i++)
    {
     if(IsClientValid(i))
     {
      g_bInTazer[i]=false;
      DisableGod(i);
     }
    }
    return Plugin_Continue;
    }
    public Action:WeaponFire(Handle:event, const String:name[], bool:dontBroadcast)
    {
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
    new String:g_sTazer[128];
    new String:g_sWeapon[128];
    GetConVarString(g_hWeapon, g_sWeapon, sizeof(g_sWeapon))
    GetEventString(event, "weapon", g_sTazer, sizeof(g_sTazer));
    if(StrEqual(g_sTazer, g_sWeapon))
    {
     if(IsClientValid(client))
     {
      new String:classname[64];
      new a = GetConVarInt(g_hTazerClip);
      new b = GetConVarInt(g_hTazerAmmo);
      GetClientWeapon(client, classname, sizeof(classname));
      Client_SetWeaponPlayerAmmo(client, classname, b, -1);
      Client_SetWeaponClipAmmo(client, classname, a, -1);
     }
    }
    }
    

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...