Raised This Month: $ Target: $400
 0% 

Restarted scripting,some problems :S


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
broertje
Senior Member
Join Date: Mar 2005
Old 02-28-2006 , 14:57   Restarted scripting,some problems :S
Reply With Quote #1

Hi,i just restarted scripting and i tried to make a script without i relearned something.

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Announce + Client info" #define VERSION "1.0" #define AUTHOR "Broertje" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     } public client_putinserver(id) {          new name[33]     get_user_name(id,name,32)     if(is_user_admin(id))     {         set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0)                   show_hudmessage(0, "%s has joined the n00bs",name)                 return PLUGIN_HANDLED     }         set_hudmessage(85, 255, 0, 0.00, -1.0, 0, 6.0, 12.0)     show_hudmessage(0,"Welcome %s. Have fun here!",name)             return PLUGIN_HANDLED } public client_disconnect(id) {          new name[33]     get_user_name(id,name,32)          if(is_user_admin(id))      {         set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0)                   show_hudmessage(0, "%s has left the house",name)                     return PLUGIN_HANDLED     }         set_hudmessage(85, 255, 0, 0.00, -1.0, 0, 6.0, 12.0)     show_hudmessage(0,"%s has left. Goodbye!",name)             return PLUGIN_HANDLED } public advertising new ping[33] new curtime[33] get_user_ping(id,ping,32) get_user_time(id,curtime,32) if(is_user_alive(id)) if(is_user_connected(0)) { client_print(id, print_chat, "Your ping is: %s , And the time: %s",ping,curtime) {
broertje is offline
broertje
Senior Member
Join Date: Mar 2005
Old 02-28-2006 , 14:58  
Reply With Quote #2

I have many errors,show me what i did wrong so i can learn it
broertje is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-28-2006 , 15:03  
Reply With Quote #3

public advertising
needs a { on the next line

the { after
client_print(id, print_chat, "Your ping is: %s , And the time: %s",ping,curtime)

needs to be a }
and you need to close that function with a }
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
broertje
Senior Member
Join Date: Mar 2005
Old 02-28-2006 , 15:31  
Reply With Quote #4

Error: Start of function body without function header on line 50
is the { below advertising
broertje is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-28-2006 , 15:45  
Reply With Quote #5

Code:
public advertising(id) { new ping[33] new curtime[33] get_user_ping(id,ping,32) get_user_time(id,curtime,32) if(is_user_alive(id)) if(is_user_connected(id)) { client_print(id, print_chat, "Your ping is: %s , And the time: %s",ping,curtime) } }

should be more like that...

and get_user_time gives you how long the user has been playing in the server...

also this never is called, you probably want a set_task or something
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
broertje
Senior Member
Join Date: Mar 2005
Old 02-28-2006 , 15:54  
Reply With Quote #6

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Announce + Client info" #define VERSION "1.0" #define AUTHOR "Broertje" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     } public client_putinserver(id) {          new name[33]     get_user_name(id,name,32)     if(is_user_admin(id))     {         set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0)                   show_hudmessage(0, "%s has joined the n00bs",name)                 return PLUGIN_HANDLED     }         set_hudmessage(85, 255, 0, 0.00, -1.0, 0, 6.0, 12.0)     show_hudmessage(0,"Welcome %s. Have fun here!",name)             return PLUGIN_HANDLED } public client_disconnect(id) {          new name[33]     get_user_name(id,name,32)          if(is_user_admin(id))      {         set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0)                   show_hudmessage(0, "%s has left the house",name)                     return PLUGIN_HANDLED     }         set_hudmessage(85, 255, 0, 0.00, -1.0, 0, 6.0, 12.0)     show_hudmessage(0,"%s has left. Goodbye!",name)             return PLUGIN_HANDLED } public advertising() { new ping[33] new curtime[33] get_user_ping(id,ping,32) get_user_time(id,curtime,32) if(is_user_alive(id)) if(is_user_connected(0)) { client_print(id, print_chat, "Your ping is: %s , You've been playing: %s on server.",ping,curtime) } }

Still some problems
broertje is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-28-2006 , 15:58  
Reply With Quote #7

Code:
public advertising(id) { new ping[33] new curtime[33] get_user_ping(id,ping,32) get_user_time(id,curtime,32) if(is_user_alive(id)) if(is_user_connected(id)) { client_print(id, print_chat, "Your ping is: %s , And the time: %s",ping,curtime) } }

It would take me too long to look through all that, so tell me what errors you're getting
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
broertje
Senior Member
Join Date: Mar 2005
Old 02-28-2006 , 16:09  
Reply With Quote #8

Welcome to the AMX Mod X 1.60-300 Compiler.
Copyright (c) 1997-2005 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 17
Warning: Loose indentation on line 21
Warning: Loose indentation on line 23
Warning: Loose indentation on line 34
Warning: Loose indentation on line 35
Warning: Loose indentation on line 38
Warning: Loose indentation on line 40
Warning: Loose indentation on line 43
Error: Undefined symbol "id" on line 53
Warning: Expression has no effect on line 53
Warning: Expression has no effect on line 53
Error: Expected token: ";", but found ")" on line 53
Error: Invalid expression, assumed zero on line 53
Error: Too many error messages on one line on line 53

Compilation aborted.
4 Errors.
broertje is offline
c0rdawg
Senior Member
Join Date: Jan 2006
Old 02-28-2006 , 16:16  
Reply With Quote #9

This compiles

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Announce + Client info" #define VERSION "1.0" #define AUTHOR "Broertje" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     } public client_putinserver(id)     {     new name[33]     get_user_name(id,name,32)     if(is_user_admin(id))         {         set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0)         show_hudmessage(0, "%s has joined the n00bs",name)                 return PLUGIN_HANDLED     }         set_hudmessage(85, 255, 0, 0.00, -1.0, 0, 6.0, 12.0)     show_hudmessage(0,"Welcome %s. Have fun here!",name)         return PLUGIN_HANDLED } public client_disconnect(id)     {     new name[33]     get_user_name(id,name,32)     if(is_user_admin(id))         {         set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0)         show_hudmessage(0, "%s has left the house",name)                 return PLUGIN_HANDLED     }         set_hudmessage(85, 255, 0, 0.00, -1.0, 0, 6.0, 12.0)     show_hudmessage(0,"%s has left. Goodbye!",name)         return PLUGIN_HANDLED } public advertising(id)     {     new ping, loss, curtime     get_user_ping(id,ping, loss)     get_user_time(id,curtime)     if(is_user_alive(id))         if(is_user_connected(id))         {         client_print(id, print_chat, "Your ping is: %s , You've been playing: %s on server.",ping,curtime)     } }
c0rdawg is offline
Send a message via AIM to c0rdawg Send a message via MSN to c0rdawg
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 02-28-2006 , 17:00  
Reply With Quote #10

Code:
public client_putinserver(id)     {     new name[33]     get_user_name(id,name,32)     if(is_user_admin(id))         {         set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0)         show_hudmessage(0, "%s has joined the n00bs",name)                 return PLUGIN_HANDLED     }         set_hudmessage(85, 255, 0, 0.00, -1.0, 0, 6.0, 12.0)     show_hudmessage(0,"Welcome %s. Have fun here!",name)         return PLUGIN_HANDLED }

To show something on a client_putinserver is still way to early .. You have to delay it about 10 secs
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
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 20:23.


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