nevix
Tunzodus.net
Guys how to do when player death he lost nothing? eg:
if player have storage 25001 when he die he lost nothing? please help
if player have storage 25001 when he die he lost nothing? please help
Which server do you use? Do you get errors? What do you mean with "without that if"?Sorry for bumping this thread but I have a question if anyone sees this.
I'm using that one exact script for something on my server and every time someone on your game screen dies the game freezes (up to a whole second). It does not happen without that if.
Edt: Please if you answer this post, quote me so I get a notification. Thanks in advance.
Which server do you use? Do you get errors? What do you mean with "without that if"?
if getPlayerStorageValue(cid, storage) > 0 then
doSetCreatureDropLoot(cid, false)
end
I mean, do you mean you don't get lagg without the if statement? So if you only have: doSetCreatureDropLoot(cid, false)TFS 1.0 latest version.
No errors
and this if
Code:if getPlayerStorageValue(cid, storage) > 0 then doSetCreatureDropLoot(cid, false) end
The lag appears to happen around 75% of the time, but not all the time.
The script actually works completely. It just happens to lag when someone dies. I don't know why since it shouldn't.
Sorry for doublepost
Yeah, it has been tested and yes, that is the case.I mean, do you mean you don't get lagg without the if statement? So if you only have: doSetCreatureDropLoot(cid, false)
Are you sure it's this part that is causing the lagg? If you remove this part, it all works fine?
Can you post the whole script? How is storage defined?Yeah, it has been tested and yes, that is the case.
And I mean the whole content of that if. I didn't try leaving the droploot thing.
if player:getStorageValue(storage) > 0 then
Can you post the whole script? How is storage defined?
You can use metatables, will be a bit faster, although not using them would not cause lagg.
Code:if player:getStorageValue(storage) > 0 then
if getPlayerStorageValue(cid, 789500) > 0 then
doSetCreatureDropLoot(cid, false)
end
I've tested it with the latest TFS 1.0 and default datapack, but I can't reproduce the problem. I was letting a character die about 20 times while walking with an other character but didn't got lagg.I just replaced the raw numbers with "storage" that you see in the script i pasted. It's not being defined anywhere
Sorry for the confusion.Code:if getPlayerStorageValue(cid, 789500) > 0 then doSetCreatureDropLoot(cid, false) end
I removed the if and tested only the content, and it does not cause a lag spike. It's the function that checks the storage when the playes dies that causes a spike.
I'll try the metatable and respond when I'm done.
Edit: Yeah, it still lags.