User
Pass
2FA
 
 

[rezolvat]Cerere modificare plugin

 
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 Message395
jy0nsS

[Mentally Stable]



Status: Offline
(since 30-08-2017 16:06)
Joined: 26 Nov 2015
Posts: 222, Topics: 63
Location: Romania

Reputation: 75.4
Votes: 1

Post Posted: 08-10-2016, 10:02:10 | Translate post to: ... (Click for more languages)

Buna ziua, imi puteti modifica plugin-ul acesta in asa fel in cat la inceput de runda la tero sa primesti automat 100AP iar la CT sa primesti 100AP si Defuse?

Code:
#include <  amxmodx  >
#include <  amxmisc  >
#include <  fun  >
#include <  cstrike  >

#define PLUGIN "Plug-in Nou Vip"
#define VERSION "0.1"
#define AUTHOR ":troll"

new Trie:eData;
new File[120];
new Password;
new bool:IsUserVip[33] = false;

new sync;

public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_clcmd ( "/vmenu", "ShowVipMenu" );
   
   sync = CreateHudSyncObj();
   
   set_task(1.0,"show_hud",_,_,_,"b");
   
   Password = register_cvar("password_field", "_pw");
   eData = TrieCreate()

   add_trie()
}

public add_trie() {
   new FilePointer,szName[32],szPassword[32],FileData[256]
   
   get_configsdir(File,charsmax(File))
   format(File,charsmax(File),"%s/%s",File,"vips.ini")
   
   if(!file_exists(File))
   {
      FilePointer = fopen(File,"w")
      fprintf(FilePointer,";Aici adaugi VIP,NUME PAROLA")
      fclose(FilePointer)
   }
   
   FilePointer = fopen(File,"rt")
   if(FilePointer)
   {
      while(!feof(FilePointer))
      {
         fgets(FilePointer,FileData,charsmax(FileData))
         parse(FileData,szName,charsmax(szName),szPassword,charsmax(szPassword))
         TrieSetString(eData,szName,szPassword)
      }
      fclose(FilePointer)
   }
}

public client_connect(id) {
   new szName[32],szPassword[32],PlayerPassword[32],Pass[5]
   get_user_name(id,szName,charsmax(szName))
   get_pcvar_string(Password,Pass,charsmax(Pass))
   get_user_info(id,Pass,PlayerPassword,charsmax(PlayerPassword))
   
   if(TrieKeyExists(eData,szName))
   {
      TrieGetString(eData,szName,szPassword,charsmax(szPassword))
      
      if(equal(PlayerPassword,szPassword))
      {
         IsUserVip[id] = true
      }
      else
      {
         server_cmd("kick #%i ^"setinfo_pw parola^"",get_user_userid(id))
         IsUserVip[id] = false
      }
   }
}

public client_infochanged(id)  {
   new newname[32],szPassword[32],PlayerPassword[32],Pass[5]
   get_pcvar_string(Password,Pass,charsmax(Pass))
   get_user_info(id,Pass,PlayerPassword,charsmax(PlayerPassword))
   get_user_info(id,"name",newname,charsmax(newname))
   
   if(TrieKeyExists(eData,newname))
   {
      TrieGetString(eData,newname,szPassword,charsmax(szPassword))
      
      if(equal(PlayerPassword,szPassword))
      {
         IsUserVip[id] = true
      }
      else
      {
         server_cmd("kick #%i ^"NU esti VIP^"",get_user_userid(id))
         IsUserVip[id] = false
      }
   }
   else
   {
      IsUserVip[id] = false
   }
}

public client_disconnect ( id ) IsUserVip[id] = false;

public plugin_end()
   TrieDestroy(eData)

public ShowVipMenu ( id ) {
   
   if(IsUserVip[id]) {
      new menu = menu_create ( "PTM VIP MENU", "Menu_Giver" );
      menu_additem ( menu, "AWP", "1", 0 );
      menu_additem ( menu, "Deagle", "2", 0 );
      menu_additem ( menu, "Set Grenade", "3", 0 );
   
      menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
      menu_display ( id, menu, 0 );
      
      return 1;
   }
   return 0;
}

public Menu_Giver( id, menu, item )
{     
   if( item == MENU_EXIT || !is_user_alive(id))
   {
      return 1;
   }
   switch( item )
   {
      case 0 :
      {
         give_item( id, "weapon_awp" );
         cs_set_user_bpammo( id, CSW_AWP, 60 );
      }
      case 1 :
      {
         give_item ( id, "weapon_deagle" );
         cs_set_user_bpammo ( id, CSW_DEAGLE, 35 ); 
      }
      case 2 :
      {
         give_item(id, "weapon_hegrenade");       
         give_item(id, "weapon_smokegrenade");
         cs_set_user_bpammo(id,CSW_HEGRENADE,2);
         cs_set_user_bpammo(id,CSW_SMOKEGRENADE,2);
      }   
   }
   menu_destroy ( menu );
   return 1;
}

public show_hud() {
   new buffer[512],iPlayers[32],name[32],iNum,count,id,len
   get_players(iPlayers,iNum,"ch")
   for(new i = 0;i < iNum; i++)
   {
      id = iPlayers[i]
      if(IsUserVip[id])
      {
         get_user_name(id,name,charsmax(name))
         count++
         len +=formatex(buffer[len],charsmax(buffer),"%s^n",name)
      }
   }
}


Multumesc anticipat !

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

[DEV]



Status: Offline
(since 12-03-2020 22:13)
Joined: 24 May 2014
Posts: 4042, Topics: 119
Location: ---------

Reputation: 515.9
Votes: 118

   
Post Posted: 09-10-2016, 04:49:06 | Translate post to: ... (Click for more languages)

Spoiler:



Retired from Amxmodx

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

[Mentally Stable]



Status: Offline
(since 30-08-2017 16:06)
Joined: 26 Nov 2015
Posts: 222, Topics: 63
Location: Romania

Reputation: 75.4
Votes: 1

Post Posted: 09-10-2016, 08:16:46 | Translate post to: ... (Click for more languages)

Iti multumesc foarte frumos destroi. Puteti da T/C !
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 destroi112, 09 October 2016 14:17



 
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 17-06-2025, 08:04:19
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