SA-MP Forums Archive
Help with timer - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with timer (/showthread.php?tid=177926)



Help with timer - martynas - 19.09.2010

Hi,


How to make that when i drive a QUAD every 60 seconds i will get +100 money


Thnaks in advance


Re: Help with timer - StreetGT - 19.09.2010

Under GamemodeInit

pawn Код:
SetTimer("QuadMoney",60000,1);
find your forwards
pawn Код:
forward QuadMoney(playerid);
end of script
pawn Код:
public QuadMoney(playerid)
{
    new State = GetPlayerState(playerid);
    if(State == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 471)
    {
        GivePlayerMoney(playerid, 100);
        SendClientMessage(playerid, grey,"You earn 100$");
    }
    return 1;
}
just try, ( not tested)


Re: Help with timer - [XST]O_x - 19.09.2010

pawn Код:
forward QuadMoney();

SetTimer("QuadMoney",60000,1);

public QuadMoney()
{
    for(new i = 0; i < MAX_PLAYERS+1; i++)
    {
        if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(i)) == 471)
        {
            GivePlayerMoney(i,100);
        }
        return 1;
    }
}



Re: Help with timer - martynas - 20.09.2010

Thanks for help