Raised This Month: $ Target: $400
 0% 

weapon switch on first round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AAleaderNik
Member
Join Date: Dec 2005
Old 12-11-2006 , 11:31   weapon switch on first round
Reply With Quote #1

can anyone help me with like somethin basic that i can start with to make all the players switch to a certain weapon on the first round of every map
AAleaderNik is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 12-12-2006 , 04:58   Re: weapon switch on first round
Reply With Quote #2

Only switch or also force to use only that weapon?

EDIT:

This will only switch (not force).

Code:
#include <amxmodx> new const g_switch_weapon[] = "weapon_knife" enum {     gamestatus_waiting,     gamestatus_starting,     gamestatus_started,     gamestatus_running } new g_gamestatus = gamestatus_waiting public plugin_init() {     register_event("TextMsg", "event_game_starting", "a", "2=#Game_Commencing")     register_event("HLTV", "event_new_round", "a", "1=0", "2=0")     register_event("ResetHUD", "event_hud_reset", "be") } public event_game_starting() {     if (g_gamestatus == gamestatus_waiting)         g_gamestatus = gamestatus_starting } public event_new_round() {     if (g_gamestatus == gamestatus_starting)         g_gamestatus = gamestatus_started     else if (g_gamestatus == gamestatus_started)         g_gamestatus = gamestatus_running } public event_hud_reset(id) {     if (g_gamestatus == gamestatus_started)         set_task(0.1, "task_switch_weapon", id) } public task_switch_weapon(id) {     if (is_user_alive(id))         engclient_cmd(id, g_switch_weapon) }

Last edited by VEN; 12-12-2006 at 06:29.
VEN is offline
AAleaderNik
Member
Join Date: Dec 2005
Old 12-12-2006 , 17:01   Re: weapon switch on first round
Reply With Quote #3

thanks much man

edit:

whats the force weapon command and also for future whats const do pretty much

Last edited by AAleaderNik; 12-12-2006 at 17:03.
AAleaderNik is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-12-2006 , 17:33   Re: weapon switch on first round
Reply With Quote #4

Forcing the weapon would be like so the person cannot change weapons to a different weapon..

const is a term used to specify that the variable will never change.. If you attempt to change it in your code, it will give you an error on compile.
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
AAleaderNik
Member
Join Date: Dec 2005
Old 12-12-2006 , 17:42   Re: weapon switch on first round
Reply With Quote #5

thank you
AAleaderNik 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:53.


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