AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Errors (https://forums.alliedmods.net/showthread.php?t=63187)

krekers 11-14-2007 12:53

Errors
 
Hi.

I have problem with my script. I got many errors, but I don't understand why.

errors:
Code:

error 017: undefined symbol "id"
warning 215: expression has no effect
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

the code:

Code:

public sayname()
{
  new szAuthid[32], szName[32];
  get_user_authid( id, szAuthid, 31 );
  get_user_name( id, szName, 31 );
   
client_print(0,print_chat, szName)
}


hlstriker 11-14-2007 13:15

Re: Errors
 
You need to pass the id to this function from wherever you're calling it at.

PHP Code:

public sayname(id)
{
    new 
szAuthid[32], szName[32];
    
get_user_authididszAuthid31 );
    
get_user_nameidszName31 );
    
client_print(0print_chatszName);



krekers 11-14-2007 14:05

Re: Errors
 
OK, thanks. Now it works, but I've warning: loose indentation.

Before I posted this, I searched about the warning. There were many topics about this, but I still don't understand :D
In one topic there were something about if function and the { }, in another topic there were something about free spaces etc.Please, can you explain me about that warning and how can I remove it?


Edit: I tested the plugin. It works, but I don't like that, where is printed the result.
For example:

Mynick <-- this is the result, printed by my plugin
Mynick: /command

Why the result is printed before my nick?

[ --<-@ ] Black Rose 11-14-2007 15:03

Re: Errors
 
Is that your full script?
If it is, you're missing plugin_init()

krekers 11-14-2007 16:11

Re: Errors
 
Nope. That isnt full script. But thats the piece of script where is the problem. There is pugin_init(), includes, connecting to mysql server etc. All is ok when i connected to mysql server. There is no problem. Problem begins in the given piece of code.


All times are GMT -4. The time now is 01:14.

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