Forum

> > CS2D > Scripts > can someone fix this?
Forums overviewCS2D overview Scripts overviewLog in to reply

English can someone fix this?

63 replies
Page
To the start Previous 1 2 3 4 Next To the start

old Re: can someone fix this?

skillerLTU
User Off Offline

Quote
user Yates has written
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'

old :D

sheeL
User Off Offline

Quote

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

old Re: can someone fix this?

skillerLTU
User Off Offline

Quote
user sheeL has written

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

old Re: can someone fix this?

Apache uwu
User Off Offline

Quote
@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.

old Re: can someone fix this?

skillerLTU
User Off Offline

Quote
user Apache uwu has written
@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

old Re: can someone fix this?

GooDCaT
User Off Offline

Quote
user skillerLTU has written
user Yates has written
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

old Re: can someone fix this?

skillerLTU
User Off Offline

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

old Re: can someone fix this?

GooDCaT
User Off Offline

Quote
user skillerLTU has written
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

old Re: can someone fix this?

Bobakrome
User Off Offline

Quote
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!
edited 1×, last 10.02.12 09:53:54 pm

old Re: can someone fix this?

skillerLTU
User Off Offline

Quote
user GooDCaT has written
user skillerLTU has written
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

old Re: can someone fix this?

GooDCaT
User Off Offline

Quote
user skillerLTU has written
user GooDCaT has written
user skillerLTU has written
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

old Re: can someone fix this?

GooDCaT
User Off Offline

Quote
user skillerLTU has written
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?

old Re: can someone fix this?

skillerLTU
User Off Offline

Quote
user GooDCaT has written
user skillerLTU has written
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

old Re: can someone fix this?

GooDCaT
User Off Offline

Quote
user skillerLTU has written
user GooDCaT has written
user skillerLTU has written
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?

old Re: can someone fix this?

skillerLTU
User Off Offline

Quote
user GooDCaT has written
user skillerLTU has written
user GooDCaT has written
user skillerLTU has written
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

old Re: can someone fix this?

GooDCaT
User Off Offline

Quote
user AbAeterno has written
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

old Re: can someone fix this?

AbAeterno
User Off Offline

Quote
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.
To the start Previous 1 2 3 4 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview