All it does now is say /signcheck [numbers] so I do that and then nothing happens?
Any ideas. heres my code:
Код:
public PayDay()
{
new string[128];
for (new i=0; i<MAX_POINTS; i++)
{
Points[i][Announced] = 0;
if (Points[i][Vulnerable] > 0)
{
Points[i][Vulnerable]--;
UpdatePoints();
}
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
CheckNumber[i] = 1000+random(8999);
format(string, 128, "It is now Payday, please type: \"/signcheck %d\"", CheckNumber[i]);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
}
}
return 1;
}
_______________________________________________________________________________________
if(strcmp(cmdtext, "/signcheck", true)==0)
{
// is player signing check connected
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /signcheck [numbers]");
return 1;
}
new string[128];
new account,interest;
new rent = 0;
// if they are above level 0
if(PlayerInfo[playerid][pLevel] > 0)
{
if(MoneyMessage[playerid]==1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
GameTextForPlayer(playerid, "~r~Busted!", 2000, 1);
SetPlayerInterior(playerid, 6);
SetPlayerPos(playerid, 264.6288,77.5742,1001.0391);
PlayerInfo[playerid][pJailed] = 1;
ResetPlayerWeapons(playerid);
WantedPoints[playerid] = 0;
PlayerInfo[playerid][pJailTime] = 240;
format(string, sizeof(string), "You are jailed for %d seconds. Bail: Unable", PlayerInfo[playerid][pJailTime]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
account = PlayerInfo[playerid][pAccount];
new key = PlayerInfo[playerid][pPhousekey];
if(key != 255)
{
rent = HouseInfo[key][hRent];
if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
rent = 0;
}
else if(rent > GetPlayerMoney(playerid))
{
PlayerInfo[playerid][pPhousekey] = 255;
SendClientMessage(playerid, COLOR_WHITE, "You have been evicted.");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
if(PlayerInfo[playerid][pDonateRank] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
}
else
{
if(PlayerInfo[playerid][pDonateRank] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
if(PlayerInfo[playerid][pPayDay] >= 5)
{
new number = strval(tmp);
if(number == CheckNumber[playerid])
{
SendClientMessage(playerid, 0x00FF00AA, "You received your money!");
Tax += TaxValue;//Should work for every player online
PlayerInfo[playerid][pAccount] -= TaxValue;
if(PlayerInfo[playerid][pDonateRank] > 0)
{
new bonus = PlayerInfo[playerid][pPayCheck] / 2;
PlayerInfo[playerid][pPayCheck] += bonus;
}
new checks = PlayerInfo[playerid][pPayCheck];
new ebill = (PlayerInfo[playerid][pAccount]/10000)*(PlayerInfo[playerid][pLevel]);
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid, checks);
if(PlayerInfo[playerid][pAccount] > 0)
{
PlayerInfo[playerid][pAccount] -= ebill;
SBizzInfo[4][sbTill] += ebill;
}
else
{
ebill = 0;
}
interest = (PlayerInfo[playerid][pAccount]/1000)*(tmpintrate);
PlayerInfo[playerid][pExp]++;
PlayerPlayMusic(playerid);
PlayerInfo[playerid][pAccount] = account+interest;
SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
format(string, sizeof(string), " Paycheck: $%d Tax Money: -$%d", checks, TaxValue);
SendClientMessage(playerid, COLOR_GRAD1, string);
if(PlayerInfo[playerid][pPhousekey] != 255 || PlayerInfo[playerid][pPbiskey] != 255)
{
format(string, sizeof(string), " Electricity Bill: -$%d", ebill);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
format(string, sizeof(string), " Balance: $%d", account);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " Interest Rate: 0.%d percent",tmpintrate);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), " Interest Gained $%d", interest);
SendClientMessage(playerid, COLOR_GRAD3, string);
SendClientMessage(playerid, COLOR_GRAD4, "|--------------------------------------|");
format(string, sizeof(string), " New Balance: $%d", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_GRAD5, string);
format(string, sizeof(string), " Rent: -$%d", rent);
SendClientMessage(playerid, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
GameTextForPlayer(playerid, string, 5000, 1);
rent = 0;
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PlayerInfo[playerid][pConnectTime] += 1;
if(PlayerInfo[playerid][pDonateRank] > 0)
{
PlayerInfo[playerid][pPayDayHad] += 1;
if(PlayerInfo[playerid][pPayDayHad] >= 5)
{
PlayerInfo[playerid][pExp]++;
PlayerInfo[playerid][pPayDayHad] = 0;
}
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Wrong checknumber!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "* You haven't played long enough to obtain a PayDay.");
}
}
}
Checkprop();
return 1;
}