Forum

> > CS2D > Mods > Changing the game/server version..
Forums overviewCS2D overview Mods overviewLog in to reply

English Changing the game/server version..

17 replies
To the start Previous 1 Next To the start

old Changing the game/server version..

ZaibatsuTEAM
User Off Offline

Quote
Well, I don't think it's possible but. I want to ask anyway.

I'm creating a mod right now for cs2d, and I wanna do something so that the mod client *only* can connect to my server and no other server. And then I wanna make so that no other cs2d client can join my server too, except my own client.

old Thanks Yuki

ZaibatsuTEAM
User Off Offline

Quote
Thanks for the quick reply. I'm gonna try it
EDIT: uh... idk how im gonna do it though

old Re: Changing the game/server version..

VADemon
User Off Offline

Quote
Add a dummy file to your mod download (don't add it to server's transferlist), let's call it "ZTMOD.txt" which is inside gfx/MYMOD: full path to the file "/gfx/MYMOD/ZTMOD.png" and add it to your map
Whenever a player joins a server, check if reqcld(id, 4, "/gfx/MYMOD/ZTMOD.png") returns 0 for this player. If it's 0 then the file isn't loaded => this player hasn't downloaded the mod => kick him

old Hm..

ZaibatsuTEAM
User Off Offline

Quote
Well, since my server has tons of maps, can I instead make a script that loads the image on any map?

@user Talented Doge: Yeah I know hehe, oh lol thanks
edited 2×, last 30.04.15 10:15:57 am

old Re: Changing the game/server version..

Talented Doge
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
a = {}

addhook("join", "_onJ")
addhook("clientdata", "_oncld")

function _onJ(p)
	if player(p, "exists") then
		a[p] = reqcld(p, 4, "gfx/MYMOD/ZTMOD.png")
	end
end

function _oncld (p, r, param)
	if a[p] ~= true then
		parse ("kick "..p)
	end
end

old uh

ZaibatsuTEAM
User Off Offline

Quote
hmm now i got 2 problems. Yuki, your script.. umm.
So, the picture was sent to the client from server even though i didn't put the picture in servertransfer. also, Im getting kicked when having the picture as well. but i don't know how it is if you dont have the picture, since i still get the picture. epic xd

old xd

ZaibatsuTEAM
User Off Offline

Quote
addhook("second","imagespawn")
function imagespawn()
reqimg=image("gfx/Zaibatsu2DAUTH/zaibatsuhuehue.png",1,1,1)
end

edit: I still need help with this, but people stopped replying to the thread. xddd
edited 1×, last 23.05.15 09:32:16 am

old Re: Changing the game/server version..

Bowlinghead
User Off Offline

Quote
user Talented Doge s Script:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
a = {}

addhook("join", "_onJ")
addhook("clientdata", "_oncld")

function _onJ(p)
	if player(p, "exists") then
	 	-- MYMOD/ZTMOD.png
        	a[p] = reqcld(p, 4, "gfx/MYMOD/ZTMOD.png")
	end
end

function _oncld (p, r, param)
     if a[p] ~= true then
          parse ("kick "..p)
     end
end
Your script:
1
2
3
4
5
addhook("second","imagespawn")
function imagespawn()
	-- Something else
	reqimg=image("gfx/Zaibatsu2DAUTH/zaibatsuhuehue.png",1,1,1)
end

Do you use the same path?

old yes

ZaibatsuTEAM
User Off Offline

Quote
yes i used the same path. and waaa?

Edit: I'd really love if someone can give me 2 example scripts of both reqcld4 thingy and how to load the graphics on ALL maps using (maybe lua?) to make only clients with that graphics be able to join the server.

since im noob
edited 1×, last 25.05.15 09:02:55 pm
To the start Previous 1 Next To the start
Log in to reply Mods overviewCS2D overviewForums overview