sweeper job bugged help me please
#1

Код:
#include <a_samp>
 
new stimer;
 
//===============Modifie it as you want===================================//
#define WAIT_TIME 60000
//======================================================================//
 
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 = 200 + 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;
}

the money not saving if i recieve the money
Reply
#2

What do you mean with "the money not saving"? When you disconnect and connect again? Or simply you don't receive it when you finish that job?

Maybe you have an external function to save your money.
Reply
#3

if the job finish will not giving the money if i recieve the money they not giving it
Reply
#4

I not understood your reply at all.
But as I said, maybe you have an external function to give money. Search something like "GiveMoney", or try in a blank script.

Anyway, if you're using that system with two or more players, you will may get some problems. Cause you're saving your "stimer" value globaly, and not per-player.

I'll explain you:

Код:
[0''] You start job. "stimer" will be, for example, 1.
[10''] Other player start the same job, and "stimer" will be, for example, 3.
[45''] The other player finish the job, and it will kill the timer that you're using to give you money.
Reply
#5

when I got the money suddenly returning
Reply
#6

That's better.

Does you tried in a blank GM?
If you can, deactivate your anti-cheat system. Maybe that's the issue.
Reply
#7

i have a lot of anti cheat system in my gamemode
Reply
#8

There's some file or command for configuring your anti-cheat?

I can't help you no more! Sorry.
Just try to do what I told you. I'm sure that is the problem, also, you should learn a bit about how your anti-cheats works and fix it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)