Same script doesnt work on linux same as in window servers - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Same script doesnt work on linux same as in window servers (
/showthread.php?tid=299390)
Same script doesnt work on linux same as in window servers -
Voldemort - 25.11.2011
Alright, so I get some kind of strange thing, I use same script, same plugins, on windows server it works fine, but when I upload to my linux server, server just crash, here is code part which cause the crash.
pawn Код:
public GiveRealMoney(playerid,money)
{
SCM(playerid,-1,"2");
if(IsPlayerAttachedObjectSlotUsed(playerid,1))
{
RemovePlayerAttachedObject(playerid,1);
}
if(IsPlayerAttachedObjectSlotUsed(playerid,2))
{
RemovePlayerAttachedObject(playerid,2);
}
SCM(playerid,-1,"3");//Here
Pinfo[playerid][Cash] += money;
SavePlayerStat(playerid,"PlayerMoney",Pinfo[playerid][Cash]);
SCM(playerid,-1,"4");
if(Pinfo[playerid][Local] != IN_CASINO)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,Pinfo[playerid][Cash]);
}
new string[20];
format(string, sizeof(string), "+$%d",money);
MoneyTD(playerid,1,string,0x36682CFF);
SCM(playerid,-1,"7");
if(Pinfo[playerid][Cash] > 9999)
{
SetPlayerAttachedObject(playerid,1,1210,5,0.3,0.1,0.0,0.0,270.0,0.0);
}
if(Pinfo[playerid][Cash] > 49999)
{
SetPlayerAttachedObject(playerid,2,1210,6,0.3,0.1,0.0,0.0,270.0,0.0);
}
return 1;
}
sometimes It cant execute at "2" sometimes it gets till SCM(playerid,-1,"3");
and here is script between 3 and 4
pawn Код:
SavePlayerStat(playerid,stat[],value)
{
if(Pinfo[playerid][Level] == 0)
{
SCM(playerid,COLOR_SAMP,"SERVER: Unable to save your account."); return 1;
}
mysql_queryF("UPDATE `users` SET `%s` = '%d' WHERE `id` = '%d'",stat,value,Pinfo[playerid][Sqlid]);
return 1;
}
Something in this script cause server crash on linux, while on windows working perfectly