Raised This Month: $12 Target: $400
 3% 

Dynamic MOTD


Post New Thread Reply   
 
Thread Tools Display Modes
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 04-28-2010 , 09:39   Re: Dynamic MOTD
Reply With Quote #11

thanks bugsy, i think i understand it now.

if i want to use that with the kills a client made by counting them in Deathmsg, i can use this, right?
PHP Code:
client_print(idprint_chat"do you got more than 1000 kills? %s"kills[id] <= 1000 yes no
or am i still wrong?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-28-2010 , 09:51   Re: Dynamic MOTD
Reply With Quote #12

Take a look at your condition and relate it to what youre trying to do and you can probably figure out why its wrong, it may have even been just a typo. Also, since you are returning a string value, you must enclose the values in quotes.

PHP Code:
client_print(idprint_chat"do you got more than 1000 kills? %s"kills[id] >= 1000 "yes" "no" 
__________________

Last edited by Bugsy; 04-28-2010 at 10:02.
Bugsy is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 04-28-2010 , 10:00   Re: Dynamic MOTD
Reply With Quote #13

okay, i understand it now, thanks
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-28-2010 , 12:51   Re: Dynamic MOTD
Reply With Quote #14

With 1000 kills you would get an incorrect message. Use operator ">" instead.
SnoW is offline
Send a message via MSN to SnoW
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 04-28-2010 , 13:45   Re: Dynamic MOTD
Reply With Quote #15

yes, i saw it in bugsy's code.
I'm always confused between < and > but i've drawn a picture how they work now.

I made the motd but it doesn't show everything. maybe it is to large?
PHP Code:
public show_acv(id)
{
    static 
motd[1501], len
    
    len 
format(motd1500,"<body bgcolor=#000000><font color=#87cefa>")
    
len += format(motd[len], 1500-len,"<center><h4><font color=^"blue^"> Your Achievements</font></h4></center><br><br>")
    
len += format(motd[len], 1500-len,"<center><font color=^"blue^"><B>.:Connection Achievements:.</B></color></center><br>")
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>I'll be back:</left></B><font color=^"white^"><center> get 100 connections:%s</center></color>"connections[id] >= 100 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Connector:</left></B> <font color=^"white^"><center> get 250 connections:%s</center></color>"connections[id] >= 250 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Here i am again:</left></B> <font color=^"white^"><center> get 500 connections:%s</center></color>"connections[id] >= 500 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Ultimate server lover:</left></B><font color=^"white^"><center> get 1000 connections:%s</center></color><br>"connections[id] >= 1000 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<center><font color=^"blue^"><B>.:Kill Achievements:.</center></B></color><br>")
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Beginner:</left></B><font color=^"white^"><center> get 100 kills:%s</center></color>"kills[id] >= 100 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Murderer!:</left></B><font color=^"white^"><center> get 250 kills:%s</center></color>"kills[id] >= 250 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Assasin:</left></B><font color=^"white^"><center> get 500 kills:%s</center></color>"kills[id] >= 500 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Terminator:</left></B><font color=^"white^"><center> get 1000 kills:%s</center></color><br>"kills[id] >= 1000 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<center><font color=^"blue^"><B>.:Nade Achievements:.</left></B><font color=^"white^"></center></color>")
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Gib Guy:</left></B><font color=^"white^"><center> get 50 nade kills:%s</center></color>"nadekills[id] >= 50 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Explosive!:</left></B><font color=^"white^"><center> get 125 nade kills:%s</center></color>"nadekills[id] >= 125 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Catch the nade:</left></B><font color=^"white^"><center> get 250 nade kills:%s</center></color>"nadekills[id] >= 250 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>To smithereens:</left></B><font color=^"white^"><center> get 500 nade kills:%s</center></color><br>"nadekills[id] >= 500 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"blue^"><B>.:Knife achievements:.</B></center></color><br>")
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Knife lover:</left></B><font color=^"white^"><center> get 100 knife kills:%s</center></color>"knifekills[id] >= 100 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Stealth stabbing:</left></B><font color=^"white^"><center> get 250 knife kills:%s</center></color>"knifekills[id] >= 250 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Stabbing all players:</left></B><font color=^"white^"><center> get 500 knife kills:%s</center></color>"knifekills[id] >= 500 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Samourai:</left></B><font color=^"white^"><center> get 1000 knife kills:%s</center></color><br>"knifekills[id] >= 1000 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<center><font color=^"blue^"><B>.:Headshot achievements:.</B></center></color><br>")
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Lucky?:</left></B><font color=^"white^"><center> get 100 headshots:%s</center></color>"headshots[id] >= 100 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Sniper:</left></B><font color=^"white^"><center> get 250 headshots:%s</center></color>"headshots[id] >= 250 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Ice cold killer:</left></B> <font color=^"white^"><center> get 500 headshots:%s</center></color>"headshots[id] >= 500 ACV NOT_ACV)
    
len += format(motd[len], 1500-len,"<left><font color=^"red^"><B>Head Hunter:</left></B> <font color=^"white^"><center> get 1000 headshots:%s</center></color>"headshots[id] >= 1000 ACV NOT_ACV)

    
show_motd(idmotd"Your Achievements");
    
    return 
0

and can i use it for functions? like
PHP Code:
kills[id] >= 1000 not(id) : yes(id)? 
Maybe if you have some time, write a tutorial about that.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 04-28-2010 at 14:06.
drekes is offline
Send a message via MSN to drekes
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 04-28-2010 , 15:42   Re: Dynamic MOTD
Reply With Quote #16

Yes, you're able to do it with functions. For your format function, make sure ACV and NOT_ACV are strings.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 04-28-2010 , 16:01   Re: Dynamic MOTD
Reply With Quote #17

i define ACV and NOT_ACV like this,
PHP Code:
#define ACV "Achieved"
#define NOT_ACV "Not Achieved" 
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 04-28-2010 , 16:29   Re: Dynamic MOTD
Reply With Quote #18

You should use a constant declaration instead of #define for strings.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 04-28-2010 , 16:39   Re: Dynamic MOTD
Reply With Quote #19

so
PHP Code:
new const ACV "Achieved" 
?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 04-28-2010 , 16:45   Re: Dynamic MOTD
Reply With Quote #20

Code:
new const ACV[] = "Achieved"
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ 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:41.


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