SA-MP Forums Archive
Scripting Help. - 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: Scripting Help. (/showthread.php?tid=362345)



Scripting Help. - Alexis1999 - 24.07.2012

Hello.

I decided to create my own gamemode to practise my scripting skills. Specifically a Roleplay one and I would like to ask for some help here.
I pretty much know everything in Pawno ( Easy - Intermediate Level ) but I still have some missunderstandings at enum's and arrays. Also I would like to know the best include which allows you to save .ini's ( Player's Stats) .

Pretty much that's all I need to know. I would really appreciate it if you guys replied with some tips or even tutorials that will help me :P


Re: Scripting Help. - Rudy_ - 24.07.2012

The best saving system is Y_Ini.
ENums and arrrays?
This might help you


Re: Scripting Help. - Devilxz97 - 24.07.2012

Y_Ini is the great saving system : https://sampforum.blast.hk/showthread.php?tid=175565


Re: Scripting Help. - Alexis1999 - 24.07.2012

I downloaded Y_INI as you guys suggested me but I have a problem. When I try to create a file and write something inside my pawno crashes

Here's the lines where the pawno compiler crashes
Код:
new Write[] = "%s.ini";
new INI:fileName = INI_Open(Write);



Re: Scripting Help. - Rudy_ - 24.07.2012

is this only what you added?


Re: Scripting Help. - Alexis1999 - 24.07.2012

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
is this only what you added?
It's 2 lines from my gamemode ( Those 2 lines are causing the Pawno Library Compiler to crash )

EDIT: I tried commenting those 2 lines and then the compiler stopped crashing


Re: Scripting Help. - [MM]RoXoR[FS] - 24.07.2012

Quote:
Originally Posted by Alexis1999
Посмотреть сообщение
I downloaded Y_INI as you guys suggested me but I have a problem. When I try to create a file and write something inside my pawno crashes

Here's the lines where the pawno compiler crashes
Код:
new Write[] = "%s.ini";
new INI:fileName = INI_Open(Write);
Change code to

pawn Код:
new Write[30];
format(Write,30,"%s.ini",pName);//Change pName to your own variable
new INI:fileName = INI_Open(Write);



Re: Scripting Help. - Alexis1999 - 24.07.2012

After commenting new Write[] = "%s.ini";

I realised that
Код:
new INI:fileName = INI_Open(Write);
Was causing the pawno to crash.

Any ideas how to fix that issue?


Re: Scripting Help. - ReVo_ - 24.07.2012

pawn Код:
new Write[ 69 ];
new INI:filename = INI_Open(Write);
// write something
INI_Close(Write);
Update YSI to latest version (3.1)