Payday
#1

I made a Payday Timer set for 1 minute but it is not working,

pawn Код:
SetTimer("Payday", GivePlayerMoney, 1, true);
    return 1;
}

forward Payday();

public Payday()
{
    new Payday;
    Payday = GivePlayerMoney(playerid, 1000);
    SendClientMessage(playerid, COLOR_RED, "..:Payday:..");
    SendClientMessage(playerid, COLOR_WHITE, "You have recieved $1000 in to your bank"
    SendClientMessage(playerid, COLOR_RED, "Spend it wisley!");
    return 1;
}
Help D:
Reply
#2

First of all, I'm assuming you want the timer for a certain player only,
not global :
pawn Код:
SetTimerEx("Payday", 60000, true, "i", playerid);


forward Payday(playerid);
public Payday(playerid)
{
    GivePlayerMoney(playerid, 1000);
    SendClientMessage(playerid, COLOR_RED, "..:Payday:..");
    SendClientMessage(playerid, COLOR_WHITE, "You have recieved $1000 in to your bank"
    SendClientMessage(playerid, COLOR_RED, "Spend it wisley!");
    return 1;
}
and second, please read this :
SetTimer : https://sampwiki.blast.hk/wiki/SetTimer
SetTimerEx : https://sampwiki.blast.hk/wiki/SetTimerEx

Remember! : 1000 = 1 second.
Reply
#3

Does not seem to work.. :/
Reply
#4

Anyone else no haw i can fix this?
Reply
#5

pawn Код:
SetTimer("Payday", 60*1000, true);
    return 1;
}

forward Payday();

public Payday()
{
    new Payday;
    for(new i; i < MAX_PLAYERS; i++) {
    Payday = GivePlayerMoney(i, 1000);
    SendClientMessage(i, COLOR_RED, "..:Payday:..");
    SendClientMessage(i, COLOR_WHITE, "You have recieved $1000 in to your bank"
    SendClientMessage(i, COLOR_RED, "Spend it wisley!");
    }
    return 1;
}
Reply
#6

First, make a new function.


Код:
foward payday();
public payday(){
for(new i; i < MAX_PLAYERS; i++) {
new Payday = GivePlayerMoney(i, 1000);
SendClientMessage(i,COLOR,"payday!");
}
}
then put at the top of your script.

Код:
new paydaytimer;
then put this under OnGameModeInIt

Код:
paydaytimer = SetTimer("payday", 6000, 1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)