I - Description
THIS PLUGIN IS STABLE FOR ZOMBIE MOD AND WEAPONS PAINTS
I made this plugin for my community Zombie4Ever.eu and was allowed to share it.
Give you a knife and save your choice by Team.
This plugin allow you to choose the commands with the translation file
"translations/drapi/drapi_knives.phrases.txt".
What's means?
1 - Menu General
Example for popup the menu:
PHP Code:
"fr" "couteau, couteaux, knives, knifes, knife"
"en" "knives, knifes, knife"
You can type in chat
!knives, /knives or knive... For me as French I can type
!couteau, /couteau or couteau...
This, will show you a menu too choose your Team.
2 - Menu CT
Example for popup the CT menu
PHP Code:
"fr" "ctcouteau, ctcouteaux, ctknives, ctknifes, ctknife"
"en" "ctknives, ctknifes, ctknife"
etc.. note you dont" need in the transaltion file to write ! or /.
This, will show you a menu too choose the knife for CT Team.
3 - Chat
The trigger chat command works for giving knives directly too.
Example for giving Bayonet
PHP Code:
"fr" "bayonet, bayo, baļonnette"
"en" "bayonet, bayo"
You can type
!bayo, /bayo or bayo.... For me as French I can type
!baļonnette, /baļonnette or baļonnette...
This, will give you the Bayonet Knife and save your choice for the actual Team.
II - Cvars
Knives are select by their
"m_iItemDefinitionIndex"
drapi_knives_ct_default "512" - "Default knife for CT
drapi_knives_t_default "512" - "Default knife for T
500 = Bayonet
505 = Flip
506 = Gut
507 = Karambit
508 = M9 Bayonet
509 = Huntsman
512 = Falchion
515 = Butterfly
drapi_knives_storage_mode "2" - 0=Disable / 1=Cookie / 2=SQL
Choose how to store the clients preferences. Choosing SQL will save/get clients preferences for all yours servers if you are using the same database.
drapi_knives_access_mode "0" - 0=All / 1=VIP / 2=ADMIN
drapi_knives_give_mode "1" - 0=Don't give the knife / 1=Give the knife
Usefull for some MG map or others who strip you the weapons. Will not give the knife but will save the preference.
"drapi_knives_check_knife_mode" "1" - Check the knife before giving away. SUCCESS if knife doesn't have a name.
III - Notes
This plugin use
Geolanguage.
How to know if your server is using
Geolanguage?
Type in game
!language or see in your
"/csgo/addons/sourcemod/plugins" if a plugin named Geolanguage.smx is there.
IV - Mysql
Now supporting Mysql.
After installing the plugin, type in console :
sm_create_knives_tables to create the Tables.
Don"t forget to edit
"/csgo/addons/sourcemod/configs/databases.cfg"
PHP Code:
"knives"
{
"driver" "mysql"
"host" "127.0.0.1"
"database" "knives"
"user" "xxx"
"pass" "xxx"
}
V - Mods
ZOMBIE RELOADED : choose
drapi_knives_zr.smx
With normal version when you get infected you will get the CT knife cause the infection is too fast to detect the right Team.
Zombie Reloaded:
OK
Zombie Riot:
OK
1Vs1:
OK
Weapons paints:
OK
Working on a plugins weapons paints + statrak kill: HERE
Version BETA, Everything works well, need to store the kill stat for each weapons(including rifles, pumps, pistols, etc....) on database/cookie also the paintkit id too.
I cannot release this here cause weapons paints was trashed form this forum, it will be the same if I post. PM me/add me on Steam for more informations.
VI - Bugs
When you type only ! or / the menu will popup. I will fix soon:
FIXED
VII - To Do
Use Mysql instead of Cookie:
FIXED
VIII - Flags
If you don't use like us this following for vip or admin you can change it in the code.
PHP Code:
/***********************************************************/
/******************** CHECK IF IS A VIP ********************/
/***********************************************************/
stock bool IsVip(int client)
{
if(GetUserFlagBits(client) & ADMFLAG_CUSTOM1
|| GetUserFlagBits(client) & ADMFLAG_CUSTOM2
|| GetUserFlagBits(client) & ADMFLAG_CUSTOM3
|| GetUserFlagBits(client) & ADMFLAG_CUSTOM4
|| GetUserFlagBits(client) & ADMFLAG_CUSTOM5
|| GetUserFlagBits(client) & ADMFLAG_CUSTOM6)
{
return true;
}
return false;
}
/***********************************************************/
/****************** CHECK IF IS AN ADMIN *******************/
/***********************************************************/
stock bool IsAdminEx(int client)
{
if(GetUserFlagBits(client) & ADMFLAG_CHANGEMAP
/*|| GetUserFlagBits(client) & ADMFLAG_RESERVATION*/
|| GetUserFlagBits(client) & ADMFLAG_GENERIC
|| GetUserFlagBits(client) & ADMFLAG_KICK
|| GetUserFlagBits(client) & ADMFLAG_BAN
|| GetUserFlagBits(client) & ADMFLAG_UNBAN
|| GetUserFlagBits(client) & ADMFLAG_SLAY
|| GetUserFlagBits(client) & ADMFLAG_CHANGEMAP
|| GetUserFlagBits(client) & ADMFLAG_CONVARS
|| GetUserFlagBits(client) & ADMFLAG_CONFIG
|| GetUserFlagBits(client) & ADMFLAG_CHAT
|| GetUserFlagBits(client) & ADMFLAG_VOTE
|| GetUserFlagBits(client) & ADMFLAG_PASSWORD
|| GetUserFlagBits(client) & ADMFLAG_RCON
|| GetUserFlagBits(client) & ADMFLAG_CHEATS
|| GetUserFlagBits(client) & ADMFLAG_ROOT)
{
return true;
}
return false;
}
IX - Changelogs
Quote:
V1.3.6
- Set correctly the check function for the chat trigger.
V1.3.5
- Detect before giving away the knife if the player have one. Usefull for some maps who strip the knife.
-Added one translation sentence.
V1.3.4
-Detect knife who belong to the map and have a name. "drapi_knives_check_knife_mode"
Usually entites with a "targetname" means they have some attachements.
-Added one translation sentence.
V1.3.3
-cvar "drapi_knives_give_mode" will block the give away in any circumstances.
V1.3.2
-Added two translations sentences.
V1.3.1
-Added cvar "drapi_knives_give_mode"
-Added one translation sentence.
V1.3.0
-Fix problem with taser who use the same slot as knife. Thanks Neuro Toxin
-Added access for VIP/ADMIN "drapi_knives_access_mode".
-Fix trigger chat.
V1.2.0
-Fix problem with takeover bot.
-Added some forwards for future modules.
V1.1.1
Change "knifes" to "knives"
Thx to Pan32 to remember this.
V1.1.0
Mysql support.
Zombie Reloaded support.
|
X - Credits
Neuro Toxin
For the solution with the taser using the same slot as knife.
Quote:
Originally Posted by Neuro Toxin
You need to loop all weapons in the knife slot and remove any tasers. Check for item definition 31 which is a taser. Once you equip the new knife. Give the player a taser if you removed one
I logged a report like 2 years ago asking for valve to fix this. They then made the taser droppable as a fix for some reason and didn't actually fix the bug.
|
PS: Post your error logs to quiclky fix the problem if you have.
XI - Donate
If you like my work.