Forum

> > CS2D > Scripts > can someone fix this?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch can someone fix this?

63 Antworten
Seite
Zum Anfang Vorherige 1 2 3 4 Nächste Zum Anfang

alt Re: can someone fix this?

skillerLTU
User Off Offline

Zitieren
user Yates hat geschrieben
1
parse("setpos "..id.." 7696 12496")
If you use " then the numbers won't be recognized as numbers any more.


thanks new error wait i will try to fix.


command:
elseif command =="j" then
parse("setpos "..id.." 7696 12496")
end
msg2(id,'©000255000Send Player To Jail: "!j <id>"')
else
msg2(id,'©255000000 ERROR')
end
return 1

error: 'end' expected (to close 'function' at line 31) near 'elseif'

alt :D

sheeL
User Spielt CS2D

Zitieren

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end

addhook("local","player")
function player(spawn)
position[id] = Array(32,0)
onposition[id] = Array(32,0)

funciton spawn
positon[id] = 7696
onposition[id] =  12496

elseif command =="j" then
parse("setpos "..pl..""..position[id]..""..onposition[id])
end
msg2(id,"©000255000Send Player To Jail: "!j <targetid>")
else
msg2(id,"©255000000 ERROR ")
end
return 1

untested

alt Re: can someone fix this?

skillerLTU
User Off Offline

Zitieren
user sheeL hat geschrieben

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end

addhook("local","player")
function player(spawn)
position[id] = Array(32,0)
onposition[id] = Array(32,0)

funciton spawn
positon[id] = 7696
onposition[id] =  12496

elseif command =="j" then
parse("setpos "..pl..""..position[id]..""..onposition[id])
end
msg2(id,"©000255000Send Player To Jail: "!j <targetid>")
else
msg2(id,"©255000000 ERROR ")
end
return 1

untested




testing


not work...

alt Re: can someone fix this?

Apache uwu
User Off Offline

Zitieren
@user sheeL: already lots of problems with that script, I'm not even going to list them, you clearly don't know what you are doing

@thread:

     
Since I cannot see the previous code I'm going to just place everything in.

1
2
3
4
5
6
7
addhook("say","_say")

function _say(id,message)
	if string.sub(message,1,2)=="j " then
		parse("setpos "..string.sub(message,3).." 7696 12496")
	end
end

Highly dangerous, I am only giving you a starting point to move from, do not use this code, people can type:

     j ;quit;

and shutdown your server or worse.

alt Re: can someone fix this?

skillerLTU
User Off Offline

Zitieren
user Apache uwu hat geschrieben
@user sheeL: I am only giving you a starting point to move from, do not use this code, people can type:

     j ;quit;

and shutdown your server or worse.



omg


removed that command at all. if i want to jail i will use: /setpos <id> 7696 12496
or /rcon setpos <id> 7696 12496


is there any chances to get out of PVP?? if all walls are blocked



cya going sleep

alt Re: can someone fix this?

GooDCaT
User Off Offline

Zitieren
user skillerLTU hat geschrieben
user Yates hat geschrieben
1
parse("setpos "..id.." 7696 12496")
If you use " then the numbers won't be recognized as numbers any more.


thanks new error wait i will try to fix.


command:
elseif command =="j" then
parse("setpos "..id.." 7696 12496")
end
msg2(id,'©000255000Send Player To Jail: "!j <id>"')
else
msg2(id,'©255000000 ERROR')
end
return 1

error: 'end' expected (to close 'function' at line 31) near 'elseif'


1
2
3
4
5
6
7
8
9
elseif command =="j" then
parse("setpos "..id.." 7696 12496")
end
msg2(id,'©000255000Send Player To Jail: "!j <id>"')
else
msg2(id,'©255000000 ERROR')
end
return 1
end
Fixed =D

alt Re: can someone fix this?

skillerLTU
User Off Offline

Zitieren
THANKS!!! yeay it works. but:

i added zombies at that place so all die in jail. but not spawn at jail. ppl spawn at coords 0 0... how to make them to spawn in 7696 12496?

alt Re: can someone fix this?

GooDCaT
User Off Offline

Zitieren
user skillerLTU hat geschrieben
THANKS!!! yeay it works. but:

i added zombies at that place so all die in jail. but not spawn at jail. ppl spawn at coords 0 0... how to make them to spawn in 7696 12496?


OH Yeah, Avoid using maps without having this Dimension

alt Re: can someone fix this?

Bobakrome
User Off Offline

Zitieren
One thing. What`s wrong in my oppinion?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
elseif command =='j' then
               local j = words:find(' ',4)
               local target = tonumber(words:sub(4,s))
               if target then
                    if player(target,'exists') then
                         local jail = j and tonumber(words:sub(j+1,words:find(' ',j+1))) or nil
                         if jail then
                     parse('setpos '..target..' '..jail..'")
                     PLAYERS[target].Spawn = {'..jail..'}
                              return 1
                         end
                    end
               end
               msg2(id,'Send Him into Jail: !j <targetid> <pixel cooirdonates>')
               return 1

I fixed some thing. Maybe is working.
Wah i did mistake

Done now!
1× editiert, zuletzt 10.02.12 21:53:54

alt Re: can someone fix this?

skillerLTU
User Off Offline

Zitieren
user GooDCaT hat geschrieben
user skillerLTU hat geschrieben
THANKS!!! yeay it works. but:

i added zombies at that place so all die in jail. but not spawn at jail. ppl spawn at coords 0 0... how to make them to spawn in 7696 12496?


OH Yeah, Avoid using maps without having this Dimension


i know i got my map (its big)


i think made to spawn players here

alt Re: can someone fix this?

GooDCaT
User Off Offline

Zitieren
user skillerLTU hat geschrieben
user GooDCaT hat geschrieben
user skillerLTU hat geschrieben
THANKS!!! yeay it works. but:

i added zombies at that place so all die in jail. but not spawn at jail. ppl spawn at coords 0 0... how to make them to spawn in 7696 12496?


OH Yeah, Avoid using maps without having this Dimension


i know i got my map (its big)


i think made to spawn players here


use map editor
add//spawn zombie on jail

alt Re: can someone fix this?

GooDCaT
User Off Offline

Zitieren
user skillerLTU hat geschrieben
i want to add this:

               parse("spawnplayer "..id.." 7696 12496")
but i get errors


1
2
3
4
addhook("spawn","startround")
function startround (id,spawn)
parse("spawnplayer "..id.." 7696 12496")
end

works?

alt Re: can someone fix this?

skillerLTU
User Off Offline

Zitieren
user GooDCaT hat geschrieben
user skillerLTU hat geschrieben
i want to add this:

               parse("spawnplayer "..id.." 7696 12496")
but i get errors


1
2
3
4
addhook("spawn","startround")
function startround (id,spawn)
parse("spawnplayer "..id.." 7696 12496")
end

works?


NOPE

alt Re: can someone fix this?

GooDCaT
User Off Offline

Zitieren
user skillerLTU hat geschrieben
user GooDCaT hat geschrieben
user skillerLTU hat geschrieben
i want to add this:

               parse("spawnplayer "..id.." 7696 12496")
but i get errors


1
2
3
4
addhook("spawn","startround")
function startround (id,spawn)
parse("spawnplayer "..id.." 7696 12496")
end

works?


NOPE


what the error?

alt Re: can someone fix this?

skillerLTU
User Off Offline

Zitieren
user GooDCaT hat geschrieben
user skillerLTU hat geschrieben
user GooDCaT hat geschrieben
user skillerLTU hat geschrieben
i want to add this:

               parse("spawnplayer "..id.." 7696 12496")
but i get errors


1
2
3
4
addhook("spawn","startround")
function startround (id,spawn)
parse("spawnplayer "..id.." 7696 12496")
end

works?


NOPE


what the error?


1
2
3
4
5
6
7
8
9
10
11
12
13
elseif command =="j" then
			parse("setpos "..id.." 7696 12496")
		end
			addhook("spawn","startround")
				function startround (id,spawn)
			end
				parse("spawnplayer "..id.." 7696 12496")
					msg2(id,'©000255000you sent Player To Jail')
				else
					msg2(id,'©255000000 ERROR')
				end
			return 1
		end

i dont know what error i need to fix all command

alt Re: can someone fix this?

GooDCaT
User Off Offline

Zitieren
user AbAeterno hat geschrieben
Maybe use "setpos" instead of "spawnplayer".

oh god , yeah

1
2
3
4
addhook("spawn","startround")
function startround (id,spawn)
parse("setpos "..id.." 7696 12496")
end

alt Re: can someone fix this?

AbAeterno
User Off Offline

Zitieren
What are you trying to do with "Spawnplayer"?

To change a player's new spawn in tibia, use this:
1
PLAYERS[id].Spawn = {X, Y}
Note:X and Y is in pixels, not tiles!

EDIT:With new spawn, I mean where would the player spawn if he/she dies.
Zum Anfang Vorherige 1 2 3 4 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht