SA-MP Forums Archive
Y_INI Problem - 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)
+--- Thread: Y_INI Problem (/showthread.php?tid=290612)



Y_INI Problem - [MG]Dimi - 16.10.2011

PHP код:
File INI_Open(path);
name INI_String(File,"Nick");
reason INI_String(File,"Reason");
aname INI_String(File,"Banned_by");
date INI_String(File,"Date");
time INI_String(File,"Time");
format(msg,128,"Nick: %s | Banned by: %s | Reason: %s | Time: %s | Date: %s",name,aname,reason,time,date); 
And I get error: undefined symbol "INI_String" on all lines where INI_String is used. I need to get string values from those lines in File. File looks like:
Код:
[Ban Info]
Nick = [MG]Dimi
Banned_by = [MG]Dimi
Reason = Test
Date = 15:06:46
Time = 16.10.2011



Re: Y_INI Problem - Kush - 16.10.2011

You need to specify a length.

PHP код:
File INI_Open(path);
name INI_String(File,"Nick",128);
reason INI_String(File,"Reason",128);
aname INI_String(File,"Banned_by",128);
date INI_String(File,"Date",128);
time INI_String(File,"Time",128);
format(msg,128,"Nick: %s | Banned by: %s | Reason: %s | Time: %s | Date: %s",name,aname,reason,time,date); 
Though if I might ask, why do you define new variables and declare them as others?


Re: Y_INI Problem - [MG]Dimi - 16.10.2011

1) Adding lenght wont work since its saying Undefined symbol, not "Number of arguments, does not match the definition"

2) Kinda easier for me


Re: Y_INI Problem - Kush - 16.10.2011

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
1) Adding lenght wont work since its saying Undefined symbol, not "Number of arguments, does not match the definition"

2) Kinda easier for me
1) Wanna bet?

2) It's idiotic and a waste of space.


Re: Y_INI Problem - [MG]Dimi - 16.10.2011

Im reading

EDIT: here. I added lenght.
PHP код:
File INI_Open(path);
        
name INI_String(File,"Nick",25);
        
reason INI_String(File,"Reason",25);
        
aname INI_String(File,"Banned_by",25);
        
date INI_String(File,"Date",25);
        
time INI_String(File,"Time",25);
        
format(msg,128,"Nick: %s | Banned by: %s | Reason: %s | Time: %s | Date: %s",name,aname,reason,time,date);
        
INI_Close(File); 
Now it gives: D:\Server\filterscripts\LVGW_ADMIN_FS.pwn(1587) : error 029: invalid expression, assumed zero
D:\Server\filterscripts\LVGW_ADMIN_FS.pwn(1587) : error 035: argument type mismatch (argument 1)
D:\Server\filterscripts\LVGW_ADMIN_FS.pwn(1587) : error 001: expected token: ";", but found "return"
D:\Server\filterscripts\LVGW_ADMIN_FS.pwn(1587) : fatal error 107: too many error messages on one line

On each of these lines


Re: Y_INI Problem - Kush - 16.10.2011

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
Im reading

EDIT: here. I added lenght.
PHP код:
File INI_Open(path);
        
name INI_String(File,"Nick",25);
        
reason INI_String(File,"Reason",25);
        
aname INI_String(File,"Banned_by",25);
        
date INI_String(File,"Date",25);
        
time INI_String(File,"Time",25);
        
format(msg,128,"Nick: %s | Banned by: %s | Reason: %s | Time: %s | Date: %s",name,aname,reason,time,date);
        
INI_Close(File); 
Now it gives: D:\Server\filterscripts\LVGW_ADMIN_FS.pwn(1587) : error 029: invalid expression, assumed zero
D:\Server\filterscripts\LVGW_ADMIN_FS.pwn(1587) : error 035: argument type mismatch (argument 1)
D:\Server\filterscripts\LVGW_ADMIN_FS.pwn(1587) : error 001: expected token: ";", but found "return"
D:\Server\filterscripts\LVGW_ADMIN_FS.pwn(1587) : fatal error 107: too many error messages on one line

On each of these lines
I'm assuming your attempting to create a stats system?