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.
Forum
Mods
Changing the game/server version..
Changing the game/server version..
17 replies
1

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.
reqcld does have thisMode 4: 1 if the file specified with parameter (file path relative to the CS2D folder) has been loaded, 0 otherwise (second value always 0)
I don't know if this works.
EDIT: uh...
idk how im gonna do it though 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
@
Talented Doge: Yeah I know hehe, oh lol thanks
edited 2×, last 30.04.15 08:15:57 am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
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
image and check afterwards whether it is loaded or not. I have tested severe methods but all of them failed.
I will keep trying other ways to do it.
VADemon: I did use image in lua to load it, though...
ZaibatsuTEAM would you post this part of the script then? 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 07:32:16 am
_Yank: Yes, of course. but I'll be updating that file after each update of the mod. I still need help how to do it. xd
Talented Doge s Script:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
1
2
3
4
5
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?
It needs the file to be loaded in client side. Which means you must put some graphic on client side and let it be loaded.
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 07:02:55 pm
1

Offline