Hello help needed about giving +1 score and saving it. (y_ini)
#1

Hello I'm new at this so I will ask here...

So the thing is I want to give a player +1 respect I have it in y_ini system but now I need a command. so I have

Код:
    INI_Int("Respect",PlayerInfo[playerid][pRespect]);
	INI_WriteInt(File,"Respect",PlayerInfo[playerid][pRespect]);
So now I need just +1 code it is writing in and reading the pRespect so pls some one help me out.
Reply
#2

I'm not sure i understand this...

You want to add +1 to that INI_WriteInt?

pawn Код:
INI_WriteInt(File,"Respect",PlayerInfo[playerid][pRespect]+1);
Reply
#3

I don't think you want to add the +1 while saving, call
pawn Код:
PlayerInfo[playerid][pRespect]++;
and then save it how you would a normal integer.

++ is pretty much add one. I forgot the actual logical name but I don't really care.
Reply
#4

Quote:
Originally Posted by Hoborific
Посмотреть сообщение
I don't think you want to add the +1 while saving, call
pawn Код:
PlayerInfo[playerid][pRespect]++;
++ is pretty much add one. I forgot the actual logical name but I don't really care.
yeah that probably would be better... increment :P
Reply
#5

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
yeah that probably would be better... increment :P
increment.. thanks *writes that down*
Reply
#6

Doesn't Y_INI use callback systems? It can't be called directly as far as ****** has explained.
Reply
#7

pawn Код:
PlayerInfo[playerid][pRespect] = PlayerInfo[playerid][pRespect]+1;
Hope this will work
Reply
#8

Quote:
Originally Posted by Spooky
Посмотреть сообщение
pawn Код:
PlayerInfo[playerid][pRespect] = PlayerInfo[playerid][pRespect]+1;
Hope this will work
Or maybe something better?
pawn Код:
PlayerInfo[playerid][pRespect]++;
Reply
#9

++ uses for increasing only 1score but if he use that he can increase more than 1score at one time.
But if you want to increase only 1score then PlayerInfo[playerid][pRespect]++; is Better.
Reply
#10

Quote:
Originally Posted by Spooky
Посмотреть сообщение
++ uses for increasing only 1score but if he use that he can increase more than 1score at one time.
But if you want to increase only 1score then PlayerInfo[playerid][pRespect]++; is Better.
Thanks for the explanation, should I +rep you for that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)