User
Pass
2FA
 
 

Modificare plugin knife

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support
Author Message821
dannyd08

[Mentally Stable]



Status: Offline
(since 04-03-2016 14:01)
Joined: 21 Nov 2015
Posts: 22, Topics: 10
Location: Romania

Reputation: 4.7

Post Posted: 01-02-2016, 15:37:53 | Translate post to: ... (Click for more languages)

As vrea sa imi adaugati in pluginul asta knifeMenu:
Spoiler:


la cutitul 1 abilitatea asta:
Spoiler:

Sau macar cum pot sa adaug am incercat dar tot ma vedeam cand stam nemiscat cu knife in mana

0 0
  
Back to top
View user's profile Send private message
EDUTz

[HardcoreAmxxScripter]



Status: Offline
(since 15-08-2021 16:34)
Joined: 27 Dec 2010
Posts: 4306, Topics: 244
Location: Jud. Miserupia, sat Bagadanc

Reputation: 4085
Votes: 179

         
Post Posted: 01-02-2016, 23:42:58 | Translate post to: ... (Click for more languages)

Netestat, l-am facut din ochi, verifica si posteaza aici daca e ok.


Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <fakemeta_util>
#include <engine>

#pragma semicolon 1

#define VIP_FLAG ADMIN_LEVEL_H
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers ) // e pentru damage, sa nu dea erori in consola
new g_iMaxPlayers;

//////////////Poket Knife////////////////////
new const ModelKnife1[66] = "models/KnifeMenu/v_invizibility.mdl";
//////////////Poket Knife////////////////////
new const ModelKnife2[66] = "models/KnifeMenu/v_hp.mdl";
//////////////Poket Knife////////////////////
new const ModelKnife3[66] = "models/KnifeMenu/v_speed.mdl";
//////////////Poket Knife////////////////////
new const ModelKnife4[66] = "models/KnifeMenu/v_gravity.mdl";

//////////////Poket Knife////////////////////
new const KnifeModelVip[66] = "models/KnifeMenu/v_vip_knife.mdl";

new bool: Knife1[33];
new bool: Knife2[33];
new bool: Knife3[33];
new bool: Knife4[33];

new bool: KnifeVip[33];

new bool: ChoosenKnife[33];

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "danyelgame"


public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR);
   
   register_clcmd("say /knife","SayKnifeMenu");
   
   register_event("CurWeapon", "CurentWeapon", "be", "1=1");
   RegisterHam(Ham_Spawn, "player", "Spawn", 1);
   RegisterHam(Ham_TakeDamage, "player", "KnifeDamageMultiplier");
register_forward(FM_PlayerPreThink, "FWD_PlayerPreThink");
}

public Spawn(id) {
   if(is_user_alive(id))
      {
      ChoosenKnife[id] = false;
       
      Knife1[id] = false;
      Knife2[id] = false;
      Knife3[id] = false;
      Knife4[id] = false;
       
      KnifeVip[id] = false;
       
      if(cs_get_user_team(id) == CS_TEAM_T) {
         MenuKnife(id);
      }
   }
}

public plugin_precache() {
   precache_model(ModelKnife1);
   precache_model(ModelKnife2);
   precache_model(ModelKnife3);
   precache_model(ModelKnife4);
   
   precache_model(KnifeModelVip);
}

public client_putinserver(id) {
   Knife1[id] = false;
   Knife2[id] = false;
   Knife3[id] = false;
   Knife4[id] = false;
   
   KnifeVip[id] = false;
}

public client_disconnect(id) {
   Knife1[id] = false;
   Knife2[id] = false;
   Knife3[id] = false;
   Knife4[id] = false;
   
   KnifeVip[id] = false;
}

public MenuKnife(id)
   {
   new menu = menu_create ("\yKnife \rMenu", "CaseMenu");
   
   menu_additem(menu, "\yPlayer \rMenu", "1");
   menu_additem(menu, "\yV\w.\yI\w.\yP \rMenu", "2");
   
   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
   menu_display(id, menu, 0 );
   
   return 1;
}

public CaseMenu(id, menu, item) {
   if(item == MENU_EXIT) {
      return 1;
   }
   
   new data [6], szName [64];
   new access, callback;
   menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
   new key = str_to_num (data);
   
   switch (key)
   {
      case 1:
      {
         PlayerMenu(id);
      }
       
      case 2:
      {
         if( get_user_flags( id ) & VIP_FLAG ) {
            VIPMenu(id);
         }
         else
         {
            ChatColor(id, "!g[KnifeMenu]!nAcest meniu poate fi accesat doar de membri !gVIP");
            MenuKnife(id);
         }
      }
   }
   
   menu_destroy (menu);
   return 1;
}
public PlayerMenu(id) {
   new menu = menu_create ("\rPlayer \rMenu \yKnife", "PlayerKnife");
   menu_additem(menu, "\yInvizibility \rKnife", "1");
   menu_additem(menu, "\yHP \rKnife", "2");
   menu_additem(menu, "\ySpeed \rKnife", "3");
   menu_additem(menu, "\yGravity \rKnife", "4");
   
   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
   menu_display(id, menu, 0 );
   
   return 1;
}

public PlayerKnife(id, menu, item) {
   if(item == MENU_EXIT) {
      return 1;
   }
   if(!(is_user_alive(id))) {
      ChatColor(id, "!g[Knife Menu] !nNu poti alege cutitul atunci când esti mort");
      return 1;
   }
   
   new data [6], szName [64];
   new access, callback;
   menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
   new key = str_to_num (data);
   
   switch (key)
   {
      case 1:
      {
         ChoosenKnife[id] = true;
         Knife1[id] = true;
         CurentWeapon(id);
         ChatColor(id, "!g[Furien Knife] !nAi Ales !gInvizibility Knife");
      }
       
      case 2:
      {
         ChoosenKnife[id] = true;
         Knife2[id] = true;
         CurentWeapon(id);
         ChatColor(id, "!g[Furien Knife] !nAi Ales !gHP Knife");
      }
       
      case 3:
      {
         ChoosenKnife[id] = true;
         Knife3[id] = true;
         CurentWeapon(id);
         ChatColor(id, "!g[Furien Knife] !nAi ales !gSpeed Knife");
      }
      case 4:
      {
         ChoosenKnife[id] = true;
         Knife4[id] = true;
         CurentWeapon(id);
         ChatColor(id, "!g[Knife Menu] !nAi ales !gGravity Knife");
      }
   }
   
   menu_destroy (menu);
   return 1;
}


public VIPMenu(id) {
   new menu = menu_create ("\rVIP \yKnife \rMenu", "VIPKnife");
   menu_additem(menu, "\wDefault \rKnife", "1");
   
   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
   menu_display(id, menu, 0 );
   
   return 1;
}

public VIPKnife(id, menu, item) {
   if(item == MENU_EXIT) {
      return 1;
   }
   
   if(!(is_user_alive(id))) {
      ChatColor(id, "!g[Knife Menu] !nNu poti alege cutitul atunci când esti mort");
      return 1;
   }
   
   new data [6], szName [64];
   new access, callback;
   menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
   new key = str_to_num (data);
   
   switch (key)
   {
      case 1:
      {
         ChoosenKnife[id] = true;
         KnifeVip[id] = true;
         CurentWeapon(id);
         ChatColor(id, "!g[Knife Menu] !nAi ales !gV.I.P Knife");
      }
       
   }
   
   menu_destroy (menu);
   return 1;
}

