[Help] Streamer (I think)
#21

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!!!
Reply
#22

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.
Reply
#23

Don't use OnPlayerDisconnect, player crashes, doesn't always save! Use a TIMER! 3 second timer or 500 ms.
Reply
#24

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.
Reply
#25

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?
Reply
#26

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.
Reply
#27

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...
Reply
#28

Well yeah, player crash, server crash them its kinda could be fucked.

Double post oops
Reply
#29

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.
Reply
#30

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?
Reply
#31

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)