AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   weapon switch on first round (https://forums.alliedmods.net/showthread.php?t=48411)

AAleaderNik 12-11-2006 11:31

weapon switch on first round
 
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

VEN 12-12-2006 04:58

Re: weapon switch on first round
 
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) }

AAleaderNik 12-12-2006 17:01

Re: weapon switch on first round
 
thanks much man

edit:

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

SweatyBanana 12-12-2006 17:33

Re: weapon switch on first round
 
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.

AAleaderNik 12-12-2006 17:42

Re: weapon switch on first round
 
thank you


All times are GMT -4. The time now is 06:53.

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