public CurentWeapon(id) {
   if(Knife1[id] && get_user_weapon(id) == CSW_KNIFE)
      set_pev(id, pev_viewmodel2, ModelKnife1);
   
   if(Knife2[id] && get_user_weapon(id) == CSW_KNIFE)
      set_pev(id, pev_viewmodel2, ModelKnife2);
   
   if(Knife3[id] && get_user_weapon(id) == CSW_KNIFE)
      set_pev(id, pev_viewmodel2, ModelKnife3);
   
   if(Knife4[id] && get_user_weapon(id) == CSW_KNIFE)
      set_pev(id, pev_viewmodel2, ModelKnife4);
   
   if(KnifeVip[id] && get_user_weapon(id) == CSW_KNIFE)
      set_pev(id, pev_viewmodel2, KnifeModelVip);
       
   /////puteri knife//////
   
   if(get_user_weapon(id) == CSW_KNIFE && (Knife1[id] == true && fm_get_speed(id) <= 5))
   
   ////////////NU AICI !///////////////
   

   if(get_user_weapon(id) == CSW_KNIFE && Knife2[id] == true)
      {
      set_user_footsteps(id,1);
      set_user_maxspeed(id,250.0);
      set_user_gravity(id,1.0);
   }
   if(get_user_weapon(id) == CSW_KNIFE && Knife3[id] == true)
      {
      set_user_footsteps(id,0);
      set_user_maxspeed(id,550.0);
      set_user_gravity(id,1.0);
   }
   if(get_user_weapon(id) == CSW_KNIFE && Knife4[id] == true)
      {
      set_user_footsteps(id,0);
      set_user_maxspeed(id,250.0);
      set_user_gravity(id,0.45);
   }
   ///////vip///////
   if(get_user_weapon(id) == CSW_KNIFE && KnifeVip[id] == true)
      {
      set_user_footsteps(id,1);
      set_user_maxspeed(id,600.0);
      set_user_gravity(id,0.45);
   }
   return PLUGIN_HANDLED  ;
}

public DamageKnife ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )  {
   if ( IsPlayer ( iAttacker ) ) {
      if(iInflictor == iAttacker && Knife1[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
         SetHamParamFloat(4, fDamage * 2.0);
         return HAM_HANDLED;
      }
       
      if(iInflictor == iAttacker && Knife2[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T )  {
         SetHamParamFloat(4, fDamage * 2.0);
         return HAM_HANDLED;
      }
       
      if(iInflictor == iAttacker && Knife3[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
         SetHamParamFloat(4, fDamage * 2.0);
         return HAM_HANDLED;
      }
      if(iInflictor == iAttacker && Knife4[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
         SetHamParamFloat(4, fDamage * 2.0);
         return HAM_HANDLED;
      }
       
      if(iInflictor == iAttacker && KnifeVip[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
         SetHamParamFloat(4, fDamage * 4.0);
         return HAM_HANDLED;
      }
   }
   return HAM_IGNORED;
}

public SayKnifeMenu(id) {
   if(ChoosenKnife[id])  {
      ChatColor(id, "!g[Knife Menu] !nAti ales deja un cutit în aceasta runda");
      return;
   }
   
   if(cs_get_user_team(id) == CS_TEAM_T)  {
      MenuKnife(id);
   }
}

stock ChatColor(const id, const input[], any:...) {
   new count = 1, players[32];
   static msg[191];
   vformat(msg, 190, input, 3);
   
   replace_all(msg, 190, "!g", "^4"); // verde
   replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
   replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
   replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
   
   if (id) players[0] = id; else get_players(players, count, "ch");
   {
      for (new i = 0; i < count; i++)
         {
         if (is_user_connected(players[i]))
            {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
            write_byte(players[i]);
            write_string(msg);
            message_end();
         }
      }
   }
}

public FWD_PlayerPreThink(id) {   
   if(Knife1[id] && get_user_weapon(id) == CSW_KNIFE && fm_get_speed(id) <= 5) {   
      set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransTexture, 0 );       
      }
      else {
      set_user_rendering( id );
      }
}




Pentru pluginuri complicate le fac cu $$ pe paypal/psc. PM

0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
dannyd08

[Mentally Stable]



Status: Offline
(since 04-03-2016 14:01)
Joined: 21 Nov 2015
Posts: 22, Topics: 10
Location: Romania

Reputation: 4.7

Post Posted: 02-02-2016, 12:25:48 | Translate post to: ... (Click for more languages)

La fãcut deja cineva adicã cel care a fãcut ambele pluginuri : -DaNNy-
Dar Mulțumesc oricum la to picurare mele ai fost cel mai activ Mihai rãspuns cam la toate Îți meriți gradul nota 10 de la mine -

0 0
  
Back to top
View user's profile Send private message

  Topic locked


Topic is closed, you cannot post any messages in it anymore

Locked by EDUTz, 02 February 2016 17:57



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> CS 2006-2019 (Archived) -> Plugins - Help / Support  


The time now is 11-01-2025, 10:53:45
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password


This message appears only once, so
like us now until it's too late ! :D
x