Help? -
mtywe - 20.11.2010
I have a Heavily edited carlitos script and my next project was to add jobs to it. i would love ot take the easy route and implement this already done job script sinc eit looks rather simple... but when i tried running it as a filterscript the money you earned from the job would not be given... It would show you got the money the money goes up then goes back down to the old ammount you had.... Heres the job script:
http://forum.sa-mp.com/showthread.ph...highlight=jobs I need to know how to fix this within this gamemode script:
http://forum.sa-mp.com/showthread.ph...light=carlitos
Thanks ahead of time
Mike
Re: Help? -
TheXIII - 20.11.2010
GM probably uses server-side money. You need to create a workaround. Like calling a remote function from FS, or using pvars to set players server-side money.
Re: Help? -
mtywe - 20.11.2010
The money gets written to a user file, but i have no idea how to make that... can you take alook at the script for me and just help? ive tried ot make functions to tie into the gamemode but that failed.... im not sure how to do what i need to do.
Re: Help? -
TheXIII - 20.11.2010
Quote:
Originally Posted by mtywe
The money gets written to a user file, but i have no idea how to make that... can you take alook at the script for me and just help? ive tried ot make functions to tie into the gamemode but that failed.... im not sure how to do what i need to do.
|
It gets written for saving purposes. But it also uses a extra variable to store the money, as the native functions set the money on the client side, thus it is easily abused. You have to edit your GM, so that the server-side money works with pvars instead, so you can also modify it in FS, or perhaps easier way to do it would be calling a remote function of GM, from your FS.
Server-side money usually uses some "third function" (not native) to give money. So instead of
GivePlayerMoney it could be something like
GivePlayerCash, or simply
GiveMoney or something. So you modify your FS to call that remote function.
CallRemoteFunction
Re: Help? -
mtywe - 20.11.2010
I actually tried that but the function gave erros without the pinfo code, then i did that ti would update th emoney still would reset. i can show you my edited script. Its GivePlayerCash
Re: Help? -
mtywe - 20.11.2010
heres the code
http://pastebin.com/qJTU8h2S
Re: Help? -
TheXIII - 20.11.2010
I suggest you to dump these FS's and learn a likkle scripting by.. well, scripting these jobs to the GM yourself. And what you know.. at the end of the day you might learn something
AND have a unique server instead of having another copy-server while learning nothing.
I will not do it for you. I hope I helped you by telling you why the money in your GM resets.
Re: Help? -
mtywe - 20.11.2010
Ok i see the callremotefunction so lets say this is what is used in the script: GivePlayerMoney(playerid, 600);
How do i implement this into the callremotefunction? is it: CallRemoteFunction("GivePlayerCash", playerid, "d, i", "600" ??
Re: Help? -
TheXIII - 20.11.2010
Quote:
Originally Posted by mtywe
Ok i see the callremotefunction so lets say this is what is used in the script: GivePlayerMoney(playerid, 600);
How do i implement this into the callremotefunction? is it: CallRemoteFunction("GivePlayerCash", playerid, "d, i", "600" ??
|
Like so:
pawn Code:
CallRemoteFunction("GivePlayerCash", "ii", playerid, 600);
It is documented in the wiki link I posted. Very similar to widely used
format() function.
Re: Help? -
mtywe - 20.11.2010
Thanks.
Re: Help? -
mtywe - 20.11.2010
Ok, that did not work now it does not even show money increase/decrease... any other ideas?
Re: Help? -
Steven82 - 20.11.2010
JUst try to take the stuff in the filterscript and put it in the Gamemode. But becareful this script doesn't use a checpoint streamer and Carlito's does.
Re: Help? -
mtywe - 21.11.2010
Код:
if(strcmp(cmdtext, "/buyticket", true) == 0)
{
if (PlayerToPoint(2.0, playerid, 1637.0205,-1155.8770,23.8984))
{
SendClientMessage(playerid, COLOR_WHITE, "you have a ticket");
SendClientMessage(playerid, COLOR_PURPLE, "* Please drive in to the car park");
CallRemoteFunction("GivePlayerCash", "ii", playerid, -600);
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
SetObjectRot(Gate,3.000000,1.000000,-2.000000);
Ticket = 1;
return 1;
}
}
is This how thIS WORKs? CallRemoteFunction("GivePlayerCash", "ii", playerid, -600);