Forum

> > CS2D > Mods > Changing the game/server version..
ForenübersichtCS2D-Übersicht Mods-ÜbersichtEinloggen, um zu antworten

Englisch Changing the game/server version..

17 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Changing the game/server version..

ZaibatsuTEAM
User Off Offline

Zitieren
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.

alt Thanks Yuki

ZaibatsuTEAM
User Off Offline

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

alt Re: Changing the game/server version..

VADemon
User Off Offline

Zitieren
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

alt Hm..

ZaibatsuTEAM
User Off Offline

Zitieren
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
2× editiert, zuletzt 30.04.15 10:15:57

alt Re: Changing the game/server version..

Talented Doge
User Off Offline

Zitieren
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

alt uh

ZaibatsuTEAM
User Off Offline

Zitieren
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

alt xd

ZaibatsuTEAM
User Off Offline

Zitieren
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
1× editiert, zuletzt 23.05.15 09:32:16

alt Re: Changing the game/server version..

Bowlinghead
User Off Offline

Zitieren
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?

alt yes

ZaibatsuTEAM
User Off Offline

Zitieren
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
1× editiert, zuletzt 25.05.15 21:02:55
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Mods-ÜbersichtCS2D-ÜbersichtForenübersicht