SA-MP Forums Archive
Saving problem (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: Saving problem (y_ini) (/showthread.php?tid=308749)



Saving problem (y_ini) - Kolten - 05.01.2012

I have a y_ini register system (by Kush i think) and i want to make when player join the server get (for ex.) 1000$ here is what i made:

PHP код:
                INI_WriteInt(File,"Money",1000); //i want to get 1000$ when i join the server
                
INI_WriteInt(File,"Score",0);
                
INI_WriteInt(File,"Admin",0);
                
INI_WriteInt(File,"Kills",0);
                
INI_WriteInt(File,"Deaths",0);
                
INI_WriteInt(File,"Skin",0); 
Thanks in advance!


Re: Saving problem (y_ini) - Max_Coldheart - 05.01.2012

And the problem is....?


Re: Saving problem (y_ini) - Kolten - 05.01.2012

Quote:
Originally Posted by CookieJar
Посмотреть сообщение
And the problem is....?
i don't get that money when i join the server..


Re: Saving problem (y_ini) - James Coral - 05.01.2012

Lol
You want if player spawn he get 1000$?

pawn Код:
public OnPlayerSpawn(playerid)
{
  GivePlayerMoney(playerid,1000);
 return 1;
}



Re: Saving problem (y_ini) - Kolten - 05.01.2012

Quote:
Originally Posted by James Coral
Посмотреть сообщение
Lol
You want if player spawn he get 1000$?

pawn Код:
public OnPlayerSpawn(playerid)
{
  GivePlayerMoney(playerid,1000);
 return 1;
}
omg lol of course i know for that way but i wont on my way if possible


Re: Saving problem (y_ini) - James Coral - 05.01.2012

loooooooooooooooooooooool :P
why you dont to that way? like i did for my server:

pawn Код:
public OnPlayerSpawn(playerid)
{
   GivePlayerMoney(playerid,99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999):
  SendClientMessage(playerid,COLOR_WHITE,"YOU ARE RITCH MAN");
  return 1;
}



Re: Saving problem (y_ini) - suhrab_mujeeb - 05.01.2012

Quote:
Originally Posted by James Coral
Посмотреть сообщение
loooooooooooooooooooooool :P
why you dont to that way? like i did for my server:

pawn Код:
public OnPlayerSpawn(playerid)
{
   GivePlayerMoney(playerid,99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999):
  SendClientMessage(playerid,COLOR_WHITE,"YOU ARE RITCH MAN");
  return 1;
}
You don't know how much cash will it give the player right? It might go in negative figures.


Re: Saving problem (y_ini) - Kolten - 05.01.2012

FIXED!

I change this:

PHP код:
INI_WriteInt(File,"Money",10000); 
to this:

PHP код:
INI_WriteInt(File,"Money",PlayerInfo[playerid][pMoney] = 10000); 



Re: Saving problem (y_ini) - [MG]Dimi - 05.01.2012

Quote:
Originally Posted by Kolten
Посмотреть сообщение
FIXED!

I change this:

PHP код:
INI_WriteInt(File,"Money",10000); 
to this:

PHP код:
INI_WriteInt(File,"Money",PlayerInfo[playerid][pMoney] = 10000); 
That's not fixed. What if his money is 50000 and you give him 10000 and then save his money which is 50k which means he lost 40k.


Re: Saving problem (y_ini) - [ABK]Antonio - 05.01.2012

INI_WriteInt(File, "Money", AccInfo[playerid][Money]);
^gets their money variable when its saving

INI_Int("Money", AccInfo[playerid][Money]);
^ stores the int for money in the accinfo money var

So...first time they join server lets do GivePlayerMoney(playerid, 1000); or when they join or when they first register...AccInfo[playerid][Money] = 1000