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

[HELP]A bit of code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MLGsuperGame
Member
Join Date: Mar 2012
Location: Jamaica
Old 08-12-2012 , 11:24   [HELP]A bit of code
Reply With Quote #1

PHP Code:
#include <sourcemod>
#pragma semicolon 1

public OnClientConnected(client); //line 4
{
    
PrintToChatAll("%N has connected to the server"client); //line 6

I'm not sure whats wrong with this bit of code can anyone help me? When I compile I get these two errors.

Line 4 Invalid function or declaration
Line 6 Symbol already defined: "PrintToChatAll"
__________________
MLGsuperGame is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 08-12-2012 , 11:25   Re: [HELP]A bit of code
Reply With Quote #2

Quote:
Originally Posted by MLGsuperGame View Post
PHP Code:
#include <sourcemod>
#pragma semicolon 1

public OnClientConnected(client//line 4
{
    
PrintToChatAll("%N has connected to the server"client); //line 6

I'm not sure whats wrong with this bit of code can anyone help me? When I compile I get these two errors.

Line 4 Invalid function or declaration
Line 6 Symbol already defined: "PrintToChatAll"
Just remove the ';' after OnClientConnected(client)
Mitchell is offline
MLGsuperGame
Member
Join Date: Mar 2012
Location: Jamaica
Old 08-12-2012 , 11:31   Re: [HELP]A bit of code
Reply With Quote #3

Quote:
Originally Posted by Mitchell View Post
Just remove the ';' after OnClientConnected(client)
Wow thanks! Honestly couldn't figure it out.
So do we not include semicolons on functions?
__________________
MLGsuperGame is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 08-12-2012 , 11:33   Re: [HELP]A bit of code
Reply With Quote #4

Quote:
Originally Posted by MLGsuperGame View Post
Wow thanks! Honestly couldn't figure it out.
So do we not include semicolons on functions?
well semicolons are end of line kind of characters, functions go on multiple lines. '{' '}'
Mitchell is offline
MLGsuperGame
Member
Join Date: Mar 2012
Location: Jamaica
Old 08-12-2012 , 11:36   Re: [HELP]A bit of code
Reply With Quote #5

Quote:
Originally Posted by Mitchell View Post
well semicolons are end of line kind of characters, functions go on multiple lines. '{' '}'
Alright gotcha, thanks!
__________________
MLGsuperGame 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:21.


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