RP Server crash every payday (Hour) Help Crash detect.
#1

Okay so everything compile perfect in Pawno with no errors or warnings but when I use the Command /PayDay in game or when a hour has passed and its time for payday (AKA paycheck / set player hour on stats) the server crash and restarts i used the plugin crash detect hopping it could help me fix whats wrong but i still have no idea.. Here is what the crash detect spam on the logs.

Code:
 from LAC.amx
[03:05:23] [debug] Run time error 4: "Array index out of bounds"
[03:05:23] [debug] Accessing element at index 12 past array upper bound 11
[03:05:23] [debug] AMX backtrace:
[03:05:23] [debug] #0 005e5ba4 in ?? (0x00000000) from LAC.amx
[03:05:23] [debug] #1 005e5a04 in public ServerHeartbeatTwo@_yT (0x00000000) from LAC.amx
[03:05:24] [debug] Run time error 4: "Array index out of bounds"
[03:05:24] [debug] Accessing element at index 12 past array upper bound 11
[03:05:24] [debug] AMX backtrace:
[03:05:24] [debug] #0 005e5ba4 in ?? (0x00000001) from LAC.amx
[03:05:24] [debug] #1 005e5a04 in public ServerHeartbeatTwo@_yT (0x00000001) from LAC.amx
[03:05:24] [debug] Run time error 4: "Array index out of bounds"
[03:05:24] [debug] Accessing element at index 12 past array upper bound 11
Edit This Is what I get after using the CMD "/PayDay"

Code:
[03:19:06] [zcmd] [Frank Jackson]: /payday
[03:19:06] [debug] Server crashed while executing LAC.amx
[03:19:06] [debug] AMX backtrace:
[03:19:06] [debug] #0 native fwrite () [0809bd40] from samp03svr
[03:19:06] [debug] #1 000a40b4 in ?? (0x00000000) from LAC.amx
[03:19:06] [debug] #2 00131a6c in public PayDay () from LAC.amx
[03:19:06] [debug] #3 002e2d9c in public cmd_payday (0x00000003, 0x07fe525c) from LAC.amx
[03:19:06] [debug] #4 native CallLocalFunction () [080df4c0] from samp03svr
[03:19:06] [debug] #5 00016ae8 in ?? (0x00000003, 0x07fe523c) from LAC.amx
[03:19:06] [debug] #6 00010d14 in public OnPlayerCommandText (0x00000003, 0x07fe523c) from LAC.amx
[03:19:06] [debug] Native backtrace:
[03:19:06] [debug] #0 0049831b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[03:19:06] [debug] #1 004927c2 in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[03:19:06] [debug] #2 004933ac in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[03:19:06] [debug] #3 00493856 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[03:19:06] [debug] #4 00497f6c in ?? () from plugins/crashdetect.so
[03:19:06] [debug] #5 00653410 in ?? ()
[03:19:06] [debug] #6 00653430 in ?? ()
[03:19:06] [debug] #7 00218b11 in gsignal () from /lib/libc.so.6
[03:19:06] [debug] #8 0021a3ea in abort () from /lib/libc.so.6
[03:19:06] [debug] #9 00211e2b in ?? () from /lib/libc.so.6
[03:19:06] [debug] #10 00211ee6 in ?? () from /lib/libc.so.6
[03:19:06] [debug] #11 0809b96c in ?? () from samp03svr
[03:19:06] [debug] #12 0809bdcf in ?? () from samp03svr
[03:19:06] [debug] #13 080950b4 in ?? () from samp03svr
[03:19:06] [debug] #14 0049003c in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[03:19:06] [debug] #15 00496458 in ?? () from plugins/crashdetect.so
[03:19:06] [debug] #16 0049ac61 in amx_Exec () from plugins/crashdetect.so
[03:19:06] [debug] #17 00492708 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[03:19:06] [debug] #18 004961c9 in ?? () from plugins/crashdetect.so
[03:19:06] [debug] #19 0083f20c in ?? () from plugins/streamer.so
[03:19:06] [debug] #20 080df762 in ?? () from samp03svr
[03:19:06] [debug] #21 080950b4 in ?? () from samp03svr
[03:19:06] [debug] #22 0049003c in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[03:19:06] [debug] #23 00496458 in ?? () from plugins/crashdetect.so
[03:19:06] [debug] #24 0049ac61 in amx_Exec () from plugins/crashdetect.so
[03:19:06] [debug] #25 00492708 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[03:19:06] [debug] #26 004961c9 in ?? () from plugins/crashdetect.so
[03:19:06] [debug] #27 0083f20c in ?? () from plugins/streamer.so
[03:19:06] [debug] #28 080a5482 in ?? () from samp03svr
[03:19:06] [debug] #29 080b1371 in ?? () from samp03svr
[03:19:06] [debug] #30 08071d38 in ?? () from samp03svr
[03:19:06] [debug] #31 08071e32 in ?? () from samp03svr
[03:19:06] [debug] #32 0807bc20 in ?? () from samp03svr
[03:19:06] [debug] #33 080ae9fd in ?? () from samp03svr
[03:19:06] [debug] #34 080aebc2 in ?? () from samp03svr
[03:19:06] [debug] #35 080a9e9a in ?? () from samp03svr
[03:19:06] [debug] #36 00204d26 in __libc_start_main () from /lib/libc.so.6
[03:19:06] [debug] #37 0804b4e1 in ?? () from samp03svr
Reply
#2

