[Include] A simple fix for $100 deduction on death - recommended for all servers!
#1

This is a part of: ASI
A.S.F.F.F.$1.D.O.D - R.F.A.S
Introduction
Hello everyone. I made a very simple include for a small fix. When I was developing a game-mode script for my server, I experienced a problem; whenever I got money greater than $100, then on death, the money gets wiped off by -100! I have a friend who was also experiencing this problem from over a year!, but he couldn't find the solution. Imagine 1 year! He said he searched help topic related to this problem but there were no solutions. So, I came with a idea! I developed a very simple include (or a code) which actually does not prevent GTA SA from inter-faring on death and taking -100, but, it resets the player's money before his spawn, then saves the money he last had in a variable as a integer. Then when the player spawns, it gives the player the same unmodified money! The no.2 purpose for this small, simple source is that many server owners, OR, below average scriptwriters, OR, average scriptwriters aren't aware of this (If they had ever experienced this!).
__________________________________________________ ______________________________

Source
Here is the code down. You too can put this code directly in your mode, OR, making a separate include file (".inc") is optional.

pawn Код:
new LastM_@i[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, LastM_@i[playerid]);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    LastM_@i[playerid] = GetPlayerMoney(playerid);
    return 1;
}
Reply
#2

The best way for me is server-side money. You get many advantages on it such as getting rid of that problem (-100 $ on death) or fake money (cheats).
Reply
#3

Thats true, but the functions can be separately modified someplace else to make a server-side money system. That does the same thing! (IF the user had done some modifications with "GivePlayerMoney", "GetPlayerMoney", etc...)

EDIT: There are also disadvantages for using this, using server-side money wont work on sprunk machines, snack machines, markets, etc.. The server will ban the player simply...

Maybe if the player gets an abnormal amount of money, investigations (by a human) can be done nicely. (What if the receiver was innocent?)
Reply
#4

Everyone uses server-side money these days.
E.U.S.S.M.T.D.
Reply
#5

You clearly didn't understand my last post? Or what?

@ ****** - Opps? Is it there? then I should not have done this...
Reply
#6

Why don't you use just:
Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerMoney(playerid, 100);
    return 1;
}
Reply
#7

Because using the other way is same. What is the difference in that? And stop posting waste without thinking.
Reply
#8

Quote:
Originally Posted by ACI
Посмотреть сообщение
EDIT: There are also disadvantages for using this, using server-side money wont work on sprunk machines, snack machines, markets, etc.. The server will ban the player simply...

Maybe if the player gets an abnormal amount of money, investigations (by a human) can be done nicely. (What if the receiver was innocent?)
I never talked about banning a player! Resetting the player's money and giving them back the registered money (server-side) is fine. Of course, you should disable any way that has to do with the client such as casinos, markets and create yours. Pay n' Spray is scriptable, so do shop mods!

Quote:
Originally Posted by Luk_Ass
Посмотреть сообщение
Why don't you use just:
Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerMoney(playerid, 100);
    return 1;
}
If the players have got less than $100, they'll be able to earn some money by that way (abusive).
Reply
#9

Quote:

I never talked about banning a player! Resetting the player's money and giving them back the registered money (server-side) is fine. Of course, you should disable any way that has to do with the client such as casinos, markets and create yours. Pay n' Spray is scriptable, so do shop mods!

You didn't understood what I said. I was also pointing about the disadvantages, I never said you mentioned it in your reply. I also was talking about the modified server-side money, just the same thing. Talking about disabling sprunk machines, markets, etc... truly, everyone knows how to prevent that.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)