31.05.2016, 14:40
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):
and finally:
whats wrong?
"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;
}
Код:
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;
}


