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