Saving problem (y_ini)
#1

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!
Reply
#2

And the problem is....?
Reply
#3

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

Lol
You want if player spawn he get 1000$?

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

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
Reply
#6

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;
}
Reply
#7

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.
Reply
#8

FIXED!

I change this:

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

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

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)