AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   What's wrong ? (https://forums.alliedmods.net/showthread.php?t=159313)

extreem 06-15-2011 13:53

What's wrong ?
 
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

fysiks 06-15-2011 13:55

Re: What's wrong ?
 
That code only shows it to a single player when show_info(id) is called.

extreem 06-15-2011 13:57

Re: What's wrong ?
 
But I'm admin and can see message

fysiks 06-15-2011 13:58

Re: What's wrong ?
 
Show the whole code. If it's longer than a hundred lines, post it as an attachment.

extreem 06-15-2011 14:02

Re: What's wrong ?
 
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)




fysiks 06-15-2011 14:02

Re: What's wrong ?
 
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, ...).

extreem 06-15-2011 14:04

Re: What's wrong ?
 
Can you help with that please ?

fysiks 06-15-2011 14:10

Re: What's wrong ?
 
Example for looping through players: http://forums.alliedmods.net/showpos...92&postcount=4

extreem 06-15-2011 14:22

Re: What's wrong ?
 
thanks. I will try it


All times are GMT -4. The time now is 23:24.

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