Raised This Month: $95 Target: $400
 23% 

Solved Save Player Data


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tepegoz
Member
Join Date: Apr 2019
Old 12-23-2019 , 15:01   Save Player Data
Reply With Quote #1

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
}


Last edited by tepegoz; 12-26-2019 at 06:35. Reason: solved
tepegoz is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 12-23-2019 , 23:08   Re: Save Player Data
Reply With Quote #2

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

Mordekay is offline
tepegoz
Member
Join Date: Apr 2019
Old 12-24-2019 , 05:40   Re: Save Player Data
Reply With Quote #3

İ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.
tepegoz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-24-2019 , 09:18   Re: Save Player Data
Reply With Quote #4

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.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 12-24-2019 , 13:23   Re: Save Player Data
Reply With Quote #5

Quote:
Originally Posted by tepegoz View Post
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)
__________________

Mordekay is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-24-2019 , 20:45   Re: Close
Reply With Quote #6

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
__________________

Last edited by Bugsy; 12-24-2019 at 20:47.
Bugsy is offline
tepegoz
Member
Join Date: Apr 2019
Old 12-25-2019 , 08:17   Re: Close
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
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.
tepegoz is offline
bad_boy
Member
Join Date: Oct 2018
Old 12-25-2019 , 11:11   Re: Close
Reply With Quote #8

Quote:
Originally Posted by tepegoz View Post
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.
bad_boy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-25-2019 , 16:04   Re: Save Player Data
Reply With Quote #9

Quote:
Originally Posted by tepegoz View Post
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.
__________________

Last edited by HamletEagle; 12-25-2019 at 16:04.
HamletEagle is online now
tepegoz
Member
Join Date: Apr 2019
Old 12-26-2019 , 06:28   Re: Save Player Data
Reply With Quote #10

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

tepegoz is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode