SA-MP Forums Archive
Sweeper job help,bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sweeper job help,bug (/showthread.php?tid=466341)



Sweeper job help,bug - BarFix - 27.09.2013

When i drive at the sweeper everything ok,but that gives me money and take it back,that doesnt gives me the money.
"You have received $300 for your Street Sweeping Job!"
that gives me the money and takes it back.
Quote:

#include <a_samp>

new stimer;

#define WAIT_TIME 40000


public OnFilterScriptInit()
{
print("[FILTERSCRIPT]Street Sweeping Job has loaded successfully");
return 1;
}
public OnFilterScriptExit()
{
print("[FILTERSCRIPT]Street Sweeping Job has unloaded successfully");
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
{
stimer = SetTimerEx("Sweeping", WAIT_TIME, true, "d", playerid);
SendClientMessage(playerid, 0x58E11EC8, "You are now Street Sweeping to earn money. Drive around and earn money!");
}

}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(GetVehicleModel(vehicleid) == 574)
{
KillTimer(stimer);
SendClientMessage(playerid, 0x58E11EC8, "You are no longer doing your Street Sweeping Job!");
}
return 1;
}


forward Sweeping(playerid);
public Sweeping(playerid)
{
new string[128];
new rand = 100 + random(210);
GivePlayerMoney(playerid, rand);
format(string, sizeof(string), "You have received $%d for your Street Sweeping Job!", rand);
SendClientMessage(playerid, 0x58E11EC8, string);
return 1;
}

how to fix it?


Re: Sweeper job help,bug - TonyII - 27.09.2013

Does your main script use server sided money or not?


Re: Sweeper job help,bug - BarFix - 27.09.2013

Quote:
Originally Posted by TonyII
View Post
Does your main script use server sided money or not?
what do you mean?how can i check it?


Re: Sweeper job help,bug - TonyII - 27.09.2013

Does your main script also use
pawn Code:
GivePlayerMoney(id, amount)
To give money or something else?


Re: Sweeper job help,bug - BarFix - 27.09.2013

Quote:
Originally Posted by TonyII
View Post
Does your main script also use
pawn Code:
GivePlayerMoney(id, amount)
To give money or something else?
i cant find that what you said but i found that:
Quote:

GivePlayerMoney(i, PlayerInfo[i][pCash]);




Re: Sweeper job help,bug - TonyII - 27.09.2013

You're using a filterscript thats using money from the server side, your own script must use anti money hacks thats why it won't give you the money.


Re: Sweeper job help,bug - BarFix - 27.09.2013

So how can i fix it? help?


Re: Sweeper job help,bug - Unri - 27.09.2013

Change filterscripts giveplayermoney type/syntax to your server's giveplayermoney type/syntax. Or, this way is alot better, transfer the filterscript to your gamemodes main script.