Forum

> > CS2D > Scripts > Random script.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Random script.

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Random script.

Mami Tomoe
User Off Offline

Zitieren
Spoiler >


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

alt Re: Random script.

tontonEd
User Off Offline

Zitieren
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
3× editiert, zuletzt 08.10.15 13:45:13

alt Re: Random script.

Talented Doge
User Off Offline

Zitieren
Please do tab the code correctly.
Mehr >


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

Off-topics >

alt Re: Random script.

Mami Tomoe
User Off Offline

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

alt Re: Random script.

Apache uwu
User Off Offline

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

id = tonumber(id)

alt Re: Random script.

Mami Tomoe
User Off Offline

Zitieren
@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.
Mehr >
1× editiert, zuletzt 08.10.15 23:57:37
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht