Raised This Month: $ Target: $400
 0% 

first plugin HELP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gameslayer
Member
Join Date: Dec 2005
Location: Vancouver, wa
Old 12-27-2005 , 02:52   first plugin HELP
Reply With Quote #1

OK i have been looking for plugin that easily changes the skin of a weapon, but found none that i could get to work. so i sarted making my own plugin.i found the source code of aim the ak which switches the skin and aims the ak. i used the code and changed all ak names directories etc. this is what i got
Code:
#include <amxmodx> #include <engine> #define PLUGIN  "Aim the M4" #define VERSION "1.0" #define AUTHOR  "BLADE" new bool:AAK[33] new LastWeapon[33] new Float:PATime[33] new Float: OldPA[33][3] new Float:SwitchTime[33] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR) } public plugin_precache() {     precache_model("models/v_aimm4a1.mdl")     precache_model("models/v_m4a1.mdl") } public client_PreThink(id) {     new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo)     if(Weapon == CSW_m4a1 && Clip > 0)     {         if(get_user_button(id) & IN_ATTACK && AAK[id] && (PATime[id] + 0.1) < get_gametime())         {             new Float:PAPower[3]             entity_get_vector(id, EV_VEC_punchangle, PAPower)             for(new i = 0; i < 3; i++)             {                 PAPower[i] = ((PAPower[i] + OldPA[id][i]) / 2)                 OldPA[id][i] = PAPower[i]             }             entity_set_vector(id, EV_VEC_punchangle, PAPower)                         PATime[id] = get_gametime()             LastWeapon[id] = Weapon         }         else if(get_user_oldbutton(id) & IN_ATTACK)             for(new i = 0; i < 3; i++) OldPA[id][i] = 0.0                 if(get_user_button(id) & IN_ATTACK2)         {             if((SwitchTime[id] + 1.0) < get_gametime())             {                 switch(AAK[id])                 {                     case true: AAK[id] = false                     case false: AAK[id] = true                 }                 SwitchTime[id] = get_gametime()             }         }     }     return PLUGIN_CONTINUE } public client_PostThink(id) {     new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo)     if(Weapon == CSW_m4a1)     {         switch(AAK[id])         {             case true: entity_set_string(id, EV_SZ_viewmodel, "models/v_aimm4a1.mdl")             case false: entity_set_string(id, EV_SZ_viewmodel, "models/v_m4a1.mdl")         }     }     return PLUGIN_CONTINUE }
but when i compile i get eror with CSW_m4a1 in both lines
PLZ HELP this is my first plugin and i am a noob at coding.
gameslayer is offline
[+]
Junior Member
Join Date: Dec 2005
Location: Alaska
Old 12-27-2005 , 04:42  
Reply With Quote #2

Code:
#include <cstrike>

Add that.
[+] is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 12-27-2005 , 10:46  
Reply With Quote #3

No you dont need to include cstrike module...
change CSW_m4a1 to CSW_M4A1
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
gameslayer
Member
Join Date: Dec 2005
Location: Vancouver, wa
Old 12-27-2005 , 14:02  
Reply With Quote #4

OK thank you. i Haven't checked it in game but at least it compiled.
gameslayer is offline
gameslayer
Member
Join Date: Dec 2005
Location: Vancouver, wa
Old 12-27-2005 , 15:26   bind problem
Reply With Quote #5

um how do i rebind it to mouse 3 because mouse 2 on the m4 is binded to the silencer. so half of the plugin is dead.
__________________
+/-karma i am not here for karma i am here for phun.
gameslayer is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 12-27-2005 , 16:26   Re: bind problem
Reply With Quote #6

Quote:
Originally Posted by gameslayer
um how do i rebind it to mouse 3 because mouse 2 on the m4 is binded to the silencer. so half of the plugin is dead.
Not that simple. Its not checking for Mouse2 its checking for +attack2.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
gameslayer
Member
Join Date: Dec 2005
Location: Vancouver, wa
Old 12-27-2005 , 18:00  
Reply With Quote #7

umm so how do i do it?
__________________
+/-karma i am not here for karma i am here for phun.
gameslayer is offline
gameslayer
Member
Join Date: Dec 2005
Location: Vancouver, wa
Old 12-27-2005 , 18:14  
Reply With Quote #8

plz help its a big problem and i don't know what to do
__________________
+/-karma i am not here for karma i am here for phun.
gameslayer is offline
[+]
Junior Member
Join Date: Dec 2005
Location: Alaska
Old 12-27-2005 , 18:31  
Reply With Quote #9

Oh, hmm...I just thought CSW would require the "cstrike" module. Sorry. Thanks for correction Suicid3.
[+] is offline
gameslayer
Member
Join Date: Dec 2005
Location: Vancouver, wa
Old 12-27-2005 , 18:55  
Reply With Quote #10

yay i posted the plugin
http://forums.alliedmods.net/showthr...=194056#200166
__________________
+/-karma i am not here for karma i am here for phun.
gameslayer is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode