Raised This Month: $ Target: $400
 0% 

help with code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mAr7obg
Senior Member
Join Date: May 2007
Location: Bulgaria
Old 07-29-2009 , 05:31   help with code
Reply With Quote #1

Hi guys , i rebuild one plugin for timeleft/nextmap but have 1 error
when you are CT and die and type in chat "timeleft/nextmap" your skin is changeing. please help me
Code:
#include <amxmodx>
#include <colorchat>
#define is_user_tt(%1) (get_user_team(%1)==1) 
#define is_user_ct(%1) (get_user_team(%1)==2)
public plugin_init() {
 register_plugin("Timeleft / Nextmap","2.0","x")
 register_clcmd("say nextmap", "show_info", 0, "- displays nextmap")
 register_clcmd("say timeleft", "show_info", 0, "- displays timeleft")
}
public client_putinserver(id) {
 set_task(10.0, "show_info", id);
}
public show_info(id) {
 new nextmap[32]
 new timeleft = get_timeleft()
 get_cvar_string("amx_nextmap", nextmap, 31)
 if(timeleft < 1)
  return PLUGIN_CONTINUE
 if(is_user_ct(id)) {
  ColorChat(id, BLUE, "Time Left: %d:%02d^n Next Map: %s", timeleft / 60, timeleft % 60, nextmap)
  client_cmd(id,"clear")
  return PLUGIN_HANDLED
 }
 if(is_user_tt(id)) {
  ColorChat(id, RED, "Time Left: %d:%02d^n Next Map: %s", timeleft / 60, timeleft % 60, nextmap)
  client_cmd(id,"clear")
  return PLUGIN_HANDLED
 }
 if(!is_user_alive(id)) {
  ColorChat(id, GREY, "Time Left: %d:%02d^n Next Map: %s", timeleft / 60, timeleft % 60, nextmap)
  client_cmd(id,"clear")
  return PLUGIN_HANDLED
 }
 ColorChat(id, GREEN, "Time Left: %d:%02d^n Next Map: %s", timeleft / 60, timeleft % 60, nextmap)
 return PLUGIN_CONTINUE
}

Last edited by mAr7obg; 07-29-2009 at 05:34.
mAr7obg is offline
Send a message via Skype™ to mAr7obg
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 07-29-2009 , 06:50   Re: help with code
Reply With Quote #2

I can't see anything in your script, that changes player model. Mb you should use TEAM_COLOR instead of RED and BLUE, in this case you can reduce your code.
TheRadiance is offline
Send a message via ICQ to TheRadiance
mAr7obg
Senior Member
Join Date: May 2007
Location: Bulgaria
Old 07-29-2009 , 08:33   Re: help with code
Reply With Quote #3

i will test and report back
mAr7obg is offline
Send a message via Skype™ to mAr7obg
mAr7obg
Senior Member
Join Date: May 2007
Location: Bulgaria
Old 07-29-2009 , 09:24   Re: help with code
Reply With Quote #4

it's ok now 10x for helping +karma
mAr7obg is offline
Send a message via Skype™ to mAr7obg
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 10:18.


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