|
![]() |
|
Thread Tools | Display Modes |
![]() |
#1 |
Big Clucker
![]() ![]() Join Date: Nov 2011
Location: Indonesia
Posts: 139
Reputation: 20
|
![]()
Yeah, sometime it will be suck if we can't use a filterscript we have a Server-Sided Money Gamemode. And i want to share my way to fix this. I will use SetPVarInt here.
First, We just open our Gamemode, and we have to find the timer to check the money, like this Code:
public OnGameModeInit() { SetTimer("MoneyCheck", 1000, 1); return 1; } Next, We go to the public 'MoneyCheck' Code:
forward MoneyCheck(); public MoneyCheck(); { foreach(Player, i) { ResetPlayerMoney(i); GivePlayerMoney(i, GetPlayerCash(i)); } } Next, Let the GM Opened, and open the Filterscript. Find the GivePlayerMoney. We will use the PVar here, every GivePlayerMoney should be replaced with SetPVarInt. Example, change this: Code:
GivePlayerMoney(playerid, -House[i][Price]); Code:
SetPVarInt(playerid, "HouseMoney", -House[i][Price]); Now, we just have to add GivePlayerSafeMoney (or anything like this) on your GM, We take the value through the PVar. Dont forget to add this on the timer public, like this Code:
forward MoneyCheck(); public MoneyCheck(); { foreach(Player, i) { ResetPlayerMoney(i); GivePlayerMoney(i, GetPlayerCash(i)); GivePlayerSafeCash(i, GetPVarInt(playerid, "HouseMoney")); } } Code:
forward MoneyCheck(); public MoneyCheck(); { foreach(Player, i) { ResetPlayerMoney(i); GivePlayerMoney(i, GetPlayerCash(i)); GivePlayerSafeCash(i, GetPVarInt(playerid, "HouseMoney")); SetPVarInt(playerid, "HouseMoney", 0); } } And that's it, I have test this and it worked. Sorry for my bad english, for question or suggestion please reply here. ![]() |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Include] money.inc - Advanced, plug-n-play, server-sided money system | fiki574 | Includes | 7 | 25/02/2012 09:47 PM |
[Help] Server Sided Money Pawn [Please] | andrew2695 | Scripting Help | 1 | 27/11/2011 10:27 PM |
[Include] Server-sided Money - Stop money hackers! NEW RELEASE(v6) | x-cutter | Includes | 107 | 30/08/2011 07:56 PM |
[Include] T-Money: Server sided money | Toni | Includes | 3 | 04/09/2010 06:09 AM |
Server Sided Money | Toni | Help Archive | 9 | 12/08/2010 01:06 PM |