|
gimik
|
 |
« on: November 28, 2009, 05:37:19 PM » |
|
Alright, I got another one for you guys.
I need to make an ability that when you attack someone you destroy weapon type or take foes weapon on hit. 5% chance - 25% chance
I know how to destroy a weapon, but not that weapon type.
if you could code it for me Thanks! <333
|
|
|
|
|
Logged
|
|
|
|
|
AvasT
|
 |
« Reply #1 on: November 28, 2009, 07:54:25 PM » |
|
Let me see, you want to make the victim get a specific weapon restricted and dropped if he is using it?
|
|
|
|
|
Logged
|
Lol?
|
|
|
|
gimik
|
 |
« Reply #2 on: November 28, 2009, 08:16:16 PM » |
|
Yeah restrict the weapon he is using, and make him drop it xD
|
|
|
|
|
Logged
|
|
|
|
|
AvasT
|
 |
« Reply #3 on: November 28, 2009, 08:36:30 PM » |
|
Ok just wait a lil bit.
|
|
|
|
|
Logged
|
Lol?
|
|
|
|
AvasT
|
 |
« Reply #4 on: November 28, 2009, 08:55:12 PM » |
|
Well, i don't know if its Pretty Correct, but from what i know about WCS it may work. Instructions: Create a new Folder in eventscripts folder Called YourScript, inside of it create a notepad called es_YourScript.txt. Then add this: Block block load { es_xset prohibited_AWP 0 es_xset prohibited_M4A1 0 es_xset prohibited_AK47 0 es_xset prohibited_Deagle 0 es_xset prohibited_Dual 0 es_xset prohibition_chance 0 }
event es_map_start { downloadable "YourScriptSounds/prohibited.wav" }
block prohibition { if (server_var(prohibited_AWP) = 1) do { if (event_var(weapon) = weapon_awp) do { es est_dropweapon event_var(userid) 1 es est_restrict event_var(userid) weapon_awp es est_playplayer event_var(userid) YourScriptSounds/prohibited.wav es est_playplayer event_var(attacker) YourScriptSounds/prohibited.wav es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You are#lightgreenNot Allowed #defaultto use #lightgreenAWP Sniper es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You #lightgreenProhibited event_var(es_username) #defaultof using #lightgreenAWP Sniper } }
if (server_var(prohibited_M4A1) = 2) do { if (event_var(weapon) = weapon_m4a1) do { es est_dropweapon event_var(userid) 1 es est_restrict event_var(userid) weapon_m4a1 es est_playplayer event_var(userid) YourScriptSounds/prohibited.wav es est_playplayer event_var(attacker) YourScriptSounds/prohibited.wav es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You are#lightgreenNot Allowed #defaultto use #lightgreenM4A1 Rifle es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You #lightgreenProhibited event_var(es_username) #defaultof using #lightgreenM4A1 Rifle } }
if (server_var(prohibited_AK47) = 3) do { if (event_var(weapon) = weapon_ak47) do { es est_dropweapon event_var(userid) 1 es est_restrict event_var(userid) weapon_ak47 es est_playplayer event_var(userid) YourScriptSounds/prohibited.wav es est_playplayer event_var(attacker) YourScriptSounds/prohibited.wav es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You are#lightgreenNot Allowed #defaultto use #lightgreenAK47 Rifle es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You #lightgreenProhibited event_var(es_username) #defaultof using #lightgreenAK47 Rifle } }
if (server_var(prohibited_Deagle) = 4) do { if (event_var(weapon) = weapon_deagle) do { es est_dropweapon event_var(userid) 1 es est_restrict event_var(userid) weapon_deagle es est_playplayer event_var(userid) YourScriptSounds/prohibited.wav es est_playplayer event_var(attacker) YourScriptSounds/prohibited.wav es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You are#lightgreenNot Allowed #defaultto use #lightgreenDeagle es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You #lightgreenProhibited event_var(es_username) #defaultof using #lightgreenDeagle } }
if (server_var(prohibited_Dual5) = 5) do { if (event_var(weapon) = weapon_elite) do { es est_dropweapon event_var(userid) 1 es est_restrict event_var(userid) weapon_elite es est_playplayer event_var(userid) YourScriptSounds/prohibited.wav es est_playplayer event_var(attacker) YourScriptSounds/prohibited.wav es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You are#lightgreenNot Allowed #defaultto use #lightgreenDual Elites es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You #lightgreenProhibited event_var(es_username) #defaultof using #lightgreenDual Elites } } } The Skill_cfg is player_attacker... Skill: "skill4_setting" "es_xset prohibited_AWP 1;es_xset prohibited_M4A1 2;es_xset prohibited_AK47 3;es_xset prohibited_Deagle 4;es_xset prohibited_Dual 5;es_xset prohibition_chance x" "racealias_prob" "es_xdoblock YourScript/prohibition "skill4_cmd" "if (server_var(wcs_dice) <= server_var(prohibition_chance)) then racealias_prob" "skill4_sfx" "0" Then create a new folder in sounds folder called YourScriptSounds, then add the sound prohibited.wav ... OBS: Download the SOUND! Enjoy 
|
|
|
|
|
Logged
|
Lol?
|
|
|
|
gimik
|
 |
« Reply #5 on: November 28, 2009, 09:17:57 PM » |
|
People will use more than m4a1/ak/awp/deagle/elite... Should i just C&P: if (server_var(prohibited_AWP) = 1) do { if (event_var(weapon) = weapon_awp) do { es est_dropweapon event_var(userid) 1 es est_restrict event_var(userid) weapon_awp es est_playplayer event_var(userid) YourScriptSounds/prohibited.wav es est_playplayer event_var(attacker) YourScriptSounds/prohibited.wav es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You are#lightgreenNot Allowed #defaultto use #lightgreenAWP Sniper es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You #lightgreenProhibited event_var(es_username) #defaultof using #lightgreenAWP Sniper And change for different weapons?
|
|
|
|
|
Logged
|
|
|
|
|
AvasT
|
 |
« Reply #6 on: November 28, 2009, 10:37:25 PM » |
|
Yes. and add in the setting es_xset prohibited_Nameofthegun 6..
|
|
|
|
|
Logged
|
Lol?
|
|
|
|
gimik
|
 |
« Reply #7 on: November 28, 2009, 10:41:57 PM » |
|
Gunna take me forever, but alright <3
Thanks for all the help!
|
|
|
|
|
Logged
|
|
|
|
|
AvasT
|
 |
« Reply #8 on: November 28, 2009, 11:34:55 PM » |
|
No problem  , just tell me which guns you want
|
|
|
|
|
Logged
|
Lol?
|
|
|
|
Zawmbee
Guest
|
 |
« Reply #9 on: November 29, 2009, 12:53:12 AM » |
|
No problem  , just tell me which guns you want Any the user is using... you have to get event_var(weapon) of the user and restrict it...
|
|
|
|
|
Logged
|
|
|
|
|
gimik
|
 |
« Reply #10 on: November 29, 2009, 12:58:40 AM » |
|
Well i think i did it correct, here's what i typed to restrict the P90. if (server_var(prohibited_P90) = 7) do { if (event_var(weapon) = weapon_P90) do { es est_dropweapon event_var(userid) 1 es est_restrict event_va(userid) weapon_P90 es est_playplayer event_var(userid) YourScriptSounds/prohibited.wav es est_playplayer event_var(attacker) YourSciptSounds/prohibited.wav es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You are#lightgreenNot Allowed #defaultto use #lightgreenP90 es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default Youare#lightgreenNot Allowed #defaultto use #lightgreenP90 } }
|
|
|
|
|
Logged
|
|
|
|
|
Zawmbee
Guest
|
 |
« Reply #11 on: November 29, 2009, 01:20:08 AM » |
|
Well i think i did it correct, here's what i typed to restrict the P90. if (server_var(prohibited_P90) = 7) do { if (event_var(weapon) = weapon_P90) do { es est_dropweapon event_var(userid) 1 es est_restrict event_va(userid) weapon_P90 es est_playplayer event_var(userid) YourScriptSounds/prohibited.wav es est_playplayer event_var(attacker) YourSciptSounds/prohibited.wav es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You are#lightgreenNot Allowed #defaultto use #lightgreenP90 es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default Youare#lightgreenNot Allowed #defaultto use #lightgreenP90 } } Heh, it can be a whole lot more simple with only 1 set of coding... Lookee here: event player_attacker { if (server_var(dice) <= 20) do { es_xset weapon_type event_var(weapon) es es_delayed .1 est_stripplayer event_var(userid) es es_delayed .2 est_restrict event_var(userid) server_var(weapon_type) } }
|
|
|
|
« Last Edit: November 29, 2009, 01:21:45 AM by Zawmbee »
|
Logged
|
|
|
|
|
DanMister
|
 |
« Reply #12 on: November 29, 2009, 05:15:44 AM » |
|
Well i think i did it correct, here's what i typed to restrict the P90. if (server_var(prohibited_P90) = 7) do { if (event_var(weapon) = weapon_P90) do { es est_dropweapon event_var(userid) 1 es est_restrict event_va(userid) weapon_P90 es est_playplayer event_var(userid) YourScriptSounds/prohibited.wav es est_playplayer event_var(attacker) YourSciptSounds/prohibited.wav es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default You are#lightgreenNot Allowed #defaultto use #lightgreenP90 es_tell event_var(attacker) #multi #lightgreen[#defaultProhibition#lightgreen]#default Youare#lightgreenNot Allowed #defaultto use #lightgreenP90 } } Heh, it can be a whole lot more simple with only 1 set of coding... Lookee here: event player_attacker { if (server_var(dice) <= 20) do { es_xset weapon_type event_var(weapon) es es_delayed .1 est_stripplayer event_var(userid) es es_delayed .2 est_restrict event_var(userid) server_var(weapon_type) } } wait wait wait wait! so you tell him he can code it easier with less code. but when i tell you that you can code your configuration with less code you get all defensive? whats the deal man?!?!? i mean i'm not angry but honestly?
|
|
|
|
|
Logged
|
theres a thing called copy and paste. I think someone named Bill Gates made it…. -DanMister "Genius may have its limitations, but stupidity is not thus handicapped." Elbert Hubbard
|
|
|
|
Zawmbee
Guest
|
 |
« Reply #13 on: November 29, 2009, 07:14:20 PM » |
|
Your problem was I wasn't coding it like you, making it harder for you to understand... I did not criticize him or say anything negative, just gave him another solution in which if he wants to take it he can...
|
|
|
|
|
Logged
|
|
|
|
|
AvasT
|
 |
« Reply #14 on: November 29, 2009, 07:27:55 PM » |
|
Yes zawmbee it can be very simplified, i think he wants to restrict everyting?
|
|
|
|
|
Logged
|
Lol?
|
|
|
|