Raised This Month: $ Target: $400
 0% 

curweapon help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Samurai [/]
Member
Join Date: Sep 2006
Old 04-17-2007 , 15:33   curweapon help
Reply With Quote #1

PHP Code:
public event_curweapon(id
{     
new 
wpn read_data(2); 
if(
wpn != CSW_USP)
return 
PLUGIN_CONTINUE
strip_user_weapons
(id)
give_item (id"weapon_knife")
return 
PLUGIN_CONTINUE;  

How can i make same thing to glock, but glock would give 2flashbangs and 1 smokegrenade instead.

and if terrorist side player got knife it would do same
__________________
Samurai [/] is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 04-17-2007 , 16:34   Re: curweapon help
Reply With Quote #2

you could use get_user_team(id) to find his team

PHP Code:
public event_curweapon(id
{     
new 
team cs_get_user_team(id)
if(
team == CS_TEAM_CT)
return 
PLUGIN_CONTINUE
strip_user_weapons
(id)
give_item (id"weapon_knife")
return 
PLUGIN_CONTINUE;  

__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
Samurai [/]
Member
Join Date: Sep 2006
Old 04-17-2007 , 17:03   Re: curweapon help
Reply With Quote #3

Quote:
Originally Posted by Nican View Post
you could use get_user_team(id) to find his team

PHP Code:
public event_curweapon(id
{     
new 
team cs_get_user_team(id)
if(
team == CS_TEAM_CT)
return 
PLUGIN_CONTINUE
strip_user_weapons
(id)
give_item (id"weapon_knife")
return 
PLUGIN_CONTINUE;  

and how i put these all to curweapon ?
__________________
Samurai [/] is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 04-17-2007 , 17:10   Re: curweapon help
Reply With Quote #4

You can find weapon list at:
http://www.amxmodx.org/funcwiki.php?go=module&id=4

so i think it should be something like:
PHP Code:
public event_curweapon(id
{     
new 
wpn read_data(2); 
if(
wpn == CSW_USP){
  
strip_user_weapons(id)
  
give_item (id"weapon_knife")
} else if (
wpn == CSW_GLOCK18){
  
strip_user_weapons(id)
  
give_item (id"weapon_hegrenade")
}


__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
scrtxxcaz
Senior Member
Join Date: Feb 2007
Location: a place u cant find
Old 04-18-2007 , 01:45   Re: curweapon help
Reply With Quote #5

not sure if this is exactly what u want but u can arrange it the way you want it

Code:
public plugin_int() {
           register_plugin(PLUGIN, VERSION, AUTHOR)
           register_event("CurWeapon","current_weapon")
}
public current_weapon(id){
           new team = get_user_team(id,team,31)
           new ammo,clip,weapon
           get_user_weapon(weapon,ammo,clip)
           if(weapon == CSW_GLOCK18)
           {
                     if(team == 2)   //CT
                     {
                               strip_user_weapons(id)
                               give_item(id,"weapon_flashbang")
                               give_item(id,"weapon_flashbang")
                               give_item(id,"weapon_smokegrenade")
                      }
           }
           else if(weapon == CSW_KNIFE)
          {
                    if(team == 1)   //Terroist
                    {
                                strip_user_weapons(id)
                                give_item(id,"weapon_flashbang")
                                give_item(id,"weapon_flashbang")
                                give_item(id,"weapon_smokegrenade")
                     }
          }
}
__________________
Please leave your name when giving me any karma

Counter Strike Freeze Tag
Status: Testing.... (bugs)

Revised Registration
Status: In Progress
scrtxxcaz is offline
Send a message via AIM to scrtxxcaz
Samurai [/]
Member
Join Date: Sep 2006
Old 04-18-2007 , 07:04   Re: curweapon help
Reply With Quote #6

Quote:
Originally Posted by scrtxxcaz View Post
not sure if this is exactly what u want but u can arrange it the way you want it

Code:
public plugin_int() {
           register_plugin(PLUGIN, VERSION, AUTHOR)
           register_event("CurWeapon","current_weapon")
}
public current_weapon(id){
           new team = get_user_team(id,team,31)
           new ammo,clip,weapon
           get_user_weapon(weapon,ammo,clip)
           if(weapon == CSW_GLOCK18)
           {
                     if(team == 2)   //CT
                     {
                               strip_user_weapons(id)
                               give_item(id,"weapon_flashbang")
                               give_item(id,"weapon_flashbang")
                               give_item(id,"weapon_smokegrenade")
                      }
           }
           else if(weapon == CSW_KNIFE)
          {
                    if(team == 1)   //Terroist
                    {
                                strip_user_weapons(id)
                                give_item(id,"weapon_flashbang")
                                give_item(id,"weapon_flashbang")
                                give_item(id,"weapon_smokegrenade")
                     }
          }
}
What i exactly mean is:
Code:
if anyone got glock //do something
if terrorist side player got knife //do something
if anyone got usp //do something
__________________
Samurai [/] is offline
Old 04-18-2007, 07:10
regalis
This message has been deleted by regalis. Reason: nvm...sorry wrong thread
scrtxxcaz
Senior Member
Join Date: Feb 2007
Location: a place u cant find
Old 04-18-2007 , 08:06   Re: curweapon help
Reply With Quote #7

Code:
public plugin_int() {
          register_plugin(PLUGIN, VERSION, AUTHOR)
          register_event("CurWeapon","current_weapon")
}
public current_weapon(id){
          new team = get_user_team(id,team,31)
          new ammo,clip,weapon
         get_user_weapon(weapon,ammo,clip)
          if(weapon == CSW_GLOCK18)
          {
                       // write your do something here
          }
          if(weapon == CSW_USP)
         {
                      //write your do something here
          }
          if(weapon == CSW_KNIFE && team == 1) //terroist
         {
                     // write your do something here
          }
}
i even color coordinated it for you, so dont say i didnt do anything for you.. lol
__________________
Please leave your name when giving me any karma

Counter Strike Freeze Tag
Status: Testing.... (bugs)

Revised Registration
Status: In Progress

Last edited by scrtxxcaz; 04-18-2007 at 08:17.
scrtxxcaz is offline
Send a message via AIM to scrtxxcaz
Samurai [/]
Member
Join Date: Sep 2006
Old 04-18-2007 , 08:29   Re: curweapon help
Reply With Quote #8

Quote:
Originally Posted by scrtxxcaz View Post
Code:
public plugin_int() {
          register_plugin(PLUGIN, VERSION, AUTHOR)
          register_event("CurWeapon","current_weapon")
}
public current_weapon(id){
          new team = get_user_team(id,team,31)
          new ammo,clip,weapon
         get_user_weapon(weapon,ammo,clip)
          if(weapon == CSW_GLOCK18)
          {
                    // write your do something here
          }
          if(weapon == CSW_USP)
         {
                      //write your do something here
          }
          if(weapon == CSW_KNIFE && team == 1) //terroist
         {
                     // write your do something here
          }
}
i even color coordinated it for you, so dont say i didnt do anything for you.. lol
This is my code:
PHP Code:
public current_weapon(id)

new 
team get_user_team(id,team,31)
new 
ammo,clip,weapon
get_user_weapon
(weapon,ammo,clip)
if(
weapon == CSW_GLOCK1)
{
strip_user_weapons(id)
give_item("weapon_flashbang")
give_item("weapon_flashbang")
give_item("weapon_smokegrenade")
}
if(
weapon == CSW_USP)
{
strip_user_weapons(id)
give_item("weapon_knife")
}
if(
weapon == CSW_KNIFE && team == 1//terroist
{
strip_user_weapons(id)
give_item("weapon_flashbang")
give_item("weapon_flashbang")
give_item("weapon_smokegrenade")
}
if(
weapon == CSW_C4)
{
strip_user_weapons(id)
}

whit errors:
Code:
/home/groups/amxmodx/tmp3/textIuXvLo.sma(613) : error 035: argument type mismatch (argument 2)
/home/groups/amxmodx/tmp3/textIuXvLo.sma(619) : error 035: argument type mismatch (argument 1)
/home/groups/amxmodx/tmp3/textIuXvLo.sma(620) : error 035: argument type mismatch (argument 1)
/home/groups/amxmodx/tmp3/textIuXvLo.sma(621) : error 035: argument type mismatch (argument 1)
/home/groups/amxmodx/tmp3/textIuXvLo.sma(626) : error 035: argument type mismatch (argument 1)
/home/groups/amxmodx/tmp3/textIuXvLo.sma(631) : error 035: argument type mismatch (argument 1)
/home/groups/amxmodx/tmp3/textIuXvLo.sma(632) : error 035: argument type mismatch (argument 1)
/home/groups/amxmodx/tmp3/textIuXvLo.sma(633) : error 035: argument type mismatch (argument 1)
__________________
Samurai [/] is offline
scrtxxcaz
Senior Member
Join Date: Feb 2007
Location: a place u cant find
Old 04-18-2007 , 08:40   Re: curweapon help
Reply With Quote #9

my bad its too late for me here.. fixed should work
Code:
public plugin_int() {
          register_plugin(PLUGIN, VERSION, AUTHOR)
          register_event("CurrentWeapon","current_weapon","be")
}
public current_weapon(id)
{ 
             new team[32]
             new teamid = get_user_team(id,team,31)
             new ammo,clip,weapon
             get_user_weapon(weapon,ammo,clip)
             if(weapon == CSW_GLOCK18)
              {
                       strip_user_weapons(id)
                       give_item(id,"weapon_flashbang")
                       give_item(id,"weapon_flashbang")
                       give_item(id,"weapon_smokegrenade")
               }
               if(weapon == CSW_USP)
               {
                            strip_user_weapons(id)
                            give_item(id,"weapon_knife")
                }
                if(weapon == CSW_KNIFE && teamid == 1) //terroist
                {
                               strip_user_weapons(id)
                               give_item(id,"weapon_flashbang")
                               give_item(id,"weapon_flashbang")
                               give_item(id,"weapon_smokegrenade")
                 }
                 if(weapon == CSW_C4)
                 {
                                strip_user_weapons(id)
                  }
}
make sure u have the "be" in the register_clcmd("CurrentWeapon",current_weapon ","be") code i fogot it the first time
__________________
Please leave your name when giving me any karma

Counter Strike Freeze Tag
Status: Testing.... (bugs)

Revised Registration
Status: In Progress
scrtxxcaz is offline
Send a message via AIM to scrtxxcaz
Samurai [/]
Member
Join Date: Sep 2006
Old 04-18-2007 , 08:53   Re: curweapon help
Reply With Quote #10

Quote:
Originally Posted by scrtxxcaz View Post
my bad its too late for me here.. fixed should work
Code:
public plugin_int() {
          register_plugin(PLUGIN, VERSION, AUTHOR)
          register_event("CurrentWeapon","current_weapon","be")
}
public current_weapon(id)
{ 
             new team[32]
             new teamid = get_user_team(id,team,31)
             new ammo,clip,weapon
             get_user_weapon(weapon,ammo,clip)
             if(weapon == CSW_GLOCK18)
              {
                       strip_user_weapons(id)
                       give_item(id,"weapon_flashbang")
                       give_item(id,"weapon_flashbang")
                       give_item(id,"weapon_smokegrenade")
               }
               if(weapon == CSW_USP)
               {
                            strip_user_weapons(id)
                            give_item(id,"weapon_knife")
                }
                if(weapon == CSW_KNIFE && teamid == 1) //terroist
                {
                               strip_user_weapons(id)
                               give_item(id,"weapon_flashbang")
                               give_item(id,"weapon_flashbang")
                               give_item(id,"weapon_smokegrenade")
                 }
                 if(weapon == CSW_C4)
                 {
                                strip_user_weapons(id)
                  }
}
make sure u have the "be" in the register_clcmd("CurrentWeapon",current_weapon ","be") code i fogot it the first time
What is this then?
Code:
register_event("CurWeapon", "event_curweapon", "be","1=2") }
__________________
Samurai [/] 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 06:37.


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