SA-MP Forums Archive
Hello help needed about giving +1 score and saving it. (y_ini) - 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: Hello help needed about giving +1 score and saving it. (y_ini) (/showthread.php?tid=304868)



Hello help needed about giving +1 score and saving it. (y_ini) - Request - 20.12.2011

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.


Re: Hello help needed about giving +1 score and saving it. (y_ini) - [ABK]Antonio - 20.12.2011

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);



Re: Hello help needed about giving +1 score and saving it. (y_ini) - Hoborific - 20.12.2011

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.


Re: Hello help needed about giving +1 score and saving it. (y_ini) - [ABK]Antonio - 20.12.2011

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


Re: Hello help needed about giving +1 score and saving it. (y_ini) - Hoborific - 20.12.2011

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


Re: Hello help needed about giving +1 score and saving it. (y_ini) - suhrab_mujeeb - 20.12.2011

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


Re: Hello help needed about giving +1 score and saving it. (y_ini) - Spooky - 20.12.2011

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


Re: Hello help needed about giving +1 score and saving it. (y_ini) - suhrab_mujeeb - 20.12.2011

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]++;



Re: Hello help needed about giving +1 score and saving it. (y_ini) - Spooky - 20.12.2011

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


Re: Hello help needed about giving +1 score and saving it. (y_ini) - suhrab_mujeeb - 20.12.2011

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?