Forum

> > CS2D > Scripts > Random script.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Random script.

7 replies
To the start Previous 1 Next To the start

old Random script.

Mami Tomoe
User Off Offline

Quote
Spoiler >


This code has a problem, after the time is over it will teleport everyone on the server instead of the actual arrested player.

old Re: Random script.

tontonEd
User Off Offline

Quote
1
2
3
4
5
6
7
8
function jailtime(id)
timer("6000","jailover",id)
end

function jailover(id)
parse("setpos "..id.." 843 173")
rp_killer[id]=false
end

also for all your setpos you should maybe use existing script like the safe-zone, you would gain in readability and make your script less dependant to your map.

http://www.unrealsoftware.de/files_show.php?file=12950
edited 3×, last 08.10.15 01:45:13 pm

old Re: Random script.

Talented Doge
User Off Offline

Quote
Please do tab the code correctly.
More >


Why settle for if-else loop when you have table? I've fixed it and you may take mine as an example.

Off-topics >

old Re: Random script.

Mami Tomoe
User Off Offline

Quote
@user Talented Doge: This will still teleport everyone alive instead of the arrested player...

@user tontonEd: My problem is with this code:
1
2
3
4
function jailover(id)
rp_killer[id] = false
parse("setpos "..id.." 843 173")
end

rp_killer can be true but not back to false after arrest...

old Re: Random script.

Apache uwu
User Off Offline

Quote
Remember to use tonumber when using timer, the parameters are strings. So array["1"] is different from array[1].

id = tonumber(id)

old Re: Random script.

Mami Tomoe
User Off Offline

Quote
@user Apache uwu:
1
2
3
4
5
6
7
8
9
10
11
12
function jailtime(id)
id = tonumber(id)
timer("6000","jailover",id)
id = tonumber(id)
end

function jailover(id)
id = tonumber(id)
rp_killer[id] = false
parse("setpos "..id.." 843 173")
id = tonumber(id)
end

So I used this code and around after 10 times his (bot) rp_killer was true and I arrested him, his rp_killer became false.

How about we make something related to walkover and when he is walking on either one of the tiles in the cell his rp_killer will become false?










Edit: Fixed. user TopNotch helped me trough Skype.
More >
edited 1×, last 08.10.15 11:57:37 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview