dini_int writing a name?
#1

Код:
	  			new Data2[256];
  				format(Data2, 256, "Gaujos/%s.ini", gangNames[i]);
  				pName = dini_Int(Data2, "%s");
i got this and the thing i want is to create a folder name Gaujos and then it writes a gang name in it example:

Gaujos/Puma.ini

and it would write the name's in the Puma.ini of who is in the gang, i put this command under /gang create i think it creates it but i get an error cuz i can't figure out how to write a name in there:

Код:
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\pawno\bn.pwn(477) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
its the
Код:
pName =
that is a problem

btw:

Код:
					new Data2[256];
  				format(Data2, 256, "Gaujos/%s.ini", pName(playerid));
  				dini_Remove(Data2);
i use this code under /gang quit
i think its a problem cuz it will delete all the gang and i want it to delete the players name only

please someone help
Reply
#2

instead of dini Int and IntSet use dini_Set and dini_Get.... for floats dini_FloatSet and dini_Float... for boolean dini_Bool and dini_BoolSet

Get-Set = Strings (Strings such as "Hello my name is Omer.")
Int-IntSet = Integers (normal number variables)
Float-FloatSet = Floats (Floating point numbers, EX: 756.897)
Bool-BoolSet = Booleans (True and False)
Reply
#3

What?...
can u give me an example please?
Reply
#4

He gave a pretty good explanation what to do..... If you dont know what he menat you should probably give up lol
Reply
#5

You can give up yourself, but me? Thanks no... If you understand what he said go on and give me an example smarty pants :P
Reply
#6

Please help
Reply
#7

Quote:
Originally Posted by OmeRinG
instead of dini Int and IntSet use dini_Set and dini_Get.... for floats dini_FloatSet and dini_Float... for boolean dini_Bool and dini_BoolSet

Get-Set = Strings (Strings such as "Hello my name is Omer.")
Int-IntSet = Integers (normal number variables)
Float-FloatSet = Floats (Floating point numbers, EX: 756.897)
Bool-BoolSet = Booleans (True and False)
Read that through first....

Now

Strings are basically words.
Integers are numbers.
Floats are, well floats, for stuff like co-ordinates.

Obviously, a name is words, so you need to use a string, meaning you should use dini_Set
Reply
#8

Код:
					new Data2[256];
  				format(Data2, 256, "Gaujos/%s.ini", gangNames[i]);
  				pName(playerid) = dini_Set(Data2, "%s");
I can't figure out dini_set and dini_remove commands i know the others but these I'm messing up with them i get errors if i do that way or other way, can you correct this code please? errors are these:

Код:
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\pawno\bn.pwn(488) : warning 202: number of arguments does not match definition
E:\Games Setup\Gta san andreas server\Install\samp02Xserver.win32\pawno\bn.pwn(488) : error 033: array must be indexed (variable "pName")	Copyright © 1997-2006, ITB CompuPhase


1 Errors.
Reply
#9

Ok i fixed that .

Код:
public OnPlayerDisconnect(playerid,reason)
{
	if(playerGang[playerid] == 1)
	{
	new Data2[256];
	dini_Create(Data2);
	format(Data2, 256, "Gaujos/%s.ini", gangNames[playerid]);
	dini_Set(Data2, "%s", pName(playerid));
	}
	return 1;
}
this is what i put on playerdisconnect and it doesn't save, it should create a folder but it doesn't.

Код:
					new Data2[256];
					dini_Create(Data2);
  				format(Data2, 256, "Gaujos/%s.ini", gangNames[i]);
  				dini_Set(Data2, "%s", pName(playerid));
the same i put actually when player creates gang, or when accepts invitation but it doesn't work...
Reply
#10

pawn Код:
public OnPlayerDisconnect(playerid,reason)
{
    if(playerGang[playerid] == 1)
    {
        new Data2[256];
        format(Data2, 255, "Gaujos/%s.ini", gangNames[playerid]);
       
        if( !dini_Exists( Data2 ) )
        dini_Create(Data2);
       
        dini_Set(Data2, "%s", pName(playerid));
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)