SA-MP Forums Archive
Please 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please help (/showthread.php?tid=260169)



Please help - bartje01 - 07.06.2011

Hey guys, whats wrong with this line?

pawn Код:
PlayerInfo[playerid][Faction] = dini_Set(file, "Faction");
I have it at my login script.

Код:
C:\Users\Bart\Desktop\SampScripting\gamemodes\Sunlight.pwn(698) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Re: Please help - Wesley221 - 07.06.2011

It should be
pawn Код:
PlayerInfo[playerid][Faction] = dini_Int(file, "Faction");



Re: Please help - Steven82 - 07.06.2011

* Got beat to it *


Re: Please help - bartje01 - 07.06.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
It should be
pawn Код:
PlayerInfo[playerid][Faction] = dini_Int(file, "Faction");
Nope. Its not an ineteger. Its a name so it must be an array. SO how to do that?


Re: Please help - Tee - 07.06.2011

I edited this and forgot it. Look at my post after "Mean".


Re: Please help - Mean - 07.06.2011

You forgot to SET the string, you inserted it, but it's empty, so in file it would say:
pawn Код:
Faction=
So, it'll just keep blank...
So, dini_Set has 3 parameters!
pawn Код:
dini_Set( file, "Faction", string );
For example
pawn Код:
dini_Set( file, "Faction", params );
But, as Tee said, you probbably want to load it from file, not set it into the file, so use dini_Get (poster above's code).


Re: Please help - Tee - 07.06.2011

Sorry, use this:

pawn Код:
new lol[260];
lol = dini_Get(file,"Faction");//Make sure this is after you formatted 'file'.
PlayerInfo[playerid][Faction] = lol;
Make sure that the array length for faction is 260, for some reason that's what it works with without errors.


Offtopic: Mean, I noticed out signatures are almost alike xD.


Re: Please help - bartje01 - 07.06.2011

Quote:
Originally Posted by Tee
Посмотреть сообщение
I edited this and forgot it. Look at my post after "Mean".
Ive got an error with this:

Код:
C:\Users\Bart\Desktop\SampScripting\gamemodes\Sunlight.pwn(700) : error 006: must be assigned to an array
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
PlayerInfo[playerid][Faction] = lol;



Re: Please help - Tee - 07.06.2011

Check my post above yours. Also make sure that in the PlayerInfo enum, Faction's array is 260. So it would be

pawn Код:
Faction[260]



Re: Please help - bartje01 - 07.06.2011

Ah I see. No errors now, still it didnt save.
Maybe something is wrong with my line at onplayerdisconnect?

pawn Код:
dini_Set(file, "Faction",PlayerInfo[playerid][Faction]);
No errors or warnings.