• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved On player death

nevix

Tunzodus.net
Joined
Mar 31, 2010
Messages
356
Reaction score
62
Location
Lithuanian
Guys how to do when player death he lost nothing? eg:

if player have storage 25001 when he die he lost nothing? please help
 
You can add it to your playerdeath.lua
Code:
if getPlayerStorageValue(cid, 25001) > 0 then
    doSetCreatureDropLoot(cid, false)
end
 
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.
 
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"?
 
Which server do you use? Do you get errors? What do you mean with "without that if"?

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

I just replaced the raw numbers with "storage" that you see in the script i pasted. It's not being defined anywhere
Code:
if getPlayerStorageValue(cid, 789500) > 0 then
    doSetCreatureDropLoot(cid, false)
end
Sorry for the confusion.

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.
 
I just replaced the raw numbers with "storage" that you see in the script i pasted. It's not being defined anywhere
Code:
if getPlayerStorageValue(cid, 789500) > 0 then
    doSetCreatureDropLoot(cid, false)
end
Sorry for the confusion.

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.
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.
 
Back
Top