Filterscript money problem (Please help). -
Learn - 25.12.2016
When I use filterscripts of jobs the money come for second and removed when I finish the job.
How to fix it?
I dont understand codes but I think the problem come from here:
Code from GM:
This some defines:
#define ResetMoneyBar ResetPlayerMoney
#define UpdateMoneyBar GivePlayerMoney
#define GetPlayerCash(%0) PlayerInfo[%0][pCash]
#define GivePlayerCash(%0,%1) PlayerInfo[%0][pCash] += (%1)
#define GetVehicleName(%0) VehicleName[GetVehicleModel(%0)-400]
#define SetPVarInt(%0,%1,0); DeletePVar(%0,%1);
This the code make the problem in the filterscripts I think:
// Timer Name: MoneyUpdate()
// Tickrate: 1 secs.
Timer:MoneyUpdate[1000]()
{
new
iTempVar;
if(iAdverTimer >= 1)
--iAdverTimer;
new hour,minuite,second;
gettime(hour,minuite,second);
FixHour(hour);
hour = shifthour;
new tstring[7];
if(minuite < 10)
{
format(tstring, sizeof(tstring), "%d:0%d", hour, minuite);
}
else
{
format(tstring, sizeof(tstring), "%d:%d", hour, minuite);
}
TextDrawSetString(WristWatch, tstring);
foreach(Player, i)
{
SyncPlayerTime(i);
if(PlayerInfo[i][pCash] != GetPlayerMoney(i))
{
ResetPlayerMoney(i);
GivePlayerMoney(i, PlayerInfo[i][pCash]);
}
if((iTempVar = GetPVarInt(i, "adT")) != 0)
{
if(--iTempVar <= 0) DeletePVar(i, "adT");
else SetPVarInt(i, "adT", iTempVar);
}
if(PlayerInfo[i][pTriageTime] != 0)
{
PlayerInfo[i][pTriageTime]--;
}
if(PlayerInfo[i][pTicketTime] != 0)
{
PlayerInfo[i][pTicketTime]--;
}
if(ServiceTime[i] != 0)
{
ServiceTime[i]--;
}
if(PlayerInfo[i][pGPS] > 0 && GetPVarType(i, "gpsonoff"))
{
new zone[28];
GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
TextDrawSetString(GPS[i], zone);
}
if(GetPVarInt(i, "fuelonoff") == 1)
{
if(IsPlayerInAnyVehicle(i))
{
SetProgressBarValue(FuelBar[i], Fuel[GetPlayerVehicleID(i)]);
UpdateProgressBar(FuelBar[i], i);
}
else
{
DeletePVar(i, "fuelonoff");
DestroyProgressBar(FuelBar[i]);
FuelBar[i] = INVALID_BAR_ID;
}
}
}
}
And more one thing, When I try to active NPC'S the CMD error me with this error "npc:connection:error".
And last one thing

I use 16 filterscripts and some filterscripts make bugs to other filterscript for example I use gear filterscript or trash pickup when I go to pizza (FS also) The name of the trash pickup on the pizza pickup and some bugs like that...
Thanks for helpers!!!
Re: Filterscript money problem (Please help). -
Micko123 - 25.12.2016
Does anyone else sees irony with his name and this post?
Re: Filterscript money problem (Please help). -
Learn - 25.12.2016
Quote:
Originally Posted by Micko123
Does anyone else sees irony with his name and this post?
|
you are bored?
Re: Filterscript money problem (Please help). -
Micko123 - 25.12.2016
Quote:
Originally Posted by Learn
you are bored?
|
Dude.. You said you have 16 FS.. Did you made anything?? Do you know how it works?
Do same this as your nick says.. "LEARN"
Re: Filterscript money problem (Please help). -
Konstantinos - 25.12.2016
pawn Код:
// Filterscript:
GivePlayerCash(playerid, money) CallRemoteFunction("GM_GivePlayerMoney", "ii", playerid, money);
GetPlayerCash(playerid) return CallRemoteFunction("GM_GetPlayerMoney", "i", playerid);
pawn Код:
// GameMode:
forward GM_GivePlayerMoney(playerid, money);
public GM_GivePlayerMoney(playerid, money) return IsPlayerConnected(playerid) && (PlayerInfo[playerid][pCash] += money);
forward GM_GetPlayerMoney(playerid);
public GM_GetPlayerMoney(playerid) return IsPlayerConnected(playerid) ? PlayerInfo[playerid][pCash] : 0;
Re: Filterscript money problem (Please help). -
Learn - 25.12.2016
Quote:
Originally Posted by Konstantinos
pawn Код:
// Filterscript: GivePlayerCash(playerid, money) CallRemoteFunction("GM_GivePlayerMoney", "ii", playerid, money); GetPlayerCash(playerid) return CallRemoteFunction("GM_GetPlayerMoney", "i", playerid);
pawn Код:
// GameMode: forward GM_GivePlayerMoney(playerid, money); public GM_GivePlayerMoney(playerid, money) return IsPlayerConnected(playerid) && (PlayerInfo[playerid][pCash] += money);
forward GM_GetPlayerMoney(playerid); public GM_GetPlayerMoney(playerid) return IsPlayerConnected(playerid) ? PlayerInfo[playerid][pCash] : 0;
|
C:\Users\***\Desktop\lang.dll\filterscripts\gcamer a.pwn(617) : warning 203: symbol is never used: "GetPlayerCash"
C:\Users\***\Desktop\lang.dll\filterscripts\gcamer a.pwn(617) : warning 203: symbol is never used: "GivePlayerCash"
I put this in FS:
GivePlayerCash(playerid, money) CallRemoteFunction("GM_GivePlayerMoney", "ii", playerid, money);
GetPlayerCash(playerid) return CallRemoteFunction("GM_GetPlayerMoney", "i", playerid);
And get worngs why? and thank you for help!!!!!!!!!!!
Re: Filterscript money problem (Please help). -
Konstantinos - 25.12.2016
You need to replace the default functions with those two:
GivePlayerMoney -> GivePlayerCash
GetPlayerMoney -> GetPlayerCash
so it will give the money you set, call the public function remotely in the gamemode and update the money or call the public function in the gamemode and get the server-side money.
Re: Filterscript money problem (Please help). -
Learn - 25.12.2016
Quote:
Originally Posted by Micko123
Dude.. You said you have 16 FS.. Did you made anything?? Do you know how it works?
Do same this as your nick says.. "LEARN"
|
I try to know... And if I have problems the samp open this forum for people like me.
Re: Filterscript money problem (Please help). -
Learn - 25.12.2016
Quote:
Originally Posted by Konstantinos
You need to replace the default functions with those two:
GivePlayerMoney -> GivePlayerCash
GetPlayerMoney -> GetPlayerCash
so it will give the money you set, call the public function remotely in the gamemode and update the money.
|
I change but still one error
C:\Users\***\Desktop\lang.dll\filterscripts\gcamer a.pwn(61

: warning 203: symbol is never used: "GetPlayerCash"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
there I THINK: GivePlayerCash(a, - SpeedCameras[b][_fine]);
Re: Filterscript money problem (Please help). -
Konstantinos - 25.12.2016
It is a warning, not an error. As it seems, the filterscript only gives money to the player so you can remove it completely.