Help with money
#1

hey i have made this code when a player plays a certain amount of hours they get rewarded. but when they play the first hour instead of it rewarding you with $1000 it for some reason gives $19000.


pawn Код:
if(CST[playerid] == 2) // 1st Hour Played
    {
        GivePlayerMoney(playerid, 1000);
        PlayerTextDrawSetString(playerid, TOS, "Current Time~n~On Server~n~1 Hour");
        PlayerTextDrawShow(playerid, PayoutTD);
        PlayerTextDrawSetString(playerid, PayoutTD, "TOS Payout~n~You Recieved~n~$~g~1000");
        SetTimerEx("TDDestroy", 50000, false, "i", playerid);
    }
I will rep the help i get
Reply
#2

How many times is the above code called?
Reply
#3

Why are you showing the TD for 50 seconds?
Reply
#4

once per hour

pawn Код:
ServerPayout(playerid)
{
    if(CST[playerid] == 0) // 0 Hours Played
    {
        PlayerTextDrawSetString(playerid, TOS, "Current Time~n~On Server~n~0 Hours");
    }
    if(CST[playerid] == 2) // 1st Hour Played
    {
        GivePlayerMoney(playerid, 1000);
        PlayerTextDrawSetString(playerid, TOS, "Current Time~n~On Server~n~1 Hour");
        PlayerTextDrawShow(playerid, PayoutTD);
        PlayerTextDrawSetString(playerid, PayoutTD, "TOS Payout~n~You Recieved~n~$~g~1000");
        SetTimerEx("TDDestroy", 5000, false, "i", playerid);
        return 1;
    }
    if(CST[playerid] == 4) // 2nd Hour Played
    {
        GivePlayerMoney(playerid, 2000);
        PlayerTextDrawSetString(playerid, TOS, "Current Time~n~On Server~n~2 Hours");
        PlayerTextDrawShow(playerid, PayoutTD);
        PlayerTextDrawSetString(playerid, PayoutTD, "TOS Payout~n~You Recieved~n~$~g~2000");
        SetTimerEx("TDDestroy", 5000, false, "i", playerid);
        return 1;
    }
    if(CST[playerid] == 6) // 3rd Hour Played
    {
        GivePlayerMoney(playerid, 3000);
        PlayerTextDrawSetString(playerid, TOS, "Current Time~n~On Server~n~3 Hours");
        PlayerTextDrawShow(playerid, PayoutTD);
        PlayerTextDrawSetString(playerid, PayoutTD, "TOS Payout~n~You Recieved~n~$~g~3000");
        SetTimerEx("TDDestroy", 5000, false, "i", playerid);
        return 1;
    }
    if(CST[playerid] == 8) // 4th Hour Played
    {
        GivePlayerMoney(playerid, 4000);
        PlayerTextDrawSetString(playerid, TOS, "Current Time~n~On Server~n~4 Hours");
        PlayerTextDrawShow(playerid, PayoutTD);
        PlayerTextDrawSetString(playerid, PayoutTD, "TOS Payout~n~You Recieved~n~$~g~4000");
        SetTimerEx("TDDestroy", 5000, false, "i", playerid);
        return 1;
    }
    if(CST[playerid] == 10) // 5th Hour Played
    {
        GivePlayerMoney(playerid, 5000);
        PlayerTextDrawSetString(playerid, TOS, "Current Time~n~On Server~n~5 Hours");
        PlayerTextDrawShow(playerid, PayoutTD);
        PlayerTextDrawSetString(playerid, PayoutTD, "TOS Payout~n~You Recieved~n~$~g~5000");
        SetTimerEx("TDDestroy", 5000, false, "i", playerid);
        return 1;
    }
    if(CST[playerid] == 12) // 6th Hour Played
    {
        GivePlayerMoney(playerid, 6000);
        PlayerTextDrawSetString(playerid, TOS, "Current Time~n~On Server~n~6 Hours");
        PlayerTextDrawShow(playerid, PayoutTD);
        PlayerTextDrawSetString(playerid, PayoutTD, "TOS Payout~n~You Recieved~n~$~g~6000");
        SetTimerEx("TDDestroy", 5000, false, "i", playerid);
        return 1;
    }
thats a cut of my code
Reply
#5

and timer declaration code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)