Release Shop system for Infected gametype
(12-27-2012, 13:08)8q4s8 Wrote: In OnPlayerDamaged:
Code:
try { Points[Attacker.XUID] = (((int)Points[Attacker.XUID]) + 100); StreamWriter writer = new StreamWriter("C:\\Mw3\\shop\\" + Attacker.XUID + ".txt"); int points = (int)Points[Attacker.XUID]; writer.WriteLine(Attacker.XUID + "=" + points.ToString()); writer.Dispose(); writer.Close(); }
In OnPlayerConnect
Code:
try { StreamReader reader = new StreamReader("C:\\Mw3\\shop\\" + Client.XUID + ".txt"); string read = reader.ReadLine(); string read2 = read; string[] readArray = read2.Split('='); Points[Client.XUID] = int.Parse(readArray[1]); }

I think I release the code because many people want the point saving stuff. This will create a .txt file for every player who got points and it's updating it every kill. It will read the file OnPlayerConnect and add the points. It isn't as good as a SQL database but it's working pretty good.


Better to use mysql database, it takes just 5 mb max and just one file.
I did same in KillMe Zombie mod ( and @Ich1994 did it in ezm )
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

Thanks for initial skin of this plug-in, I translate him and improved having added some new subjects a little but I had recently a problem that some subjects (Throwing knife and Desert Eagle for example) subjects upon purchase points for them aren't removed but they are bought though in sv_config the price costs.

How to make so that points were removed when when you buy one of these things?

sv_config (Click to View)

Plugin I attached the file because there too many symbols



Attached Files
.rar   mw3shop.rar (Size: 55.49 KB / Downloads: 87)
Reply

Today I came to myself on the server and found that all that it is possible to buy free of charge except a ammo for the infected...
Huh
Reply

Rainbow 
So you can help me?
Game when everything in shop is free (except cartridges for infected) has no washed away i don't know as it to correct Sad for now in another way it is impossible because of it problems, I hope for that that you write as it soon to correct.
Reply

Maybe you placed sv_config file wrong?
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

(01-25-2013, 14:41)SailorMoon Wrote: Maybe you placed sv_config file wrong?

Here my full sv_config file, what here can be wrong?
Here the way where it lies if it is necessary mw3server\addon\sv_config.ini
Other plugins entered in sv_config work except shop.

Code:
[SERVER] TimedMessages=1 //Enable or disable timed messages [0-1] SpecsFix=1 //Disable the CPU/Bandwidth check [0-1] OldRotation=0 //Enable the old cod4-style rotation (see example server.cfg) [0-1] OldRotationVal=playlist tdm_default map mp_dome playlist sd_default map mp_alpha playlist jug_default map mp_carbon //OldRotation configuration RotationThreshold=1 //Disable map rotation threshold (set to 0) DisableVAC=0 //[UNTESTED] Stop VAC from protecting your server [LOG] ConsoleLog=1 //Enable logging to the 'console.log' file [0-1] [SCRIPT] Enabled=0 //Enable the server script [0-1] Script=example.script //Server script to run [DEBUG] ExceptionLogging=0 //Enable logging of crashes [0-1] [UPDATER] Enable=0 //Enable the updater AutoUpdate=0 //Auto-update the server when there is a new release. (Mainly for dedicated servers on game server hosters) [Permission] Usergroups=Admin,User Admin_xuids=0110000105987c4c Admin_commands=*ALL* User_commands=!8,!7,!ak47a,!mypoints,!help,!getxuid,!gettype,!shop,!weapons,!perks,!1,!ammo,!2,!3,!4,!5,!6,!11,!12,!13,!14,!15,!16,!21,!22,!23,!24,!25,!31,!32,!33,!34,!34,!35,!36,!37,!38,!39,!41,!42,!43,!44,!45,!46,!51,!52,!53,!54,!55,!56,!61,!62,!65,!emp,!claymore,!tk,!cb,!s,!ba,!be,!fl,!fm User_xuids=*EVERYONE* Moderator_xuids=xuid1,xuid2,xuid3 Moderator_commands=!help,!getxuid,!gettype [MW3SHOP] disable_perks=false disable_tk=false barrettCost=800 ammoCost=500 scarCost=1100 mk14Cost=900 acrCost=1200 fadCost=1000 m16Cost=800 ak47Cost=1150 m4Cost=800 mg36Cost=850 sa80Cost=700 cm901Cost=650 g36Cost=700 rsassCost=750 rpgCost=1010 xm25Cost=910 spasCost=510 usasCost=550 aa12Cost=650 strikerCost=580 modelCost=700 as50Cost=850 l96a1Cost=950 msrCost=1100 dragCost=700 pechCost=900 mk46Cost=850 m60Cost=990 ump45Cost=300 pp90m1Cost=450 p90Cost=500 m9Cost=400 mp7Cost=650 mp5Cost=500 Stalker_ZCost=50 CB_ZCost=50 StalkerCost=300 BACost=400 CBCost=500 BECost=300 ScavengerCost=300 FRCost=500 FMCost=500 TKCost=1500 EmpGrenadeCost=50 claymoreCost=420 ak47aCost=10000 ammo_zCost=5000 cxCost=3000 dCost=5000 clear_perks_onspawn=false [SPEEDPLUGIN] Speed=210 JumpHeight=80 FallDamage=1 Gravity=800
Reply

Eh, i don't see any error there.
I'm gonna release new shop system soon. ( with mysql point saving, less code, easy to use )
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

Brick 
(01-25-2013, 15:17)SailorMoon Wrote: Eh, i don't see any error there.
I'm gonna release new shop system soon. ( with mysql point saving, less code, easy to use )

When approximately you are going to let out it?
Reply

(01-25-2013, 15:20)ltybcs Wrote:
(01-25-2013, 15:17)SailorMoon Wrote: Eh, i don't see any error there.
I'm gonna release new shop system soon. ( with mysql point saving, less code, easy to use )

When approximately you are going to let out it?

Hmm, if i will have time - today.
Else tomorrow.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

Thanks, I will wait
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Thumbs Up [Release] AllInOne! for infected robinvm 4 6,590 10-19-2013, 20:00
Last Post: Casper
  Infected Stuff is semi broken DidUknowiPwn 2 5,054 09-21-2013, 20:22
Last Post: surtek
  [Request] no ammo for infected gamemode ExoGamer* 8 7,787 08-15-2013, 18:59
Last Post: Dr3am95
  [Release] AntiRage for Infected Game Mode yokai134 17 19,859 08-04-2013, 22:22
Last Post: yokai134
Question Help Upgrade my point system from files to Database, help? EnVi Sweden Rocks 11 12,201 08-03-2013, 23:31
Last Post: EnVi Sweden Rocks
  Shop Database Hallla 5 6,562 07-23-2013, 07:33
Last Post: xfxtroll
  [Request] Login / Register System? South2AKA 5 6,872 07-17-2013, 13:50
Last Post: surtek
  [Tutorial] Custom gametype HUD iAegle 17 20,539 07-14-2013, 01:16
Last Post: Nekochan
  mw3 infected game restarts SniperViper 1 3,258 05-18-2013, 11:37
Last Post: hillbilly
  Help prefix doesnt work with shop koro35 2 4,132 05-18-2013, 10:51
Last Post: koro35

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.