Raised This Month: $51 Target: $400
 12% 

Solved Save Player Data


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
tepegoz
Senior Member
Join Date: Apr 2019
Old 12-23-2019 , 14: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 05:35. Reason: solved
tepegoz is offline
 



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 16:19.


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