How to fix this payday
#1

With this payday you have to go to cityhall pay bills and then get your EXP does anyone know how to make so players will get the EXP autmaticli when their payday comes and they dont have to go to pay bills to get EXP
[code] public SyncTime()
{
new string[256];
new tmphour;
new tmpminute;
new tmpsecond;
gettime(tmphour, tmpminute, tmpsecond);
FixHour(tmphour);
tmphour = shifthour;
if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
{
format(string, sizeof(string), "{FF00EA}[BD{FFFFFF}:{FF00EA}RP]: {FFFFFF}Its now {FF00EA}%d:00 {FFFFFF}sati.",tmphour);
BroadCast(COLOR_WHITE,string);
ghour = tmphour;
PayDay();
if (realtime)
{
SetWorldTime(tmphour);
}
}
}



public PayDay()
{
new string[150];
foreach (Player, i)
{
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
if(PlayerInfo[i][pPayDay] == 2) // if he didnt get his payment
{
if (PlayerInfo[i][pPlata] == 1)
{
PlayerInfo[i][pPlata] = 0;
SendClientMessage(i, COLOR_LIGHTRED, "You havent payed your bills.");
}
}
if(PlayerInfo[i][pPayDay] == 3) // ako nije na vreme podigao platu
{
if (PlayerInfo[i][pPlata] == 1)
{
PlayerInfo[i][pPlata] = 0;
SendClientMessage(i, COLOR_LIGHTRED, "Niste platili racune, platite ih ili idete u zatvor.");
}
}
if(PlayerInfo[i][pPayDay] == 4) //If he isnt in time for the payment
{
if (PlayerInfo[i][pPlata] == 1)
{
PlayerInfo[i][pPlata] = 0;

SendClientMessage(i, COLOR_LIGHTRED, "You havent payed your bils you go to jail.");
GameTextForPlayer(i, "~r~Uhapsen!", 2000, 1);
new rand = random(sizeof(gRandomJailSpawns));
SetPlayerPos(i, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
PlayerInfo[i][pJailed] = 1;
SafeJBC_ResetPlayerWeapons(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 100;
format(string, sizeof(string), "You are underarested %d seconds. Bail: unavailable", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_WHITE, string);
}
}

if(PlayerInfo[i][pPayDay] >= 5) //
{
if(MoneyMessage[i]==1)
{
SendClientMessage(i, COLOR_LIGHTRED, "you have failed to pay your debt.");
GameTextForPlayer(i, "~r~Uhapsen!", 2000, 1);
new rand = random(sizeof(gRandomJailSpawns));
SetPlayerPos(i, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
PlayerInfo[i][pJailed] = 1;
SafeJBC_ResetPlayerWeapons(i);
SafeJBC_ResetPlayerMoney(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 240;
format(string, sizeof(string), "You are arrested for %d secounds. Kaucija: Nedostupna", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_WHITE, string);
}
// ************************************************** ***************************
new stringd[256];
PlayerInfo[i][pPlata] = 1;
format(stringd, sizeof(stringd), "{FF0000}Stigli su vam racuni !\n{FFFF00}go to CityHall,\n{FFFF00}da platite\n{0000CC} Deadline for payment 20min.");
ShowPlayerDialog( i, PLATA, DIALOG_STYLE_MSGBOX, "{FFFFFF}Bank Report:", stringd, "OK", "" );
}
else
{
PlayerInfo[i][pPlata] = 0;
SendClientMessage(i, COLOR_WHITE, "* You havent played long enough to get bills.");
}

}
SaveAccounts();
return 1;
}
[code]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)