English [Fixed] Script error

17 replies
Goto Page
To the start Previous 1 Next To the start
03.08.15 06:22:11 am
Up
Mami Tomoe
User
Offline Off
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
fish
03.08.15 07:37:35 am
Up
Talented Doge
User
Offline Off
Code:
1
parse("setpos "..pl.." "..Config.AP[1][1].." "..Config.AP[1][1]) parse("killplayer "..pl..)
Talented Doge
03.08.15 07:43:26 am
Up
Mami Tomoe
User
Offline Off
@user Talented Doge:
Code:
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
Code:
1
parse("setpos "..pl.." "..Config.AP[1][1].." "..Config.AP[1][1]) parse("killplayer "..pl..)


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

Admin/mod comment:

Code tag added for two code line below. /user GeoB99
03.08.15 07:49:26 am
Up
Talented Doge
User
Offline Off
I have given you the mistaken code, fix it yourself. It's extraordinary easy.
Talented Doge
03.08.15 08:03:49 am
Up
Mora_rus
User
Offline Off
@user Talented Doge: ppls sometimes are stupid.
"..id..) <-anyway there is your error.
03.08.15 08:04:29 am
Up
Mami Tomoe
User
Offline Off
If ive came to unrealsoftware searching for help, I really am out of ideas x.x
fish
03.08.15 08:09:42 am
Up
Mora_rus
User
Offline Off
@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
03.08.15 08:35:44 am
Up
Mami Tomoe
User
Offline Off
@user Mora_rus: 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)
fish
03.08.15 08:41:51 am
Up
Mora_rus
User
Offline Off
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.
03.08.15 08:47:18 am
Up
Talented Doge
User
Offline Off
Referring to the Lua Refman is also a good choice, I uses 5.2 refman.
Talented Doge
03.08.15 11:05:07 am
Up
Ortimh
User
Offline Off
It may fix your problem and it's more efficient.
Code:
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
I'm awesome ... and I really like cookies.
03.08.15 11:05:41 am
Up
Ajmin
User
Offline Off
What is the need to kill a player while arresting -__-.
I suggest to remove the kil cmd completely.
03.08.15 01:37:19 pm
Up
Mami Tomoe
User
Offline Off
@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:
Code:
1
parse("setpos "..pl.." "..Config.AP[1][1].." "..Config.AP[1][1]) parse("killplayer "..pl..)

This one worked

user Ortimh has written:
It may fix your problem and it's more efficient.
Code:
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
fish
03.08.15 04:00:33 pm
Up
Ortimh
User
Offline Off
What did you try to say? user Talented Doge's code will never work and will never ever be.. or you was talking about mine.
I'm awesome ... and I really like cookies.
03.08.15 05:13:06 pm
Up
Ajmin
User
Offline Off
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 !!
03.08.15 06:15:25 pm
Up
Mami Tomoe
User
Offline Off
user Ortimh has written:
What did you try to say? user Talented Doge's code will never work and will never ever be.. or you was talking about mine.


@user Mora_rus: fixed @user Talented Doge: code.
The script is old and that's why I think your script didn't work...




@user Ajmin:
user Mami Tomoe has written:
it will set your arrest only after you die
fish

Admin/mod comment:

Don't quote the user's post that's directly near/above you. /user GeoB99
04.08.15 10:38:16 am
Up
Ortimh
User
Offline Off
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.
I'm awesome ... and I really like cookies.
05.08.15 06:21:22 am
Up
Ridho
User
Offline Off
with this
Code:
parse("setpos "..pl.." "..Config.AP[cell][1].." "..Config.AP[cell][2]..")
parse("killplayer "..pl)

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

then kill player

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


untested
Just PM me or chat (+62)8994518003 for necessary business
To the start Previous 1 Next To the start