ItsMods
Using SetPlayerData to save server stats? - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: Using SetPlayerData to save server stats? (/Thread-Using-SetPlayerData-to-save-server-stats.html)



Using SetPlayerData to save server stats? - xplosiff - 01-05-2012

Hey,
straight to the point I want to do this...
for example, when the player connects:
Code:
if(self GetPlayerData("example_played") == "true") { self iPrintln("Welcome back " + self.name + "!"); } else { self SetPlayerData("example_played","true"); self iPrintln("Welcome, " + self.name + ". You appear to be new here. Please read the rules and enjoy your stay."); }

however, the code above does not set the player's data. it is refreshed upon restarting the server. is this possible or do I need to use a plugin and save server side stats?

thanks


RE: Using SetPlayerData to save server stats? - Pozzuh - 01-05-2012

not sure if this works for mw2 (it's from cod4)

Code:
player setStat(666,"true"); if(player getStat(666) == "true") derp();

edit: or it was getData/setData meh I forgot


RE: Using SetPlayerData to save server stats? - iAegle - 01-05-2012

I know you can use
Code:
self SetPlayerData( "money","BLABLABLASTUFFHERE" );

but there are some other mods that use this aswell .. so it will be changed when he plays one of those mods


RE: Using SetPlayerData to save server stats? - Nekochan - 01-05-2012

(01-05-2012, 17:45)iAegle Wrote: I know you can use
Code:
self SetPlayerData( "money","BLABLABLASTUFFHERE" );

but there are some other mods that use this aswell .. so it will be changed when he plays one of those mods
maps\mp\gametypes\_presistanse.gsc ( or i forgot name )


RE: Using SetPlayerData to save server stats? - OrangePL - 01-05-2012

(01-05-2012, 20:33)Se7en Wrote: maps\mp\gametypes\_presistanse.gsc ( or i forgot name )
maps\mp\gametypes\_persistence.gsc