[Question]I want to wipe the account's money
#1

Hello, I have a server, and I want to make an admin command that can wipe all the money in the accounts of the server (scriptfiles), online and offline, is this possible?

If it is please can someoane tell me how? Or if someone can make the command, I will pe gratefull !

So the ideea is to wipe the money of the server, all the account's to be set to a value of money , no matter if they are Online or Offline ... Thx.

My gamemode is based on the Godefather edit !
Reply
#2

This old post should help you: http://forum.sa-mp.com/index.php?top...5030#msg345030
Reply
#3

pawn Код:
new Money = 0;
pawn Код:
public LoadMoney()
{
      new arrCoords[2][64];
      new strFromFile2[256];
      new File: file = fopen("money.ini", io_read);

  if (file)
  {
   fread(file, strFromFile2);
   Money = strvalEx(arrCoords[0]);
   fclose(file);
   return 1;
  }
}
pawn Код:
public SaveMoney()
{
      new coordsstring[32];
      format(coordsstring, sizeof(coordsstring), "%d", Money);
      new File: file2 = fopen("money.ini", io_write);
      fwrite(file2, coordsstring);
      fclose(file2);
      return 1;
}
pawn Код:
//OnPlayerCommandText
if(!strcmp(cmdtext,"/resetallmoney",true))
{
   if(PlayerInfo[playerid][pAdmin] >= 1338)
   {
     if(!Money) { Money = 1; SendClientMessage(playerid,0xFFFFFFFF,"All player moneys will be now seted to 1000$.
     else { Money = 0; }
   }
}
pawn Код:
public OnGameModeInit()
{
  LoadMoney();
}
pawn Код:
public OnPlayerConnect(playerid)
{
  if(Money) { ResetPlayerMoney(playerid); GivePlayerMoney(playerid,1000); }
}
Simple , isn't ?
Reply
#4

I doesn't work
I want it to reset all online and offline player money to a value, example 10k, this command dont do it ...


Please someone help me !


PS: The server is not running on a SQL ... !
Reply
#5

No one? Please someone tell me if this is possible to do... I have tried everithing I know but it was ussles....
Reply
#6

Bump
Reply
#7

Quote:
Originally Posted by TyreXel
No one? Please someone tell me if this is possible to do... I have tried everithing I know but it was ussles....
Have you at least clicked the link i posted?
Reply
#8

Problem solved, I did something else that sets players money to 10k when they login and it works

Thx for those ho helped me !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)