IRCCMD:
#1

Hi all,i coded this cmd:

Код:
IRCCMD:stats(botid, channel[], user[], host[], params[])
{
    if(IRC_IsOp(botid,channel,user))
	{
	    if(!dini_Exists(udb_encode(params))) return IRC_GroupSay(gGroupID, channel,"12,1Error: Account doesnt exist!");
		new ps,mo,ad,de,str[128];
		ps= dini_Int(file(params), "Score");
		mo= dini_Int(file(params), "Money");
		ad = dini_Int(file(params), "AdminLevel");
		de = dini_Int(udb_encode(params), "Deaths");
  		format(str,sizeof str,"4Statistics For Player %s:",params);
        IRC_GroupSay(gGroupID, channel,str);
  		format(str,sizeof str,"12,0Kills: %d ~ Money: %d ~ Admin Level: %d",ps,mo,ad);
        IRC_GroupSay(gGroupID, channel,str);
        if(ad > 0)
        {
			format(str,sizeof str,"12,0Deaths: %d ",de);
		} 	else format(str,sizeof str,"12,0Deaths: %d",de);
	     	IRC_GroupSay(gGroupID, channel,str);
		}
	return 1;
}
if u write !stats playername,the server will show the stats in the echo channel.

I've a problem:

Код:
C:\Documents and Settings\k\Desktop\SFWAR.pwn(517) : warning 219: local variable "file" shadows a variable at a preceding level
C:\Documents and Settings\k\Desktop\SFWAR.pwn(666) : warning 219: local variable "file" shadows a variable at a preceding level
C:\Documents and Settings\k\Desktop\SFWAR.pwn(1450) : warning 219: local variable "file" shadows a variable at a preceding level
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2116) : warning 219: local variable "file" shadows a variable at a preceding level
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2155) : warning 219: local variable "file" shadows a variable at a preceding level
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2189) : error 017: undefined symbol "file"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2190) : error 017: undefined symbol "file"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2191) : error 017: undefined symbol "file"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
What's wrong?
Reply
#2

I'm not stupid,i can read good.

I tried to add the new file[256]; but i get this errors:

Код:
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2596) : error 012: invalid function call, not a valid address
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2596) : warning 215: expression has no effect
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2596) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2596) : error 029: invalid expression, assumed zero
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2596) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
}
Line 2596 is:

Код:
ps= dini_Int(file(params), "Score");
Reply
#3

pawn Код:
ps= dini_Int(file(params), "Score"))
Reply
#4

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
I'm not stupid,i can read good.

I tried to add the new file[256]; but i get this errors:

Код:
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2596) : error 012: invalid function call, not a valid address
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2596) : warning 215: expression has no effect
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2596) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2596) : error 029: invalid expression, assumed zero
C:\Documents and Settings\k\Desktop\SFWAR.pwn(2596) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
}
Line 2596 is:

Код:
ps= dini_Int(file(params), "Score");
you must be stupid.
How can you put params in a definition file?
-.-
Код:
ps= dini_Int(file, "Score",params);
Reply
#5

Same errors...
Reply
#6

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Same errors...
Did you use mine?

Edit:

Fuck I was wrong.. Sorry.
Reply
#7

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
Did you use mine?
he's gunna get a error because you have one extra ")"
and you cant use params has a file -.- you need to define it ex:
pawn Код:
format(file,sizeof(file),"something/something");
edit:
sorry vic. just saw your edit
Reply
#8

Quote:
Originally Posted by [FU]Victious
Посмотреть сообщение
Did you use mine?

Edit:

Fuck I was wrong.. Sorry.
Yeah,dont work.

[OC]MestreKiller = I've added

format(file,sizeof(file),"/Accs/%.ini");

My accounts path,but still dont work...
Reply
#9

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Yeah,dont work.

[OC]MestreKiller = I dont need Set to read account file.
so you want to read it or write it?
Reply
#10

Quote:
Originally Posted by [OC]MestreKiller
Посмотреть сообщение
he's gunna get a error because you have one extra ")"
and you cant use params has a file -.- you need to define it ex:
pawn Код:
format(file,sizeof(file),"something/something");
edit:
sorry vic. just saw your edit
Nah, dw.

Logitech: You need to format your file that you're getting the info from..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)