AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved Save Player Data (https://forums.alliedmods.net/showthread.php?t=320470)

tepegoz 12-23-2019 14:01

Save Player Data
 
I have original soccerjam mod and I want to change some features. I want when player disconnects, player's own deaths,kills,records are not removed for only current map.
Look codes below,
PHP Code:

public client_disconnect(id) {
if(
is_kickball) {
new 
x
for(1x<=RECORDSx++)
MadeRecord[id][x] = 0
remove_task
(id)
if(
ballholder == id ) {
ballholder 0
clearBall
()
}
if(
ballowner == id) {
ballowner 0
}

GoalyPoints[id] = 0
PlayerKills
[id] = 0
PlayerDeaths
[id] = 0
is_dead
[id] = false
seconds
[id] = 0
g_sprint
[id] = 0
PressedAction
[id] = 0
has_knife
[id] = false;
g_Experience[id] = 0

for(x=1x<=UPGRADESx++)
PlayerUpgrades[id][x] = 0
}


When I removed PlayerKills = 0 , PlayerDeaths[id] = 0 and MadeRecord[id][x] = 0
when player 1 reconnected, the player 1's data is loaded but somebody else is connect who has not data, still player 1's own data is loaded.
My request:
I want when players close the game(quit) and reconnected the players data are loaded for only current map. The data should be save by player's steamid. I tried using tries but I am noob . Can you change this sma to my requests? You can using tries thanks.


PHP Code:

new x
for(x=1x<=maxplayersx++) {
if(
is_user_connected(x))
{
Event_Record(xGOALYGoalyPoints[x], 0)
new 
kills get_user_frags(x)
new 
deaths cs_get_user_deaths(x)
setScoreInfo(x)
if( 
deaths 0)
PlayerDeaths[x] = deaths
if( kills 0)
PlayerKills[x] = kills
}



Mordekay 12-23-2019 22:08

Re: Save Player Data
 
I wonder how many times you will repost your request. This is the third time you are asking this and the plugin I linked you in your first request does all what you wanted. Parts of them you may not what can be disabled. What is wrong with the plugin I posted?

And just for your information: for the server it makes no difference at all if you do a retry or disconnect and manually reconnect or quit, restart and connect again to the server.

tepegoz 12-24-2019 04:40

Re: Save Player Data
 
İsn't this place the request forum? I wanted 3 times because your link useless. I want just a example using trie for save soccerjam kills,deaths,records,etc. I want to change this soccerjam mod . In the all of sma, there are only 2 part PlayerDeaths[ ] code and I thought this is no hard for convert to tries. I tried to convert but I don't have too much information codes.

OciXCrom 12-24-2019 08:18

Re: Save Player Data
 
Posting 30 times won't get you any better help. It will just make people angry at you and not wanting to help at all.

Mordekay 12-24-2019 12:23

Re: Save Player Data
 
Quote:

Originally Posted by tepegoz (Post 2677258)
when The player who quit the game(cs) and reconnect server, loads kills and frags but only for one map. After map change all data will should be removed.
Note: Player is quitting game(literally close the game) Not only disconnect.

This is your original request from the first post. The plugin i linked you to does exactly this. You did not said anything about tries, just this.
It is not my fault if you don't give all informations you have. And as Smiley told celltrie won't help you (no idea what problem you have, you did not explained it nor do i know what celltrie is)

Bugsy 12-24-2019 19:45

Re: Close
 
tepegoz, please do not delete your post after you solve your problem, others may be able to benefit from it...and use php tags instead of html..and indent

tepegoz 12-25-2019 07:17

Re: Close
 
Quote:

Originally Posted by Bugsy (Post 2677950)
tepegoz, please do not delete your post after you solve your problem, others may be able to benefit from it...and use php tags instead of html..and indent

There is no benefit things in this thread, I think you should remove this thread. I marked solve because I do not believe that my request will be resolved.

bad_boy 12-25-2019 10:11

Re: Close
 
Quote:

Originally Posted by tepegoz (Post 2677978)
I marked solve because I do not believe that my request will be resolved.

That is a dumb reason to mark your thread solved.
Those who can help you will not read your thread and those with the same problem will be confused.

HamletEagle 12-25-2019 15:04

Re: Save Player Data
 
Quote:

Originally Posted by tepegoz (Post 2677889)
I want just a example using trie for save soccerjam kills,deaths,records,etc.

You are impossible.
You firstly post in scripting help, I want to help you convert to tries and you refuse because you want someone to do it for you, not guide you thru.
Then you post in requests asking for help using tries. Why in the world didn't you post what you tried with tries when I asked you to if all you wanted was help with tries?

You are doing it totally backward:
scripting help: get advice/help figuring out what you tried isn't working.
requests: asking for someone to do it for you or find a plugin that already does what you need.

So for the 50th time: WHAT DO YOU WANT?
As I said before, I can help you figure tries out, it's extremely easy(5 lines of code). I just need you to post what you tried and be willing to learn.

tepegoz 12-26-2019 05:28

Re: Save Player Data
 
I solved my problem. I've added these codes to my sma. Yes this is the sample i want. All I wanted was these codes. :(
PHP Code:

new Trie:FragSIP
enum _
:kaydet {
    
SIP[32],
    
Kills,
    
Deaths
}
public 
plugin_init() {
FragSIP TrieCreate()
//bla..
//bla..
}

public 
plugin_end()
{
    
TrieDestroy(FragSIP)
}
public 
client_disconnect(id) {
    if(
is_kickball) {
        new 
x
        
for(1x<=RECORDSx++)
            
MadeRecord[id][x] = 0
        remove_task
(id)
        if(
ballholder == id ) {
            
ballholder 0
            clearBall
()
        }
        if(
ballowner == id) {
            
ballowner 0
        
}

        
GoalyPoints[id] = 0
// ------ADD THESE----------    


        
new veriler[kaydet]
        
veriler[Kills] = PlayerKills[id]
        
veriler[Deaths] = PlayerDeaths[id]
        
get_user_ip(idveriler[SIP], 31,1)
        
TrieSetArray(FragSIPveriler[SIP], veriler,sizeof veriler)

        


// ----ADD THESE------
                
PlayerKills[id] = 0
        PlayerDeaths
[id] = 0

        is_dead
[id] = false
        seconds
[id] = 0
        g_sprint
[id] = 0
        PressedAction
[id] = 0
        has_knife
[id] = false;
        
g_Experience[id] = 0

        
for(x=1x<=UPGRADESx++)
            
PlayerUpgrades[id][x] = 0
    
}
}

public 
client_putinserver(id) {
    if(
is_kickball) {
        
set_task(20.0,"soccerjamHelp",id)
    }
// ------ADD THESE--------    
    
new veriler[kaydet]
    
get_user_ip(idveriler[SIP], 31,1)
    if(
TrieGetArray(FragSIPveriler[SIP], verilersizeof veriler))
    {
        
cs_set_user_deaths(id,veriler[Deaths])
        
entity_set_float(idEV_FL_fragsfloat(veriler[Kills]))
        
PlayerKills[id] = veriler[Kills]
        
PlayerDeaths[id] = veriler[Deaths]
        
TrieDeleteKey(FragSIP,veriler[SIP])

        
setScoreInfo(id)
    }
// ------ADD THESE---------




All times are GMT -4. The time now is 23:08.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.