Raised This Month: $ Target: $400
 0% 

Help me with this please...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-16-2005 , 11:28   Help me with this please...
Reply With Quote #1

I found this, and i want to make it admin only...i dont know if i put everything in the right spot...can you help me?

I need it to show only when admin connects or leaves...

Code:
#include <amxmisc> #include <amxmodx> #include <cstrike> public client_putinserver(id) {     if(!(get_user_flags(id) & ADMIN_RESERVATION))         return PLUGIN_CONTINUE     new UserName[33]     get_user_name(id, UserName, 32)     new message[64] format(message,63,"%s has joined the game!",UserName)     set_hudmessage(100, 100, 100, 0.7, 0.02, 0, 6.0, 12.0, 1.0, 1.0, 1) show_hudmessage(0,message) } public client_disconnect(id) {     new UserName[33]     get_user_name(id, UserName, 32)     new message[64] format(message,63,"%s has left the game!",UserName)     set_hudmessage(100,100,100, 0.7, 0.06, 0, 6.0, 12.0, 1.0, 1.0, 1) show_hudmessage(0,message) } public plugin_init() {     register_plugin("Admin-Connect-Disconnect","1.0","cTn Edit by SweatyBanana") }   return PLUGIN_CONTINUE; }
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-16-2005 , 11:51  
Reply With Quote #2

So what's the problem?

It appears that it will only work for admins on connect. Make it do the same for disconnect.

Also, if that's the entirety of the plugin, why in the name of your favorite God's name, are you including cstrike?
Brad is offline
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-16-2005 , 11:55  
Reply With Quote #3

It wont compile...can u plz fix my code?

I dont know...it wouldnt compile, then i included cstrike and it didnt show any errors, but then it only said

Quote:
Your plugin failed to compile! Read the errors below:




Plugin short name:
#include <amxmisc>
#include <amxmodx>
#include <cstrike>

public client_putinserver(id)
{
if(!(get_user_flags(id) & ADMIN_RESERVATION))
return PLUGIN_CONTINUE

new UserName[33]
get_user_name(id, UserName, 32)
new message[64] format(message,63,"%s has joined the game!",UserName)
set_hudmessage(100, 100, 100, 0.7, 0.02, 0, 6.0, 12.0, 1.0, 1.0, 1) show_hudmessage(0,message)
}
public client_disconnect(id)
{
new UserName[33]
get_user_name(id, UserName, 32)
new message[64] format(message,63,"%s has left the game!",UserName)
set_hudmessage(100,100,100, 0.7, 0.06, 0, 6.0, 12.0, 1.0, 1.0, 1) show_hudmessage(0,message)
}
public plugin_init()
{
register_plugin("Admin-Connect-Disconnect","1.0","cTn Edit by SweatyBanana") }

return PLUGIN_CONTINUE;
}
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-16-2005 , 11:59  
Reply With Quote #4

No, I won't. You do it.

Code:
register_plugin("Admin-Connect-Disconnect","1.0","cTn Edit by SweatyBanana") }
There's an error on that line.
Brad is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 12-16-2005 , 13:21  
Reply With Quote #5

I'll point you to the way....

You got to use a get_players, a for statement, show_hud(id, message)
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 12-16-2005 , 14:15  
Reply With Quote #6

Quote:
Originally Posted by teame06
You got to use a get_players, a for statement
Lies! He wants it to show to everyone, not just admins.
Brad is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-16-2005 , 21:09  
Reply With Quote #7

You don't need to include cstrike.

You make two statements on the same line without a semicolon (declaration of the message variable and formatting it).

You do this again (setting the hud message and showing it).

You do this two more times (second function, same places).

You have an extra curly brace on the register_plugin line.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
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 16:08.


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