Re: [Help] Streamer (I think) -
Austin - 21.11.2010
My goodness. That is CRAZY.
OnPlayerUpdate is called about 20 times a SECOND. You are saving to that file too often.
This could be set up on a timer to execute every 60 seconds and would still be too much.
You are saving roughly 1,200 times a minute!!!
Re: [Help] Streamer (I think) -
joeri55 - 21.11.2010
LMAO, so how the fuck do I fix it? It's the la-rp script..? Is the la-rp scripter a retart? I know I needed to script from scratch but I can't script that good.
Re: [Help] Streamer (I think) -
willsuckformoney - 21.11.2010
Don't use OnPlayerDisconnect, player crashes, doesn't always save! Use a TIMER! 3 second timer or 500 ms.
Re: [Help] Streamer (I think) -
Austin - 21.11.2010
500ms timer? Are you deluded?
Save it when it has to be saved. OnPlayerDeath/Disconnect/whenever something changes.
Put all of that code into something like...
pawn Код:
stock SavePlayerInfo(playerid)
{
// Code here
}
And simply call SavePlayerInfo(playerid); when something relevant happens.
Re: [Help] Streamer (I think) -
joeri55 - 21.11.2010
I don't understand how to save that shit I ain't that good tho.. But it never gave me any problems, the onplayerupdate and shit.. Can that be why the objects aren't loading? Because that's the main problem I will fix the other things but it was working w/e is the onplayerupdate seconds. It always worked and now it ain't. That's my problem. So does the onplayerupdate can make the objects disappear?
Re: [Help] Streamer (I think) -
Retardedwolf - 21.11.2010
Quote:
Originally Posted by willsuckformoney
Don't use OnPlayerDisconnect, player crashes, doesn't always save! Use a TIMER! 3 second timer or 500 ms.
|
It does get called when a player gets crashed.
@Joeri55, This
MIGHT be the cause to the objects disappearance. We recommend you to take that out immediately first and see if it gets solved.
Re: [Help] Streamer (I think) -
willsuckformoney - 21.11.2010
Timer saves time....
pawn Код:
//Filter or GamemodeInit
SetTimer("SavePlayer",5000,true); //5 seconds....
//somewhere else...
forward SavePlayer(playerid);
public SavePlayer(playerid)
{
//What ever your playerinfo stuff is.....
return 1;
}
Saves time, also its more efficient... You don't have to worry about your files not saving if crashed... If you die, there is no real need to update a file... Just PlayerInfo[playerid][Deaths]++; on OnPlayerDeath then save them later...
Re: [Help] Streamer (I think) -
willsuckformoney - 21.11.2010
Well yeah, player crash, server crash them its kinda could be fucked.
Double post oops
Re: [Help] Streamer (I think) -
Grim_ - 21.11.2010
It would be just as good saving under OnPlayerDisconnect then in a timer. The chances of your server crashing, unless your script is crash (which it shouldn't be on a server anyway), are very slim. With saving at the time the player disconnects is the best option, unless you are TRULY that worried about keeping everyone's stats perfect.
Re: [Help] Streamer (I think) -
joeri55 - 21.11.2010
It's fixed.. I don't know why but since I deleted some things from my ftp and restarted it yesterday it's working again. Thanks for all your help guys! And bout the timer..
Quote:
Originally Posted by willsuckformoney
Timer saves time....
pawn Код:
//Filter or GamemodeInit SetTimer("SavePlayer",5000,true); //5 seconds....
//somewhere else... forward SavePlayer(playerid); public SavePlayer(playerid) { //What ever your playerinfo stuff is..... return 1; }
Saves time, also its more efficient... You don't have to worry about your files not saving if crashed... If you die, there is no real need to update a file... Just PlayerInfo[playerid][Deaths]++; on OnPlayerDeath then save them later...
|
Can I make from saveplayer onplayerupdate?
Re: [Help] Streamer (I think) -
Austin - 21.11.2010
willsuckformoney, your code is VERY inefficient.
You should only save when a player does something that needs to be saved. Why would you save the SAME INFORMATION every 5 seconds? It's just utterly stupid.
On my server, we save kills and deaths, so the only time I need to worry is OnPlayerDeath. Why would I save the stat of kills/deaths on a timer? It only matters when a player dies.