Raised This Month: $ Target: $400
 0% 

How I could fix this?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FurienMaster
Junior Member
Join Date: Jan 2014
Old 07-16-2015 , 06:41   How I could fix this?
Reply With Quote #1

Hi, I have an plugin that remove C4 at spawn and give it in the last 60 seconds to a random player.
Problem is that: When a Furien receive C4 and I press tab, I saw that bomb is to a CT.
Image: http://imgur.com/oOEuVwo look at score attrib. C4 is at me(T), but in score attrib show at CT.

Code: I have this in FM_PlayerPreThink
Code:
		if(!CanPlant && !HaveC4) { 
			if(cs_get_user_plant(id)) {
				cs_set_user_plant(id, 0, 0);
					
				message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"), _, id)
				write_byte(id)
				write_byte(0)
				message_end()
			}
			if((get_gametime() - RoundTime) > get_pcvar_float(cvar_final_time)) {
				CanPlant = true;
				new Players[32], Furiens
				Furiens = 0
				for(new index = 1; index <= get_maxplayers(); index++) {
					if(is_user_connected(index) && is_user_alive(index) && get_user_team(index) == TEAM_FURIEN) {
						Furiens += 1
							
						Players[Furiens] = index
					}
				}
				if(Furiens) {
					new Player = Players[random_num(1, Furiens)];
					new Name[32]
					get_user_name(Player, Name, 31);
						
					fm_give_item(Player, "weapon_c4")
					cs_set_user_plant(Player, 1, 1)
					message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"), _, id)
					write_byte(id)
					write_byte((1<<1))
					message_end()
						
					HaveC4 = true
					
					set_hudmessage(random(255), random(255), random(255), -1.0, -1.0, 1, 3.1, 3.0)
					ShowSyncHudMsg(0, HUDEVENT, "%s a primit bomba si poate distruge omenirea.", Name)
					set_lights("b")
				}
			}	
			else if(user_has_weapon(id, CSW_C4) && get_user_team(id) == TEAM_FURIEN) {
				cs_set_user_plant(id, 0, 0)
				bacon_strip_weapon(id, "weapon_c4");
				message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"), _, id)
				write_byte(id)
				write_byte(0)
				message_end()
			}
		}
FurienMaster 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 14:56.


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