[Help] /enter biz i sbizz -
Markoni990 - 28.03.2015
I use gamemode gtarp have a problem with the entrance to the biz when you want to go in server shuts it off.
PHP код:
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
{
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
GameTextForPlayer(playerid, "~g~Dobrodosli kuci", 4000, 4);
HouseInfo[playerid][hTimers] = 0;
OnPropTextdrawUpdate();
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
HouseEntered[playerid] = i;
}
else
{
GameTextForPlayer(playerid, "~r~Kuca ~w~Zakljucana", 4000, 4);
}
}
}
// ulaz u stanove ********************************************************
for(new i = 0; i < sizeof(StanInfo); i++)
{
if (PlayerToPoint(3, playerid,StanInfo[i][sEntrancex], StanInfo[i][sEntrancey], StanInfo[i][sEntrancez]))
{
if(PlayerInfo[playerid][pPstankey] == i || StanInfo[i][sLock] == 0)
{
SetPlayerInterior(playerid,StanInfo[i][sInt]);
SetPlayerVirtualWorld(playerid,StanInfo[i][sWorld]);
SetPlayerPos(playerid,StanInfo[i][sExitx],StanInfo[i][sExity],StanInfo[i][sExitz]);
GameTextForPlayer(playerid, "~w~Dobrodosli u stan", 5000, 1);
StanEntered[playerid] = i;
}
else
{
GameTextForPlayer(playerid, "~r~Zakljucano", 5000, 1);
}
}
}
// *****************************************************************************
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(BizzInfo[i][bLocked] == 1)
{
GameTextForPlayer(playerid, "~w~Firma ~r~zatvorena", 4000, 4);
return 1;
}
if(BizzInfo[i][bProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 4);
return 1;
}
if (PlayerToPoint(3.0, playerid,1199.323974,-918.954528,43.116638))
{
OnPlayerEnterFood(playerid, 5);
}
else if (PlayerToPoint(3.0, playerid,811.321411,-1616.181030,13.546875))
{
OnPlayerEnterFood(playerid, 6);
}
else if (PlayerToPoint(3.0, playerid,927.906250,-1352.942626,13.343750))
{
OnPlayerEnterFood(playerid, 7);
}
GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
format(string, sizeof(string), "~r~-$%d~n~~w~kucajte /exit~n~da izadjete", BizzInfo[i][bEntranceCost]);
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
BizzInfo[i][bProducts]--;
OnPropUpdate();
}
SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
PlayerInfo[playerid][pLocal] = i+99;
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
format(string, sizeof(string), "%s je platio $%d da bi usao u firmu %d", dood, BizzInfo[i][bEntranceCost], i);
printf("%s", string);
PayLog(string);
}
else
{
GameTextForPlayer(playerid, "~r~Nemate dovoljno novca", 5000, 1);
}
}
}
// *****************************************************************************************
if (PlayerToPoint(4, playerid,2073.2979,-1831.1228,13.5469))
{ // Pay & Spray kod PIZZA Sbizz 57
if(GetPlayerState(playerid) == 2)
{
if(GetPlayerMoney(playerid) > SBizzInfo[34][sbEntranceCost] + 100)
{
if(SBizzInfo[34][sbProducts] > 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 2062.1294,-1831.5498,13.5469);
SetVehicleZAngle(tmpcar, 90);
GivePlayerMoney(playerid, - SBizzInfo[34][sbEntranceCost]);
SBizzInfo[34][sbTill] += SBizzInfo[34][sbEntranceCost];
SBizzInfo[34][sbProducts]--;
SetTimerEx("AfterSpray1", 5000, false, "i", playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
}
}
}
else if (PlayerToPoint(4, playerid,1024.9756,-1030.7930,32.0257))
{ // Pay & Spray BURG Sbizz 55
if(GetPlayerState(playerid) == 2)
{
if(GetPlayerMoney(playerid) > SBizzInfo[32][sbEntranceCost] + 100)
{
if(SBizzInfo[32][sbProducts] > 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 1024.9763,-1021.8850,32.1016);
SetVehicleZAngle(tmpcar, 0);
GivePlayerMoney(playerid, - SBizzInfo[32][sbEntranceCost]);
SBizzInfo[32][sbTill] += SBizzInfo[32][sbEntranceCost];
SBizzInfo[32][sbProducts]--;
SetTimerEx("AfterSpray2", 5000, false, "i", playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
}
}
}
else if (PlayerToPoint(4, playerid,488.3819,-1733.0563,11.1752))
{ // Pay & Spray PLAZA Sbizz
if(GetPlayerState(playerid) == 2)
{
if(GetPlayerMoney(playerid) > SBizzInfo[33][sbEntranceCost] + 100)
{
if(SBizzInfo[33][sbProducts] > 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 487.4099,-1741.4585,11.1330);
SetVehicleZAngle(tmpcar, 180);
GivePlayerMoney(playerid, - SBizzInfo[33][sbEntranceCost]);
SBizzInfo[33][sbTill] += SBizzInfo[33][sbEntranceCost];
SBizzInfo[33][sbProducts]--;
SetTimerEx("AfterSpray3", 5000, false, "i", playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
}
}
}
else if (PlayerToPoint(4, playerid,719.8940,-464.8272,16.3359))
{ // Pay & Spray kod BIKERA Sbizz 5
if(GetPlayerState(playerid) == 2)
{
if(GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100)
{
if(SBizzInfo[5][sbProducts] > 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 720.3924,-456.0286,16.3359);
SetVehicleZAngle(tmpcar, 0);
GivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]);
SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost];
SBizzInfo[5][sbProducts]--;
SetTimerEx("AfterSpray4", 5000, false, "i", playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
}
}
}
}
return 1;
}
Re: [Help] /enter biz i sbizz -
Crayder - 28.03.2015
Install this to your server :
https://github.com/Zeex/samp-plugin-...etect/releases
Put the dll/so file in your plugins file, open server.cfg add 'crashdetect' to the plugins line. Run your server and make it crash again, print the log here.
Respuesta: [Help] /enter biz i sbizz -
Markoni990 - 28.03.2015
Код:
[02:53:46] [join] Markoni has joined the server (0:109.93.21.41)
[02:53:58] Markoni has logged in.
[02:54:12] Markoni je platio $500 da bi usao u firmu 5
[02:54:12] [debug] Server crashed while executing bombom.amx
[02:54:12] [debug] AMX backtrace:
[02:54:12] [debug] #0 native fwrite () from samp03svr
[02:54:12] [debug] #1 00038cbc in public PayLog (7069396) from bombom.amx
[02:54:12] [debug] #2 00602ad8 in public OnPlayerKeyStateChange (0, 16, 0) from bombom.amx
[02:54:12] [debug] Native backtrace:
[02:54:12] [debug] #0 b74d7e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[02:54:12] [debug] #1 b74d0bcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[02:54:12] [debug] #2 b74d1dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[02:54:12] [debug] #3 b74d2226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[02:54:12] [debug] #4 b74d7adc in ?? () from plugins/crashdetect.so
[02:54:12] [debug] #5 b77a4600 in ?? ()
[02:54:12] [debug] #6 b77a4420 in ?? ()
[02:54:12] [debug] #7 b7525a71 in gsignal () from /lib32/libc.so.6
[02:54:12] [debug] #8 b7528e92 in abort () from /lib32/libc.so.6
[02:54:12] [debug] #9 b751e978 in __assert_fail () from /lib32/libc.so.6
[02:54:12] [debug] #10 0809a90c in ?? () from ./samp03svr
[02:54:12] [debug] #11 0809ad6f in ?? () from ./samp03svr
[02:54:12] [debug] #12 08094054 in ?? () from ./samp03svr
[02:54:12] [debug] #13 b74d394b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[02:54:12] [debug] #14 b74d68f8 in ?? () from plugins/crashdetect.so
[02:54:12] [debug] #15 b74da916 in amx_Exec () from plugins/crashdetect.so
[02:54:12] [debug] #16 b74d2be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so
[02:54:12] [debug] #17 b74d6659 in ?? () from plugins/crashdetect.so
[02:54:12] [debug] #18 b7422f4a in ?? () from plugins/streamer.so
[02:54:12] [debug] #19 080a4819 in ?? () from ./samp03svr
[02:54:12] [debug] #20 080caf75 in ?? () from ./samp03svr
[02:54:12] [debug] #21 080cb8e6 in ?? () from ./samp03svr
[02:54:12] [debug] #22 080aafe8 in ?? () from ./samp03svr
[02:54:12] [debug] #23 080ad438 in ?? () from ./samp03svr
[02:54:12] [debug] #24 080ad562 in ?? () from ./samp03svr
[02:54:12] [debug] #25 080a88ce in ?? () from ./samp03svr
[02:54:12] [debug] #26 b7511ca6 in __libc_start_main () from /lib32/libc.so.6
[02:54:12] [debug] #27 0804b4d1 in ?? () from ./samp03svr
Re: [Help] /enter biz i sbizz -
Pottus - 28.03.2015
Looks like your going to have start putting in print(); statements to pinpoint where the crash is happening.
Respuesta: [Help] /enter biz i sbizz -
Markoni990 - 28.03.2015
How can I fix anyone know?
Re: [Help] /enter biz i sbizz -
CalvinC - 28.03.2015
As Pottus said, put prints around in your code to see where it goes wrong.
Respuesta: [Help] /enter biz i sbizz -
Markoni990 - 28.03.2015
PHP код:
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
{
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
GameTextForPlayer(playerid, "~g~Dobrodosli kuci", 4000, 4);
HouseInfo[playerid][hTimers] = 0;
OnPropTextdrawUpdate();
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
HouseEntered[playerid] = i;
}
else
{
GameTextForPlayer(playerid, "~r~Kuca ~w~Zakljucana", 4000, 4);
}
}
}
// *****************************************************************************
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(BizzInfo[i][bLocked] == 1)
{
GameTextForPlayer(playerid, "~w~Firma ~r~zatvorena", 4000, 4);
return 1;
}
if(BizzInfo[i][bProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 4);
return 1;
}
if (PlayerToPoint(3.0, playerid,1199.323974,-918.954528,43.116638))
{
OnPlayerEnterFood(playerid, 5);
}
else if (PlayerToPoint(3.0, playerid,811.321411,-1616.181030,13.546875))
{
OnPlayerEnterFood(playerid, 6);
}
else if (PlayerToPoint(3.0, playerid,927.906250,-1352.942626,13.343750))
{
OnPlayerEnterFood(playerid, 7);
}
GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
format(string, sizeof(string), "~r~-$%d~n~~w~kucajte /exit~n~da izadjete", BizzInfo[i][bEntranceCost]);
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
BizzInfo[i][bProducts]--;
OnPropUpdate();
}
SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
PlayerInfo[playerid][pLocal] = i+99;
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
format(string, sizeof(string), "%s je platio $%d da bi usao u firmu %d", dood, BizzInfo[i][bEntranceCost], i);
printf("%s", string);
PayLog(string);
}
else
{
GameTextForPlayer(playerid, "~r~Nemate dovoljno novca", 5000, 1);
}
}
}
// *****************************************************************************************
if (PlayerToPoint(4, playerid,2073.2979,-1831.1228,13.5469))
{ // Pay & Spray kod PIZZA Sbizz 57
if(GetPlayerState(playerid) == 2)
{
if(GetPlayerMoney(playerid) > SBizzInfo[34][sbEntranceCost] + 100)
{
if(SBizzInfo[34][sbProducts] > 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 2062.1294,-1831.5498,13.5469);
SetVehicleZAngle(tmpcar, 90);
GivePlayerMoney(playerid, - SBizzInfo[34][sbEntranceCost]);
SBizzInfo[34][sbTill] += SBizzInfo[34][sbEntranceCost];
SBizzInfo[34][sbProducts]--;
SetTimerEx("AfterSpray1", 5000, false, "i", playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
}
}
}
else if (PlayerToPoint(4, playerid,1024.9756,-1030.7930,32.0257))
{ // Pay & Spray BURG Sbizz 55
if(GetPlayerState(playerid) == 2)
{
if(GetPlayerMoney(playerid) > SBizzInfo[32][sbEntranceCost] + 100)
{
if(SBizzInfo[32][sbProducts] > 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 1024.9763,-1021.8850,32.1016);
SetVehicleZAngle(tmpcar, 0);
GivePlayerMoney(playerid, - SBizzInfo[32][sbEntranceCost]);
SBizzInfo[32][sbTill] += SBizzInfo[32][sbEntranceCost];
SBizzInfo[32][sbProducts]--;
SetTimerEx("AfterSpray2", 5000, false, "i", playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
}
}
}
else if (PlayerToPoint(4, playerid,488.3819,-1733.0563,11.1752))
{ // Pay & Spray PLAZA Sbizz
if(GetPlayerState(playerid) == 2)
{
if(GetPlayerMoney(playerid) > SBizzInfo[33][sbEntranceCost] + 100)
{
if(SBizzInfo[33][sbProducts] > 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 487.4099,-1741.4585,11.1330);
SetVehicleZAngle(tmpcar, 180);
GivePlayerMoney(playerid, - SBizzInfo[33][sbEntranceCost]);
SBizzInfo[33][sbTill] += SBizzInfo[33][sbEntranceCost];
SBizzInfo[33][sbProducts]--;
SetTimerEx("AfterSpray3", 5000, false, "i", playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
}
}
}
else if (PlayerToPoint(4, playerid,719.8940,-464.8272,16.3359))
{ // Pay & Spray kod BIKERA Sbizz 5
if(GetPlayerState(playerid) == 2)
{
if(GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100)
{
if(SBizzInfo[5][sbProducts] > 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 720.3924,-456.0286,16.3359);
SetVehicleZAngle(tmpcar, 0);
GivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]);
SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost];
SBizzInfo[5][sbProducts]--;
SetTimerEx("AfterSpray4", 5000, false, "i", playerid);
}
else
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
}
}
}
}
return 1;
}
PHP код:
if((newkeys == KEY_SECONDARY_ATTACK))
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]) && PlayerInfo[playerid][pLocal] == i)
{
if(GetPlayerVirtualWorld(playerid) == HouseInfo[i][hWorld])
{
PlayerInfo[playerid][pVirWorld] = 0;
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid,0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
PlayerInfo[playerid][pLocal] = 255;
if(HouseInfo[i][hHel] == 1)
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if(tempheal < 100.0)
{
SetPlayerHealth(playerid,100.0);
}
}
}
}
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
//printf("Bizz :%d",i);
if (PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
{
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid,0);
PlayerInfo[playerid][pVirWorld] = 0;
SetPlayerPos(playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]);
PlayerInfo[playerid][pLocal] = 255;
}
}
}
}
if(newkeys == KEY_SECONDARY_ATTACK)
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
{
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
GameTextForPlayer(playerid, "~g~Dobrodosli kuci", 4000, 4);
HouseInfo[playerid][hTimers] = 0;
OnPropTextdrawUpdate();
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
HouseEntered[playerid] = i;
}
else
{
GameTextForPlayer(playerid, "~r~Kuca ~w~Zakljucana", 4000, 4);
}
}
}
// *****************************************************************************
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(BizzInfo[i][bLocked] == 1)
{
GameTextForPlayer(playerid, "~w~Firma ~r~zatvorena", 4000, 4);
return 1;
}
if(BizzInfo[i][bProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 4);
return 1;
}
if (PlayerToPoint(3.0, playerid,1199.323974,-918.954528,43.116638))
{
OnPlayerEnterFood(playerid, 5);
}
else if (PlayerToPoint(3.0, playerid,811.321411,-1616.181030,13.546875))
{
OnPlayerEnterFood(playerid, 6);
}
else if (PlayerToPoint(3.0, playerid,927.906250,-1352.942626,13.343750))
{
OnPlayerEnterFood(playerid, 7);
}
GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
format(string, sizeof(string), "~r~-$%d~n~~w~kucajte /exit~n~da izadjete", BizzInfo[i][bEntranceCost]);
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
BizzInfo[i][bProducts]--;
OnPropUpdate();
}
SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
PlayerInfo[playerid][pLocal] = i+99;
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
format(string, sizeof(string), "%s je platio $%d da bi usao u firmu %d", dood, BizzInfo[i][bEntranceCost], i);
printf("%s", string);
PayLog(string);
}
else
{
GameTextForPlayer(playerid, "~r~Nemate dovoljno novca", 5000, 1);
}
}
}
return 1;
}
PHP код:
enum bInfo
{
bOwned,
bOwner[64],
bMessage[128],
bExtortion[MAX_PLAYER_NAME],
Float:bEntranceX,
Float:bEntranceY,
Float:bEntranceZ,
Float:bExitX,
Float:bExitY,
Float:bExitZ,
bLevelNeeded,
bBuyPrice,
bEntranceCost,
bTill,
bLocked,
bInterior,
bProducts,
bMaxProducts,
bPriceProd,
bFakture,
bWorld,
};
new BizzInfo[36][bInfo];
Re: [Help] /enter biz i sbizz -
Konstantinos - 28.03.2015
Invalid file handle crashed the server. You must write (same for reading and pretty much using most of the file functions) to the file
only if it was opened correctly.
The problem is in PayLog function and it should be like (an example):
PHP код:
new
File: handle= fopen(...);
// if opened successful:
if (handle)
{
fwrite(...);
fclose(handle);
}
Respuesta: [Help] /enter biz i sbizz -
Markoni990 - 28.03.2015
PHP код:
public PayLog(string[])
{
new entry[256];
format(entry, sizeof(entry), "%s\n",string);
new File:hFile;
hFile = fopen("logs/pay.log", io_append);
fwrite(hFile, entry);
fclose(hFile);
}
Still not tried it in all ways
Respuesta: [Help] /enter biz i sbizz -
Markoni990 - 28.03.2015
Lock this, i am fixed a problem