PDA

View Full Version : Payday System help


Makaak
05/04/2014, 08:11 PM
Hello!

I have some problem with payday. I need to give money every hour when player is in faction and One score too!
I have tax system in my gm but now I want to add this:
(PlayerInfo[i][pLeader] == 1||PlayerInfo[i][pMember] == 1)
{
{
if(PlayerInfo[i][pRank] == 1)
{
SafeGivePlayerMoney(i, 20000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 20.000$ (Rank 1)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 2)
{
SafeGivePlayerMoney(i, 40000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 40.000$ (Rank 2)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 3)
{
SafeGivePlayerMoney(i, 60000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 60.000$ (Rank 3)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 4)
{
SafeGivePlayerMoney(i, 80000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 80.000$ (Rank 4)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 5)
{
SafeGivePlayerMoney(i, 90000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 90.000$ (Rank 5)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 6)
{
SafeGivePlayerMoney(i, 100000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 100.000$ (Rank 6)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 7)
{
SafeGivePlayerMoney(i, 110000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 110.000$ (Rank 7)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 8)
{
SafeGivePlayerMoney(i, 120000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 120.000$ (Rank 8)");
SendClientMessage(i, COLOR_GREY, string);


Here:
public PayDay() //
{
new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
if(PlayerInfo[i][pLevel] > 0)
{
new tax = (Tax / 2)*(PlayerInfo[i][pLevel]);
if(PlayerInfo[i][pAccount] > PlayerInfo[i][pCash])
{
PlayerInfo[i][pAccount] -= tax;
banksys[dCash] += tax;
SaveCityhallSystem()
GivePlayerScore(i, +1);
SendClientMessageToAll(-1, "Payday!");
format(string, sizeof(string), " Government Tax: -$%d", tax);
SendClientMessage(i, COLOR_GREEN, string);
}
else
{
PlayerInfo[i][pCash] -= tax;
banksys[dCash] += tax;
SaveCityhallSystem()
format(string, sizeof(string), " Government Tax: -$%d", tax);
SendClientMessage(i, COLOR_GREEN, string);
}
if(PlayerInfo[i][pAddict] == 1)
{
PlayerInfo[i][pExp]+= 4;
}
//PlayerInfo[i][pExp]+= 2;
/*if(dxp == 1)
{
PlayerInfo[i][pExp]+= 4;
SendClientMessage(i, COLOR_GREEN, "Happy Hours You earned 4-XP Points");
//PlayerInfo[i][pExp]+= 2;
}
else if(dxp == 0)
{*/
PlayerInfo[i][pExp]+= 2;
//}
else if
}
}
}
return 1;
}

Thanks for help!

MCZOFT
05/04/2014, 10:10 PM
do you have a STOCK for SafeGivePlayerMoney
if yes , give it to me soi can see if there is a problem

Makaak
06/04/2014, 02:13 PM
I don't have stock for safegiveplayermoney.

MCZOFT
06/04/2014, 02:17 PM
then i think that's why payday wont work ,

try with this one ,

add this stock at the botum of your script & recompile

stock SafeGivePlayerMoney(playerid, cash)
{
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] += cash;
return 1;
}

Makaak
06/04/2014, 02:37 PM
mm.. ok so, but I need to know how to add that rank money thing to payday. Right now I have two different systems I have this system:
if(strcmp(cmd, "/factionpayday", true) == 0 || strcmp(cmd, "/payteam", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1338)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_GREEN,"All online faction members have retrieved their faction Payday.");
format(string, 256, "News: %s has started the Faction PayDay !", sendername);
ABroadCast(COLOR_YELLOW,string,1);
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLeader] == 1||PlayerInfo[i][pMember] == 1)
{
if(PlayerInfo[i][pRank] == 1)
{
SafeGivePlayerMoney(i, 20000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 20.000$ (Rank 1)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 2)
{
SafeGivePlayerMoney(i, 40000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 40.000$ (Rank 2)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 3)
{
SafeGivePlayerMoney(i, 60000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 60.000$ (Rank 3)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 4)
{
SafeGivePlayerMoney(i, 80000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 80.000$ (Rank 4)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 5)
{
SafeGivePlayerMoney(i, 90000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 90.000$ (Rank 5)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 6)
{
SafeGivePlayerMoney(i, 100000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 100.000$ (Rank 6)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 7)
{
SafeGivePlayerMoney(i, 90000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 110.000$ (Rank 5)");
SendClientMessage(i, COLOR_GREY, string);
}
else if(PlayerInfo[i][pRank] == 8)
{
SafeGivePlayerMoney(i, 100000);
format(string, sizeof(string), "*You have retrieved your Faction PayDay of 120.000$ (Rank 6)");
SendClientMessage(i, COLOR_GREY, string);
}
}
}
}
}
return 1;
}
and I want to do it automatically like every hour player get this money amount. to payday and every hour player get +1 score.
I have payday system almost but I need to put these together
public PayDay() //
{
new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
if(PlayerInfo[i][pLevel] > 0)
{
new tax = (Tax / 2)*(PlayerInfo[i][pLevel]);
if(PlayerInfo[i][pAccount] > PlayerInfo[i][pCash])
{
PlayerInfo[i][pAccount] -= tax;
banksys[dCash] += tax;
SaveCityhallSystem()
GivePlayerScore(i, +1);
SendClientMessageToAll(-1, "Payday!");
format(string, sizeof(string), " Government Tax: -$%d", tax);
SendClientMessage(i, COLOR_GREEN, string);
}
else
{
PlayerInfo[i][pCash] -= tax;
banksys[dCash] += tax;
SaveCityhallSystem()
format(string, sizeof(string), " Government Tax: -$%d", tax);
SendClientMessage(i, COLOR_GREEN, string);
}
if(PlayerInfo[i][pAddict] == 1)
{
PlayerInfo[i][pExp]+= 4;
}
//PlayerInfo[i][pExp]+= 2;
/*if(dxp == 1)
{
PlayerInfo[i][pExp]+= 4;
SendClientMessage(i, COLOR_GREEN, "Happy Hours You earned 4-XP Points");
//PlayerInfo[i][pExp]+= 2;
}
else if(dxp == 0)
{*/
PlayerInfo[i][pExp]+= 2;
//}
else if
}
}
}
return 1;
}

Makaak
06/04/2014, 07:16 PM
bump