Raised This Month: $ Target: $400
 0% 

What's wrong ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 06-15-2011 , 13:53   What's wrong ?
Reply With Quote #1

Help please what is with that code?
PHP Code:
new cas[9], datum[11]
public 
showInfo(id){
    if(!
is_user_admin(id))
    
get_time("%H:%M:%S",cas8)
    
get_time("%d.%m.%y"datum,10)
    
set_hudmessage(025500.70.0106.012.0)
    
show_hudmessage(id"Cas: %s ^nDatum: %s",cas,datum)


That Hud Message must see only users, not admins, but that message can see ALL
__________________

Last edited by extreem; 06-15-2011 at 13:56.
extreem is offline
Send a message via Skype™ to extreem
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-15-2011 , 13:55   Re: What's wrong ?
Reply With Quote #2

That code only shows it to a single player when show_info(id) is called.
__________________
fysiks is online now
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 06-15-2011 , 13:57   Re: What's wrong ?
Reply With Quote #3

But I'm admin and can see message
__________________
extreem is offline
Send a message via Skype™ to extreem
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-15-2011 , 13:58   Re: What's wrong ?
Reply With Quote #4

Show the whole code. If it's longer than a hundred lines, post it as an attachment.
__________________
fysiks is online now
Old 06-15-2011, 14:01
extreem
This message has been deleted by extreem.
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 06-15-2011 , 14:02   Re: What's wrong ?
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Plugin"
#define VERSION "1.0"
#define AUTHOR "Extreem"

new cas[9], datum[11]
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
set_task(2.0,"showInfo",0,_,_,"b")
}
public 
showInfo(id){
    if(!
is_user_admin(id))
    
get_time("%H:%M:%S",cas8)
    
get_time("%d.%m.%y"datum,10)
    
set_hudmessage(025500.70.0106.03.0)
    
show_hudmessage(id"Cas: %s ^nDatum: %s",cas,datum)


__________________
extreem is offline
Send a message via Skype™ to extreem
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-15-2011 , 14:02   Re: What's wrong ?
Reply With Quote #7

Ok, so that will show it to all players as you have experienced. Don't send it to "id", you need to loop through all players and send it only to those you want to see it.

The player index is "tempid" and you can show it to who ever you want with an if statement then show_hudmessage(tempid, ...).
__________________

Last edited by fysiks; 06-15-2011 at 14:11.
fysiks is online now
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 06-15-2011 , 14:04   Re: What's wrong ?
Reply With Quote #8

Can you help with that please ?
__________________
extreem is offline
Send a message via Skype™ to extreem
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-15-2011 , 14:10   Re: What's wrong ?
Reply With Quote #9

Example for looping through players: http://forums.alliedmods.net/showpos...92&postcount=4
__________________
fysiks is online now
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 06-15-2011 , 14:22   Re: What's wrong ?
Reply With Quote #10

thanks. I will try it
__________________
extreem is offline
Send a message via Skype™ to extreem
Reply


Thread Tools
Display Modes

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 23:24.


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