ItsMods

Full Version: Shop system for Infected gametype
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13
(12-27-2012, 13:08)8q4s8 Wrote: [ -> ]In OnPlayerDamaged:
CSHARP Code
  1. try
  2. {
  3. Points[Attacker.XUID] = (((int)Points[Attacker.XUID]) + 100);
  4.  
  5. StreamWriter writer = new StreamWriter("C:\\Mw3\\shop\\" + Attacker.XUID + ".txt");
  6.  
  7. int points = (int)Points[Attacker.XUID];
  8.  
  9. writer.WriteLine(Attacker.XUID + "=" + points.ToString());
  10. writer.Dispose();
  11. writer.Close();
  12. }

In OnPlayerConnect
CSHARP Code
  1. try
  2. {
  3. StreamReader reader = new StreamReader("C:\\Mw3\\shop\\" + Client.XUID + ".txt");
  4.  
  5. string read = reader.ReadLine();
  6. string read2 = read;
  7.  
  8. string[] readArray = read2.Split('=');
  9. Points[Client.XUID] = int.Parse(readArray[1]);
  10. }


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

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
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.
Maybe you placed sv_config file wrong?
(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
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 )
(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?
(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.
Thanks, I will wait
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13