SA-MP Forums Archive
IRCCMD: - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IRCCMD: (/showthread.php?tid=200041)



IRCCMD: - Face9000 - 17.12.2010

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?


Re: IRCCMD: - Face9000 - 17.12.2010

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");



Re: IRCCMD: - WillyP - 17.12.2010

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



Re: IRCCMD: - MestreKiller - 17.12.2010

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);



Re: IRCCMD: - Face9000 - 17.12.2010

Same errors...


Re: IRCCMD: - WillyP - 17.12.2010

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

Edit:

Fuck I was wrong.. Sorry.


Re: IRCCMD: - MestreKiller - 17.12.2010

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


Re: IRCCMD: - Face9000 - 17.12.2010

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...


Re: IRCCMD: - MestreKiller - 17.12.2010

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?


Re: IRCCMD: - WillyP - 17.12.2010

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..