Pawno crash at compiling
#1

So when i try to compile my script, I get the following message:
"Pawno compiler library has stopped working" and it crashes

I added these lines of code (it worked just fine before):
Код:
new CP_bank;
new CP_ammu;
new CP_burger;
new CP_pizza;
new CP_gym;

new ROBBING_BANK[MAX_PLAYERS];
new bankrobbedrecently =0;
new ROBBING_AMMU[MAX_PLAYERS];
new ammurobbedrecently =0;
new ROBBING_BURGER[MAX_PLAYERS];
new burgerrobbedrecently =0;
new ROBBING_PIZZA[MAX_PLAYERS];
new pizzarobbedrecently =0;
new ROBBING_GYM[MAX_PLAYERS];
new gymrobbedrecently =0;
Код:
public OnGameModeInit()
{
	mysql = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE, MYSQL_PASSWORD);
	SetTimer("ServerRobbery", 1000, 1); // this one is new, the rest was there before

	if(mysql_errno() != 0)
	{
	    printf("[MySQL] The connection has failed.");
	}
	else
	{
	    printf("[MySQL] The connection has been established.");
	}
	return true;
}
Код:
public OnPlayerSpawn(playerid)
{
	CP_bank = CreateDynamicCP(-201.2237,-42.7339,1002.2734, 2.0, .interiorid = 3); //Dont forget the dot "."//
	return 1;
}
and finally:
Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
	if(checkpointid == CP_bank)
	{
		SendClientMessage(playerid, COLOR_RED, "Start to rob the bank by typing /rob");
	}
	return 1;
}

public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
	if(checkpointid == CP_bank)
	{
	    if(ROBBING_BANK[playerid] >= 1)
	    {
			SendClientMessage(playerid, COLOR_RED, "[ERROR] Robbery failed!");
			ROBBING_BANK[playerid] = 0;
			return 1;
	    }
	}
	return 1;
}

CMD:rob(playerid, params[])
{
	#pragma unused params
	if(IsPlayerInDynamicCP(playerid, CP_bank))
	{
		if(bankrobbedrecently >= 1)
		{
		    SendClientMessage(playerid, COLOR_RED, "This Bank has been robbed recently");
			return 1;
		}
	ROBBING_BANK[playerid] = 60;
	bankrobbedrecently = 180;
	}
	return 1;
}

forward ServerRobbery();
public ServerRobbery();
{
	for(new i=0; i<MAX_PLAYERS; i++)
	    {
	        if(IsPlayerConnected(i))
	        {
	            //ROBBERIES - Dont edit the above :)
	            if(ROBBING_BANK[i] > 1)
	            {
	                ROBBING_BANK[i] --;
	                new time[20];
	                format(time, sizeof(time),"Robbery Time: %d", ROBBING_BANK[i]);
	                GameTextForPlayer(i,time,500,3)
	            }
	            if(ROBBING_BANK[i] == 1) //If the robbing timer is equal to 1 (0 wont work) and the processing time...
	            {
	                new string[64], name[MAX_PLAYER_NAME];
	                GetPlayerName(i, name,MAX_PLAYER_NAME);
	                SendClientMessage(i, COLOR_GREEN, "Robbery complete!");
	                SetPlayerWantedLevel(i, GetPlayerWantedLevel(i) + 1);
					ROBBING_BANK[i] = 0; //Reset timer
					new moneyrand = random(50000);
					GivePlayerScore(i, 1);
					format(string,sizeof(string),"[ROBBERY] %s(%d) has robbed a total of $%d from the bank!",name,i,moneyrand);
					SendClientMessageToAll(COLOR_RED,string);
					GivePlayerMoney(i,moneyrand);
	                
	            }
        	}
	    }
	return 1;
}
whats wrong?
Reply
#2

remove #pragma unused params
Reply
#3

Quote:
Originally Posted by alexanderjb918
Посмотреть сообщение
remove #pragma unused params
Tried that, still the same error
Reply
#4

.interiorid what is that?
Reply
#5

Setting the interiorID for tattoo shop, removing the dot(.) in front of it doesnt change a thing
Reply
#6

Usually happens when you miss some brackets. Also, mysql_errno() is your code, I suppose it should be mysql_errno(mysql) - your connection handle variable.
Reply
#7

PHP код:
forward ServerRobbery();
public 
ServerRobbery(); 
PHP код:
public ServerRobbery(); 
Of course this will crash the pawno, remove the ";" from the public:

PHP код:
public ServerRobbery() 
Be careful next time
Reply
#8

Do thing that oMa37 said and it should do the job
Reply
#9

Quote:
Originally Posted by oMa37
Посмотреть сообщение
PHP код:
forward ServerRobbery();
public 
ServerRobbery(); 
PHP код:
public ServerRobbery(); 
Of course this will crash the pawno, remove the ";" from the public:

PHP код:
public ServerRobbery() 
Be careful next time
whaha im so stupid, thanks for the help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)