Raised This Month: $ Target: $400
 0% 

First round knife only & set money 0..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
nerzon
New Member
Join Date: Oct 2013
Old 10-29-2013 , 07:19   Re: First round knife only & set money 0..
Reply With Quote #2

have you deside the problem?
i'm trying to do this how:

Code:
new const PLUGIN[] = "Knife_round_1"
new const VERSION[] = "2.0"
new const AUTHOR[] = "jas0n & S.p.0_o.N"

new const g_HudMsgStart[] = "nepBbIu payHd Ha Ho}|{ax!"
new const g_HudMsgEnd[] = "3akynau opy}|{ee u B 6ou!"

new bool:g_IsKnifeRound
new bool:g_IsCommencing
new g_Mode, p_Mode
new g_Timer, p_Timer
new g_SyncMsgObj
new players[32], playerCount, i, player, pMoney; 

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)

	register_event("TextMsg", "evGameCommencing", "a", "2=#Game_Commencing")
	register_event("CurWeapon", "evCurWeapon", "be", "1=1", "2!29")
	register_event("HLTV", "evNewRound", "a", "1=0", "2=0")
	register_logevent("evStartRound", 2, "1=Round_Start")
	register_logevent("evRestartRound", 2, "1&Restart_Round_")

	g_Mode = register_cvar("kr_mode", "1")
	g_Timer = register_cvar("kr_timer", "0")
	g_SyncMsgObj = CreateHudSyncObj()
}

public plugin_cfg() {
	p_Mode = get_pcvar_num(g_Mode)
	p_Timer = get_pcvar_num(g_Timer)
}

public evGameCommencing() {
	g_IsCommencing = true
}

public evNewRound() {
	if(!g_IsKnifeRound)
		return
	
	if(task_exists(348916))
		remove_task(348916)

	   pMoney = 800 
   get_players(players,playerCount); 
 
   for(i=0;i<playerCount;i++) 
      { 
         player = players[i]; 
         { 
         cs_set_user_money(player, pMoney); 
         } 
      }

	set_hudmessage(0, 225, 0, -1.0, 0.30, 2, 2.0, 6.0, _, _, -1)
	ShowSyncHudMsg(0, g_SyncMsgObj, g_HudMsgEnd)
		
	g_IsCommencing = false
	g_IsKnifeRound = false

	pause("ad")
}

public evStartRound() {
	if (!g_IsCommencing)
		return

	g_IsKnifeRound = true

	if (p_Timer >= 30)
		set_task(float(p_Timer), "evNewRound", 348916)

	set_hudmessage(0, 225, 0, -1.0, 0.30, 2, 2.0, 6.0, _, _, -1)
	ShowSyncHudMsg(0, g_SyncMsgObj, g_HudMsgStart)
}

public client_spawn(id) {
	if (!g_IsCommencing)
		return
	
	force_knife(id)
}

public evRestartRound() {
	if (!g_IsKnifeRound)
		return

	g_IsKnifeRound = false
}

public evCurWeapon(id) {
	if (!g_IsCommencing)
		return

	static weapon
	weapon = get_user_weapon(id)

	switch(p_Mode) {
		case 1: if (weapon == CSW_C4) return
		case 2: if (weapon == CSW_HEGRENADE || weapon == CSW_FLASHBANG || weapon == CSW_SMOKEGRENADE) return
		case 3: if (weapon == CSW_C4 || weapon == CSW_HEGRENADE || weapon == CSW_FLASHBANG || weapon == CSW_SMOKEGRENADE) return
	}

	force_knife(id)
}

force_knife(id)
{
	engclient_cmd(id, "weapon_knife")
}
nerzon is offline
 



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 22:19.


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