Please help
#1

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.
Reply
#2

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

* Got beat to it *
Reply
#4

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?
Reply
#5

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

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).
Reply
#7

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.
Reply
#8

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;
Reply
#9

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]
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)