Raised This Month: $ Target: $400
 0% 

[solved]ts_giveweapon() 'extra' MUST be a variable


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 10-01-2006 , 22:47   Re: ts_giveweapon(index,weapon,clips,extra)
Reply With Quote #4

You can do it this way:
Code:
#include <amxmodx> #include <amxmisc> #include <tsfun> #define PLUGIN  "Kwik Weps" #define VERSION "1.0" #define AUTHOR  "Kamil" #define MAX_WEAPONS 24 new const g_szMessages[MAX_WEAPONS][] {     "/ruger", "/deagle",     "/bull", "/ak",     "/m4", "/uzi",     "/socom", "/glock",     "/mossberg", "/benelli",     "/barrett", "/tmp",     "/aug", "/usas",     "/colts", "/m16",     "/mp5sd", "/mp5",     "/57", "/berettas",     "/m60", "/spas",     "/mp7", "/guns" }; new const g_iWeaponID[MAX_WEAPONS - 1] {     28, 12, 31, 13,     5, 3, 9, 22,     26, 4, 18, 17,     15, 11, 21, 27,     6, 7, 14, 8,     32, 20, 19 }; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_clcmd("say", "hook_say");     register_clcmd("say_team", "hook_say"); } public hook_say(id) {     static message[64];     read_args(message, 63);     new i;     for(i = 0; i < MAX_WEAPONS; i++) {         if(equali(message, g_szMessages[i]) && i != 23) {             ts_giveweapon(id, g_iWeaponID[i], 200, 0);             break;         }         else {             show_motd(id, "zombie_weapons.txt");             break;         }     }     return PLUGIN_HANDLED; }
But keep in mind you need to code the extra parameter because I got lazy...
__________________
More updates for Matrix Mod!

Last edited by knekter; 10-02-2006 at 16:36.
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
 


Thread Tools
Display Modes

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 09:44.


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