This problem on your script folder's files. I already faced it . Re new your all scriptfiles' folder's files
Reply
#3

Im sorry I cant seem to make out what your trying to tell me. I should delete files ?
Reply
#4

Quote:
Originally Posted by shaquill
View Post
Im sorry I cant seem to make out what your trying to tell me. I should delete files ?
Ye. Maybe this problem on Facpay or business pay.
Reply
#5

Okay ill check that out
Reply
#6

Compile with -d3 flag to get more information and the lines: https://github.com/Zeex/samp-plugin-...ith-debug-info

After recompiling (upload if necessary) and start the server again. Execute /payday command or wait for the next time a server crash or a run time error occurs and post the server log.

For your information, fclose crashes the server if the file handle (couldn't open the file) is invalid so doing something like this:
pawn Code:
new File: fhandle = fopen(..);
// some code..
fclose(fhandle);
doesn't prevent it. The correct way would be:
pawn Code:
new File: fhandle = fopen(..);
if (fhandle)
{
    // some code..
    fclose(fhandle);
}
About the run time error 4, means that you have an array with size of 12 so the valid indexes are 0 to 11 but 12 is passed as an index which is obviously out of bounds.
Reply
#7

Ill try this and post what i get.
Reply
#8

Your probably going to hate me but I don't know how to add -d3 Im very new and not even sure what -d3 is it a text or a code i need to add to a text file ? Well i compiled it with my older version of pawno cuz i think that has it and got this
Code:
 C:\Users\Faerless\Desktop\LAC File\gamemodes\LAC.pwn(19135) : warning 203: symbol is never used: "ID"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:          40888 bytes
Code size:          7743432 bytes
Data size:         66263332 bytes
Stack/heap size:   16000000 bytes; estimated max. usage: unknown, due to recursion
Total requirements:90047652 bytes

1 Warning.
Code:
 
[16:05:24] *** Streamer Plugin: Include file version (0x27002) does not match plugin version (0x276001) (script might need to be recompiled with the latest include file)
The server just keep restarting and dont let you login unless I use the newer version of pawno so Im using the newer version of pawno.
Reply
#9

About the debug info all you need is a file called pawn.cfg into pawno folder and inside the file written -d3

About the streamer warning, you need to compile the script with the same version the plugin file is. v2.7.7 is out so download it, replace both include and plugin file, re-compile and try again.

Remember, I only need the output of crashdetect in server log - the rest are irrelevant.
Reply
#10

Okay doing it now. Thanks for breaking it down for me!
Reply
#11

When i compile the gamemaode with the pawn.cfg in pawno folder it compiles and do what it should but when I go to start the server it the server just keeps restarting back to back and dont let me get to the login screen. When i removed the pawn.cfg file from the pawno it returned back to normal but still crash every payday. Im so lost on how to fix that..

Edit #1: I tried to connect to the server and just wont connect.. but it runs..
This all i get once i compiled the game-mode with the pawn.cfg you told me to do..

Code:
 [22:54:34] [connection] (My IP Adress) requests connection cookie.
[22:54:35] Incoming connection: (My IP Adress)  id: 0
[22:54:35] [debug] Server crashed while executing LAC.amx
Edit #2: Here is my payday public function and ServerHeartBeatTwo

Code:
 public PayDay()
{
	new string[128];
	new account,interest,businesspay[MAX_PLAYERS], welfarepay;
	new rent = 0;
	GiftAllowed = 1;
	RaidAllowed = 1;
	matssys[MatsAmmount] += random(50000)+5000;
	Tax -= random(50000); // Money for running public services.
	// For New Turf Perks
    for(new tw=0; tw<MAX_TURFS; tw++)
    {
		new twpcount;
        foreach(Player, p)
     	{
			if(GetPlayerTurfWarsZone(p) == tw && PlayerInfo[p][pFMember] == TurfWars[tw][twOwnerId])
			{
			    twpcount ++;
			}
		}
		if(twpcount >= 3)
		{
            switch(TurfWars[tw][twSpecial])
            {
                case 0: // Default, none
                {

                }
                case 1: // Pot Seeds Generation
                {
					new potrand = random(100);
					FamilyInfo[TurfWars[tw][twOwnerId]][FamilySeeds] += potrand;

					format(string,sizeof(string),"[FAMILY EXTORTION] Your family has received %d Pot Seeds into the family safe from extortion.",potrand);
					SendFamMessage(TurfWars[tw][twOwnerId], COLOR_YELLOW, string);
                }
                case 2: // Crack Ingredients Generation
                {
					new crackrand = random(100);
					FamilyInfo[TurfWars[tw][twOwnerId]][FamilyCrackStuff] += crackrand;

					format(string,sizeof(string),"[FAMILY EXTORTION] Your family has received %d Grams of Sodium Bicarbonate into the family safe from extortion.",crackrand);
					SendFamMessage(TurfWars[tw][twOwnerId], COLOR_YELLOW, string);
                }
                case 3: // Raw Opium Generation
                {
					new heroinrand = random(10);
					FamilyInfo[TurfWars[tw][twOwnerId]][FamilyOpium] += heroinrand;

					format(string,sizeof(string),"[FAMILY EXTORTION] Your family has received %d grams of Raw Opium into the family safe from extortion.",heroinrand);
					SendFamMessage(TurfWars[tw][twOwnerId], COLOR_YELLOW, string);
                }
                case 4: // Battery Acid Generation
                {
					new acidrand = random(50);
					FamilyInfo[TurfWars[tw][twOwnerId]][FamilyAcid] += acidrand;

					format(string,sizeof(string),"[FAMILY EXTORTION] Your family has received %d gallons of Battery Acid into the family safe from extortion.",acidrand);
					SendFamMessage(TurfWars[tw][twOwnerId], COLOR_YELLOW, string);
                }
                case 5: // Materials Generation
                {
					new matsrand = random(100000);
					FamilyInfo[TurfWars[tw][twOwnerId]][FamilyMats] += matsrand;

					format(string,sizeof(string),"[FAMILY EXTORTION] Your family has received %d Materials into the family safe from extortion.",matsrand);
					SendFamMessage(TurfWars[tw][twOwnerId], COLOR_YELLOW, string);
                }
                case 6: // Money Laundering
                {
					new cashrand = random(150000);
					FamilyInfo[TurfWars[tw][twOwnerId]][FamilyCash] += cashrand;

					format(string,sizeof(string),"[FAMILY EXTORTION] Your family has received $%d into the family safe from extortion.",cashrand);
					SendFamMessage(TurfWars[tw][twOwnerId], COLOR_YELLOW, string);
                }
			}
		}
    }
	foreach(Player, i)
	{
		PlayerInfo[i][pOverdose] = 0;
		PlayerInfo[i][pChopShopped] = 0;
		Addiction(i);
			if(PlayerInfo[i][pLevel] > 0)
			{
				if(GetPVarType(i, "debtMsg")) {
					if(GetPlayerCash(i) < 0 && PlayerInfo[i][pJailTime] < 1 && !IsACop(i) && PlayerInfo[i][pWantedLevel] < 6) {
						format(string,sizeof(string),"You're failing to pay your debt of $%d - now the police are on the look out for you.",GetPlayerCash(i));
						SendClientMessageEx(i, COLOR_LIGHTRED, string);
						PlayerInfo[i][pCrimes]++;
						SetPlayerWantedLevel(i, ++PlayerInfo[i][pWantedLevel]);
					}
					else DeletePVar(i, "debtMsg");
				}
				if(TicketMessage[i]==5 && PlayerInfo[i][pSpeedTix] >= 5001)
				{
				    if( PlayerInfo[i][pJailed] < 1 && !IsACop(i) && !IsALVMPDCop(i))
				    {
				        format(string,sizeof(string),"A warrant has been issued for your arrest, You have failed to pay off your speeding violations");
						SendClientMessageEx(i, COLOR_LIGHTRED, string);
						if(PlayerInfo[i][pWantedLevel] < 6) PlayerInfo[i][pWantedLevel] += 1;
						PlayerInfo[i][pCrimes] += 1;
						SetPlayerWantedLevel(i, PlayerInfo[i][pWantedLevel]);
						AddWarrant(i, 555, "Unpaid Speeding Tickets");
						format(PlayerInfo[i][pWarrant], 64, "Unpaid Speeding Tickets");
					}
				} 
				else if(TicketMessage[i]==5 && PlayerInfo[i][pSpeedTix] < 5000) { TicketMessage[i] = 0; RemoveWarrant(i); }
				
				account = PlayerInfo[i][pAccount];
				if(PlayerInfo[i][pRenting] != INVALID_HOUSE_ID)
				{
					if(HouseInfo[PlayerInfo[i][pRenting]][hRentFee] > PlayerInfo[i][pAccount])
					{
						PlayerInfo[i][pRenting] = INVALID_HOUSE_ID;
						SendClientMessageEx(i, COLOR_WHITE, "You have been evicted.");
					}
					else {
						HouseInfo[PlayerInfo[i][pRenting]][hSafeMoney] += HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
						PlayerInfo[i][pAccount] -= HouseInfo[PlayerInfo[i][pRenting]][hRentFee];
					}
				}
				new tmpintrate, faretax, insuretax, socialsec, proptax, utilities, ezpassfee;
				tmpintrate = 5;


				if(PlayerInfo[i][pLevel] <= 5) SendClientMessageEx(i,COLOR_LIGHTBLUE,"Need to travel somewhere and don't have wheels? Use '/service Cab' to call a Cab driver!");
				if(PlayerInfo[i][pPayDay] >= 5)
				{
                    if(GetPVarInt(i, "AdvisorDuty") == 1)
					{
	    				PlayerInfo[i][pDutyHours]++;
					}
					if(PlayerInfo[i][pDonateRank] > 0)
					{
						new bonus = PlayerInfo[i][pPayCheck] / 2;
						PlayerInfo[i][pPayCheck] += bonus;
					}
					if(SpecTimer == 1)
					{
						AddSpecialToken(i);

					}
					rent = 0;
					faretax = 0;
					insuretax = 0; proptax = 0; utilities = 0;
					socialsec = 0;
					ezpassfee = 0;
					new checks = PlayerInfo[i][pPayCheck];
					if(PlayerInfo[i][pTaxiLicense] == 1) faretax = (checks/100)*5;
					if(PlayerInfo[i][pCarInsurance] == 1) insuretax = (checks/100)*9;
					socialsec = (checks/100)*4;
					if(PlayerInfo[i][pPhousekey] != INVALID_HOUSE_ID || PlayerInfo[i][pPhousekey2] != INVALID_HOUSE_ID)
					{
						proptax += (checks/100)*8;
						utilities += (checks/100)*2;
					}
					new Taxable = (( checks / 100 ) * TaxValue);
					PlayerInfo[i][pAccount] -= Taxable + faretax + insuretax + socialsec + proptax + utilities + ezpassfee;
					Tax += Taxable + faretax + insuretax + socialsec + proptax + utilities;

					interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);

					if(PlayerInfo[i][pDonateRank] == 0 && interest > 50000)
					{
						interest = 50000;
					}
					else if(PlayerInfo[i][pDonateRank] == 1 && interest > 100000)
					{
						interest = 100000;
					}
					else if(PlayerInfo[i][pDonateRank] == 2 && interest > 150000)
					{
						interest = 150000;
					}
					else if(PlayerInfo[i][pDonateRank] == 3 && interest > 200000)
					{
						interest = 200000;
					}
					else if(PlayerInfo[i][pDonateRank] >= 4 && interest > 250000)
					{
						interest = 250000;
					}

					PlayerInfo[i][pExp]++;
					PlayerInfo[i][pAccount] = account+interest;
					SendClientMessageEx(i, COLOR_WHITE, "________ BANK STATEMENT ________");
					format(string, sizeof(string), "  Paycheck: $%d  |  Tax Money: -$%d (%d percent)", checks, Taxable, TaxValue);
					SendClientMessageEx(i, COLOR_GRAD1, string);
					format(string, sizeof(string), "  Property Tax: -$%d  |  Utilities: -$%d", proptax, utilities);
					SendClientMessageEx(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "  Social Security: -$%d", socialsec);
					SendClientMessageEx(i, COLOR_GRAD5, string);

					if(PlayerInfo[i][pDonateRank] == 0)
					{
						format(string, sizeof(string), "  Balance: $%d  |  Interest rate: 0.%d percent (50k max)", account, tmpintrate);
						SendClientMessageEx(i, COLOR_GRAD1, string);
					}
					else if(PlayerInfo[i][pDonateRank] == 1)
					{
						format(string, sizeof(string), "  Balance: $%d  |  Interest rate: 0.%d percent {FFFF00}(Bronze VIP: 100k max)", account, tmpintrate);
						SendClientMessageEx(i, COLOR_GRAD1, string);
						
						PlayerInfo[i][pTokens] += 2;
						format(string, sizeof(string), "  You have received 2 VIP Tokens (Bronze). You now have %d tokens", PlayerInfo[i][pTokens]);
						SendClientMessageEx(i, COLOR_GRAD1, string);
					}
					else if(PlayerInfo[i][pDonateRank] == 2)
					{
						format(string, sizeof(string), "  Balance: $%d  |  Interest rate: 0.%d percent {FFFF00}(Silver VIP: 150k max)", account, tmpintrate);
						SendClientMessageEx(i, COLOR_GRAD1, string);
						
						PlayerInfo[i][pTokens] += 4;
						format(string, sizeof(string), "  You have received 4 VIP Tokens (Silver). You now have %d tokens", PlayerInfo[i][pTokens]);
						SendClientMessageEx(i, COLOR_GRAD1, string);
					}
					else if(PlayerInfo[i][pDonateRank] == 3)
					{
						format(string, sizeof(string), "  Balance: $%d  |  Interest rate: 0.%d percent {FFFF00}(Gold VIP: 200k max)", account, tmpintrate);
						SendClientMessageEx(i, COLOR_GRAD1, string);
						
						PlayerInfo[i][pTokens] += 6;
						format(string, sizeof(string), "  You have received 6 VIP Tokens (Gold). You now have %d tokens", PlayerInfo[i][pTokens]);
						SendClientMessageEx(i, COLOR_GRAD1, string);
					}
					else if(PlayerInfo[i][pDonateRank] >= 4)
					{
						format(string, sizeof(string), "  Balance: $%d  |  Interest rate: 0.%d percent {FFFF00}(Platinum VIP: 250k max)", account, tmpintrate);
						SendClientMessageEx(i, COLOR_GRAD1, string);
						
						PlayerInfo[i][pTokens] += 8;
						format(string, sizeof(string), "  You have received 8 VIP Tokens (Platinum). You now have %d tokens", PlayerInfo[i][pTokens]);
						SendClientMessageEx(i, COLOR_GRAD1, string);
					}
					else if(PlayerInfo[i][pDonateRank] == 5)
					{
						format(string, sizeof(string), "  Balance: $%d  |  Interest rate: 0.%d percent {FFFF00}(Investor: 250k max)", account, tmpintrate);
						SendClientMessageEx(i, COLOR_GRAD1, string);
						
						PlayerInfo[i][pTokens] += 10;
						format(string, sizeof(string), "  You have received 10 VIP Tokens (Investor). You now have %d tokens", PlayerInfo[i][pTokens]);
						SendClientMessageEx(i, COLOR_GRAD1, string);
					}

					if(PlayerInfo[i][pTaxiLicense] == 1)
					{
						format(string, sizeof(string), "  Taxi licensing fee (5 percent): -$%d",faretax);
						SendClientMessageEx(i, COLOR_GRAD2, string);
					}
					if(PlayerInfo[i][pCarInsurance] == 1)
					{
						format(string, sizeof(string), "  Car insurance fee (9 percent): -$%d",insuretax);
						SendClientMessageEx(i, COLOR_GRAD2, string);
					}
					if(PlayerInfo[i][pEnrolledEZPass] == 1)
					{
					    for(new v = 0; v < MAX_PLAYERVEHICLES; v++)
					    {
					        if(PlayerVehicleInfo[i][v][pvEZPass] == 1)
					        {
					            ezpassfee += 510;
							}
						}
							format(string, sizeof(string), "  EZPass fee: -$%d",ezpassfee);
							SendClientMessageEx(i, COLOR_GRAD2, string);
					}
					
					new paycheck = checks - Taxable - faretax - proptax - utilities - socialsec - insuretax - ezpassfee; // Final outcome of money
					new name[24];
					GetPlayerName(i,name,24);
					for(new biz=0; biz<MAX_BUSINESS; biz++)
					{
						if(!strcmp(name, BizInfo[biz][bOwner], false))
						{
							if(BizInfo[biz][bType] == 1)
							{
							    businesspay[i] += random(100000);
							}
							if(BizInfo[biz][bType] == 2)
							{
							    businesspay[i] += random(45000);
							}
							if(BizInfo[biz][bType] == 3)
							{
							    businesspay[i] += random(50000);
							}
						}
					}
					if(businesspay[i] != 0)
					{
						format(string,sizeof(string),"  Business Profits: $%d", businesspay[i]);
						SendClientMessageEx(i, COLOR_GRAD2, string);
						PlayerInfo[i][pAccount] += businesspay[i];
					}
					
					if(PlayerInfo[i][pMember] != 0 && PlayerInfo[i][pMember] != 8 && PlayerInfo[i][pMember] != 13)
					{
					    if(Tax <= 0)
						{
							SendClientMessageEx(i,COLOR_RED,"The government is in debt; no money is available for pay.");
						}
						else if(PlayerInfo[i][pDuty] == 1)
						{
							Tax -= FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]];
							format(string,sizeof(string),"  Government pay: $%d", FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]]);
					    	SendClientMessageEx(i, COLOR_GRAD2, string);
						}
						else
						{
							format(string,sizeof(string),"	You did not work enough to get Government Pay, go on duty!");
					    	SendClientMessageEx(i, COLOR_YELLOW, string);
						}
					}
					else {
						if(Tax <= 0)
						{
							SendClientMessageEx(i,COLOR_RED,"The government is in debt; no welfare money is available for pay.");
						}
						else
						{
							if(PlayerInfo[i][pLevel] <= 10) {
								welfarepay = (PlayerInfo[i][pLevel]*25);
							}
							else welfarepay = 500;
							Tax -= welfarepay;
							format(string,sizeof(string),"  Welfare check: $%d", welfarepay);
					    	SendClientMessageEx(i, COLOR_GRAD2, string);
							PlayerInfo[i][pAccount] += welfarepay;
						}
					}
					format(string, sizeof(string), "  Interest gained: $%d", interest);
					SendClientMessageEx(i, COLOR_GRAD3, string);
					SendClientMessageEx(i, COLOR_GRAD4, "______________________________________");
					format(string, sizeof(string), "  New account balance: $%d  |  Rent paid: -$%d", PlayerInfo[i][pAccount],rent);
					SendClientMessageEx(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "  Paycheck (Taxes and profits applied): $%d", paycheck+businesspay[i]+interest);
					SendClientMessageEx(i, COLOR_GRAD5, string);
					
					if(PlayerInfo[i][pMember] != 0 && PlayerInfo[i][pMember] != 8 && PlayerInfo[i][pMember] != 13 && Tax >= 0)
					{
						new facmemberpay = FactionPay[PlayerInfo[i][pMember]-1][PlayerInfo[i][pRank]];
						PlayerInfo[i][pAccount] += facmemberpay;
					}
					PlayerInfo[i][pAccount] += paycheck;

					GameTextForPlayer(i, "~p~PayDay~n~~w~Paycheck", 5000, 1);
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					PlayerInfo[i][pConnectTime] += 1;
					if(PlayerInfo[i][pConnectTime] == 2) SendClientMessageEx(i, COLOR_LIGHTRED, "You may now possess/use weapons!");
					if(PlayerInfo[i][pDonateRank] > 0)
					{
						PlayerInfo[i][pPayDayHad] = 0;
						//PlayerInfo[i][pPayDayHad] += 1;
						if(PlayerInfo[i][pPayDayHad] >= 5)
						{
							PlayerInfo[i][pExp]++;
							PlayerInfo[i][pPayDayHad] = 0;
						}
					}
					if(PlayerInfo[i][pWRestricted] > 0)
					{
					    PlayerInfo[i][pWRestricted]--;
						if(PlayerInfo[i][pWRestricted] == 0) SendClientMessageEx(i, COLOR_LIGHTRED, "Your weapons are no longer restricted!");
					}

				}
				else
				{
					SendClientMessageEx(i, COLOR_LIGHTRED, "* You haven't played long enough to obtain a paycheck.");
				}
			}
	}
	for (new x=0; x<MAX_POINTS; x++)
	{
		Points[x][Announced] = 0;
		if (Points[x][Vulnerable] > 0)
		{
			Points[x][Vulnerable]--;
			UpdatePoints();
		}
		if(Points[x][Vulnerable] == 0 && Points[x][Announced] == 1)
		{
		}
		if (Points[x][Vulnerable] == 0 && Points[x][Type] >= 0 && Points[x][Announced] == 0 && Points[x][ClaimerId] == INVALID_PLAYER_ID)
		{
		//	format(string, sizeof(string), "%s has become available for capture.", Points[x][Name]);
		//	SendClientMessageToAllEx(COLOR_YELLOW, string);
			//SetPlayerCheckpoint(i, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz], 3);
			ReadyToCapture(x);
			Points[x][Announced] = 1;
		}
	}
	SaveStuff();
	SaveServerStats();
	FMemberCounter(); // Family member counter (requested by game affairs to track gang activity)
	return 1;
}
Also ServerHeartBeat

Code:
 // Timer Name: ServerHeartbeat()
// TickRate: 1 secs.
ptask ServerHeartbeat[1000](playerid)
{
    new string[128];
	new level = PlayerInfo[playerid][pLevel];
ServerHeartBeatTwo
Code:
 // Timer Name: ServerHeartbeatTwo()
// TickRate: 1 secs.
ptask ServerHeartbeatTwo[1000](playerid)
{
Not sure exactly if there was more code you needed... Let me know

Okay so i got it to comlipe and run with -d3 pawn.cfg and this is what i got in the crash detect

Code:
  [debug] AMX backtrace:
[21:20:10] [debug] #0 00750f2c in ServerHeartbeatTwo (playerid=0) at C:\Users\Faerless\Desktop\LAC\gamemodes\LAC.pwn:127610
[21:20:10] [debug] #1 00750ce8 in public ServerHeartbeatTwo@_yT (p=0) at C:\Users\Faerless\Desktop\LAC\gamemodes\LAC.pwn:127600
[21:20:11] [debug] Run time error 4: "Array index out of bounds"
[21:20:11] [debug] Accessing element at index 12 past array upper bound 11
Reply
#12

I can renew the Scriptfiles and try to fix the script if you want... contact me on skype hafidan.antares1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)