Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
- #define function%0(%1) \
- forward%0(%1); public%0(%1)
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
- static const PAYDAY_TIMER = 3; // Minutos para o pagamento
- static const PAYDAY_MONEY = 1000; // Quantidade do pagamento
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
- static PaydayCount[MAX_PLAYERS];
- static PaydayTimer[MAX_PLAYERS];
- static bool:Spawned[MAX_PLAYERS];
- main(){}
- public OnPlayerSpawn(playerid)
- {
- if(!Spawned[playerid])
- {
- Spawned[playerid] = true;
- PaydayCount[playerid] = PAYDAY_TIMER * 60;
- PaydayTimer[playerid] = SetTimerEx("OnPlayerPayday", 1000, true, "i", playerid);
- }
- return 1;
- }
- function OnPlayerPayday(playerid)
- {
- if(Spawned[playerid])
- {
- if(--PaydayCount[playerid] <= 0)
- {
- PaydayCount[playerid] = PAYDAY_TIMER * 60;
- GivePlayerMoney(playerid, PAYDAY_MONEY);
- SendClientMessage(playerid, -1, "* Você recebeu o pagamento do payday com sucesso.");
- return 1;
- }
- new string[32];
- format(string, sizeof(string), "~b~PAYDAY: ~w~%02d:%02d", PaydayCount[playerid] / 60, PaydayCount[playerid] % 60);
- GameTextForPlayer(playerid, string, 1000, 3);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement