Raised This Month: $ Target: $400
 0% 

wtf, cs_set_user_ammo not working?!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 04-22-2004 , 01:35  
Reply With Quote #4

Code:
public plugin_init() {    register_event("CurWeapon","changeWeapon","be","1=1")

Thats whats calling the function...guys, the function runs, the ID I'm guessing is being passed by the event...the function runs...

heres all of it...I'm just trying to change it some...its not my plugin.

Code:
/* AMX Mod script. * * Made by AssKicR * * This file is provided as is (no warranties). * * Desripion: * Give Players Unlimited Ammo. * * Commands: * amx_ammo <authid, nick, @team or #userid>   // Unlimited Ammo * amx_unammo <authid, nick, @team or #userid> // Reset to normal * * Cvars: * sv_dropwpn   - Drops his weapon when he gets more ammo * sv_oneround  - Removes unlimited ammo power every new round * * Eksamples: * Give AssKicR Unlimited Ammo            - amx_ammo AssKicR * Remove AssKicRs Unlimited Ammo         - amx_unammo AssKicR * Give all CT unlimited Ammo            - amx_ammo @CT * Remove unlimited Ammo from all Terrorists - amx_ammo @TERRORISTS * Give player #7 unlimited ammo            - amx_ammo #7 * * Credits:: * Psyko - The Idea * {HOJ} Batman & AssKicR - For making the orignal code that i stole ^_^ * *Changelog: *V 1.0 -- Original version *V 1.1 -- Added amx_ammo @ALL & amx_unammo @ALL * */   #include <amxmodx.inc> #include <amxmisc.inc> #include <fun.inc> #include <cstrike.inc> // VARIABLES new bool:AmmoMaster[33] //---------------------------------------------------------------------------------------------- public plugin_init() {    register_event("CurWeapon","changeWeapon","be","1=1")      register_plugin("Admin Ammo","1.0","AssKicR")      register_concmd("amx_ammo","admin_ammo",ADMIN_LEVEL_A,"<authid, nick, @team or #userid>")      register_concmd("amx_unammo","admin_unammo",ADMIN_LEVEL_A,"<authid, nick, @team or #userid>")    if (!cvar_exists("sv_dropwpn")) register_cvar("sv_dropwpn", "0" ) } //---------------------------------------------------------------------------------------------- public admin_ammo(id,level,cid) {    if (!cmd_access(id,level,cid,2))       return PLUGIN_HANDLED    new arg[32], name2[32]    get_user_name(id,name2,31)      read_argv(1,arg,31)    if ((arg[0]=='@') && (arg[1]!='A')) {       new players[32], inum       get_players(players,inum,"ae",arg[1])       if (inum==0){          console_print(id,"No clients in such team")          return PLUGIN_HANDLED       }       for(new a=0;a<inum;++a)          AmmoMaster[players[a]]=true       switch(get_cvar_num("amx_show_activity"))   {    case 2:   client_print(0,print_chat,"ADMIN %s: set unlimited ammo on all %s",name2,arg[1])    case 1:   client_print(0,print_chat,"ADMIN: set unlimited ammo on all %s",arg[1])       }       console_print(id,"All clients on %s have unlimited ammo",arg[1])    }    else if ((arg[0]=='@') && (arg[1]=='A') && (arg[2]=='L') && (arg[2]=='L')) {       new players[32], inum       get_players(players,inum,"")               for(new a=0;a<inum;++a)          AmmoMaster[players[a]]=true       switch(get_cvar_num("amx_show_activity"))   {    case 2:   client_print(0,print_chat,"ADMIN %s: set unlimited ammo on all players",name2)    case 1:   client_print(0,print_chat,"ADMIN: set unlimited ammo on all players")       }       console_print(id,"All clients have unlimited ammo")    }    else {       new player = cmd_target(id,arg,7)       if (!player) return PLUGIN_HANDLED       AmmoMaster[player]=true       new name[32]       get_user_name(player,name,31)       switch(get_cvar_num("amx_show_activity"))   {    case 2:   client_print(0,print_chat,"ADMIN %s: set unlimited ammo on %s",name2,name)    case 1:   client_print(0,print_chat,"ADMIN: set unlimited ammo on %s",name)       }       console_print(id,"Client ^"%s^" has unlimited ammo",name)    }    return PLUGIN_HANDLED   } //---------------------------------------------------------------------------------------------- public admin_unammo(id,level,cid) {    if (!cmd_access(id,level,cid,2))       return PLUGIN_HANDLED    new arg[32], name2[32]    get_user_name(id,name2,31)    read_argv(1,arg,31)    if ((arg[0]=='@') && (arg[1]!='A')){       new players[32], inum       get_players(players,inum,"ae",arg[1])       if (inum==0){          console_print(id,"No clients in such team")          return PLUGIN_HANDLED       }       for(new a=0;a<inum;++a)          AmmoMaster[players[a]]=false       switch(get_cvar_num("amx_show_activity"))   {    case 2:   client_print(0,print_chat,"ADMIN %s: removed unlimited ammo from all %s",name2,arg[1])    case 1:   client_print(0,print_chat,"ADMIN: Removed unlimited ammo from all %s",arg[1])       }       console_print(id,"No clients on %s have unlimited ammo",arg[1])    }    else if ((arg[0]=='@') && (arg[1]=='A') && (arg[2]=='L') && (arg[2]=='L')) {       new players[32], inum       get_players(players,inum,"")               for(new a=0;a<inum;++a)          AmmoMaster[players[a]]=false       switch(get_cvar_num("amx_show_activity"))   {    case 2:   client_print(0,print_chat,"ADMIN %s: removed unlimited ammo from all players",name2)    case 1:   client_print(0,print_chat,"ADMIN: removed unlimited ammo from all players")       }       console_print(id,"No clients have unlimited ammo")    }    else {       new player = cmd_target(id,arg,7)       if (!player) return PLUGIN_HANDLED       AmmoMaster[player]=false       new name[32]       get_user_name(player,name,31)       switch(get_cvar_num("amx_show_activity"))   {    case 2:   client_print(0,print_chat,"ADMIN %s: removed unlimited ammo from %s",name2,name)    case 1:   client_print(0,print_chat,"ADMIN: Removed unlimited ammo from %s",name)       }       console_print(id,"Client ^"%s^" doesn't have unlimited ammo",name)    }    return PLUGIN_HANDLED   } //---------------------------------------------------------------------------------------------- public changeWeapon(id) {     if ( !AmmoMaster[id] ) return PLUGIN_CONTINUE     new  clip, ammo     new wpn_id=get_user_weapon(id, clip, ammo);     new wpn[32]     if ( wpn_id==CSW_C4 || wpn_id==CSW_HEGRENADE || wpn_id == CSW_SMOKEGRENADE || wpn_id == CSW_FLASHBANG || wpn_id == CSW_KNIFE ) return PLUGIN_CONTINUE         // Never Run Out of Ammo!     server_print("STATUS ID=%d CLIP=%d, AMMO=%d WPN=%d", id, clip, ammo, wpn_id)     if ( clip < 5 )     {     server_print("UNammo Function Running!")     get_weaponname(wpn_id,wpn,31)     cs_set_weapon_ammo(id, 10);     }     return PLUGIN_CONTINUE } //----------------------------------------------------------------------------------------------
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
 



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 15:16.


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