Forum

> > CS2D > Scripts > [Fixed] Script error
Forums overviewCS2D overview Scripts overviewLog in to reply

English [Fixed] Script error

17 replies
To the start Previous 1 Next To the start

old [Fixed] Script error

Mami Tomoe
User Off Offline

Quote
I have a script and it has arrest command but it makes errors...
A chunk of the script:
Spoiler >


The errors:
Spoiler >
edited 1×, last 03.08.15 02:11:45 pm

old Re: [Fixed] Script error

Mami Tomoe
User Off Offline

Quote
@user Talented Doge:
1
2
3
4
5
LUA ERROR: sys/lua/IF/sys/functions.lua:290: unexpected symbol near ')'
 -> [C]: in function 'dofile'
 -> sys/lua/IF/roleplay.lua:6: in main chunk
 -> [C]: in function 'dofile'
 -> sys/lua/server.lua:1: in main chunk

I think you gave me the same code...
@user Mami Tomoe: code
1
parse("setpos "..pl.." "..Config.AP[1][1].." "..Config.AP[1][1]) parse("killplayer "..pl..)

@user Talented Doge: code
1
parse("setpos "..pl.." "..Config.AP[1][1].." "..Config.AP[1][1]) parse("killplayer "..pl..)

Admin/mod comment

Code tag added for two code line below. /user GeoB99

old Re: [Fixed] Script error

Mora
User Off Offline

Quote
@user Mami Tomoe: who made this code? i don't believe that you made that code(i mean it's not so easy for newbies, for example) and you cannot check even easiest errors.
use:
"..pl) instead of "..pl..)
and anywhere you you using ".. should be end as .." or )
edited 1×, last 03.08.15 08:25:13 am

old Re: [Fixed] Script error

Mami Tomoe
User Off Offline

Quote
@user Mora: Not me I am using IFs roleplay script and I need to edit it because the teleporting wont work and it will set your arrest only after you die so I need it to set your arrest AND kill you to apply the arrest
IF stopped visiting unrealsoftware since a long time ago so I cant ask him to fix it (I tried)

old Re: [Fixed] Script error

Mora
User Off Offline

Quote
There is alot of hits on Us.de how2use it, check sometimes
http://www.cs2d.com/help.php
/p.s. - better to make your new RP, instead of editing the old one, bcs there may be useless shit ya don't need for.
Basic roleplay - is very easy, array and money with the menu and license(save pos), adding the new features you want, i think ppls bored of these old roleplays.

old Re: [Fixed] Script error

Dousea
User Off Offline

Quote
It may fix your problem and it's more efficient.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
elseif cmd =="!a" then
	if rp_Adminlevel[id] >= arrest_lv then
		local pl = tonumber(p[2])
	
		if pl and player(pl,"exists") then
			local cell = tonumber(p[3])
			
			if cell >= 1 and cell <= 6 then
				parse("setpos "..pl.." "..Config.AP[cell][1].." "..Config.AP[cell][2])
				parse("killplayer "..pl)
			end
			
			rp_arrest[pl]=true
		end
edited 1×, last 04.08.15 10:37:41 am

old Re: [Fixed] Script error

Ajmin
User Off Offline

Quote
What is the need to kill a player while arresting -__-.
I suggest to remove the kil cmd completely.

old Re: [Fixed] Script error

Mami Tomoe
User Off Offline

Quote
@user Ajmin:
user Mami Tomoe has written
because the teleporting wont work and it will set your arrest only after you die


user Talented Doge has written
1
parse("setpos "..pl.." "..Config.AP[1][1].." "..Config.AP[1][1]) parse("killplayer "..pl..)

This one worked

user Dousea has written
It may fix your problem and it's more efficient.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
elseif cmd =="!a" then
	if rp_Adminlevel[id] >= arrest_lv then
		local pl = tonumber(p[2])
	
		if pl and player(pl,"exists") then
			local cell = tonumber(p[3])
			
			if cell >= 1 and cell <= 6 then
				parse("setpos "..pl.." "..Config.AP[cell][1].." "..Config.AP[cell][2]..")
				parse("killplayer "..pl)
			end
			
			rp_arrest[pl]=true
		end

I guess the lua is too old to understand it... Here we go to never fix what is fixed
edited 2×, last 03.08.15 01:48:23 pm

old Re: [Fixed] Script error

Ajmin
User Off Offline

Quote
Noway,
I viewed my citylife script,
It doesnt require such a killing method,

Just remove the kill command and try,
If it works,Keep Calm and go on!
Dont ask how else !!

old Re: [Fixed] Script error

Dousea
User Off Offline

Quote
My bad. I copied-pasted your cs2d lua cmd parse code to my code so it will never ever work. I guess you can use my code now.. or stick on your current code.

old Re: [Fixed] Script error

Ridho
User Off Offline

Quote
with this
parse("setpos "..pl.." "..Config.AP[cell][1].." "..Config.AP[cell][2]..")
parse("killplayer "..pl)

it will set player position in
"..Config.AP[cell][1].." "..Config.AP[cell][2].."

then kill player

I think this is better
1
2
parse("killplayer "..pl)
parse("spawnplayer "..pl.." "..Config.AP[cell][1].." "..Config.AP[cell][2])

untested
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview