Forum

> > CS2D > Scripts > prison end
Forums overviewCS2D overview Scripts overviewLog in to reply

English prison end

6 replies
To the start Previous 1 Next To the start

old prison end

ANOTHERDAILY
User Off Offline

Quote
help me please

prison end problem

is missing (end) in some places I do not know where they are

Name has written
prison = {}
prison.tazer = {}
prison.tazer.onehit = {}
prison.tazer.noenergyshot = {}
prison.tazer.len = 10
prison.tazer.left = {}
prison.teazed = {}
prison.teaz_time = 5
prison.temp_weapon = {}
prison.strip_search = {}
prison.strip_search.timer = {}
prison.VERSION = "0.0.0.1"

parse("mp_wpndmg elite 15")

prison1list = {96380}

addhook("spawn","prison_mode_spawn")
function prison_mode_spawn(id)
for _, usgn in ipairs(prison1list) do
if player(id,'usgn') == usgn then
prison.tazer.onehit[id] = true
prison.tazer.noenergyshot[id] = false
prison.teazed[id] = 0
prison.tazer.left[id] = 5
prison.strip_search.timer[id] = 3
parse("hudtxt2 "..id.." 0 \"tazer power: "..prison.tazer.left[id].."%\" 10 125 0")
end
end
end

addhook("second","prison_mode_second")
function prison_mode_second()
for _, usgn in ipairs(prison1list) do
if player(id,'usgn') == usgn then
i = 0
while (i < 32) do
i = i + 1
if player(i,"exists") and player(i,"health") > 0 then
if prison.tazer.left[i] < 100 then
prison.tazer.left[i] = prison.tazer.left[i] + 5
parse("hudtxt2 "..i.." 0 \"tazer power: "..prison.tazer.left[i].."%\" 10 125 0")
end
prison.strip_search.timer[i] = prison.strip_search.timer[i] - 1
if prison.teazed[i] > 0 then
prison.teazed[i] = prison.teazed[i] - 1
if prison.teazed[i] == 0 then
parse("speedmod "..i.." 0")

temp_wep = prison.temp_weapon[i]
ii = 0
while (ii < #temp_wep) do
ii = ii + 1
parse("equip "..i.." "..temp_wep[ii].."")
end

msg2(i,"the teazer affect disappered")

end
end
end
end
end

addhook("hit","prison_mode_hit")
function prison_mode_hit(id,source,weapon,hpdmg,apdmg)
for _, usgn in ipairs(prison1list) do
if player(id,'usgn') == usgn then
if weapon == 5 then
if (player(id,"team") == player(source,"team")) == false then
if prison.tazer.onehit[source] == true then
prison.tazer.onehit[source] = false
if prison.teazed[id] == 0 then prison.temp_weapon[id] = playerweapons(id); end
prison.teazed[id] = prison.teaz_time
parse("speedmod "..id.." -100")
parse("strip "..id.." 0")
msg2(id,"you got tazed by "..player(source,"name").."")
msg2(source,"you tazed "..player(id,"name").."")
parse("effect \"flare\" "..player(id,"x").." "..player(id,"y").." 1 1 0 50 255")
end
if prison.tazer.noenergyshot[source] then
return 0
else
return 1
end
end
return 1
end
end

addhook("attack","prison_mode_attack",1)
function prison_mode_attack(id)
for _, usgn in ipairs(prison1list) do
if player(id,'usgn') == usgn then
for _, usgn in ipairs(prison1list) do
if player(id,'usgn') == usgn then
if player(id,"weapon") == 5 then
if prison.tazer.left[id] >= 25 then
prison.tazer.onehit[id] = true
prison.tazer.noenergyshot[id] = false
prison.tazer.left[id] = prison.tazer.left[id] - 25
parse("hudtxt2 "..id.." 0 \"tazer power: "..prison.tazer.left[id].."%\" 10 125 0")
else
msg2(id,"not enough power")
prison.tazer.noenergyshot[id] = true
end
end
end
end
end

addhook("serveraction","prison_mode_serveraction")
function prison_mode_serveraction(id,action)
for _, usgn in ipairs(prison1list) do
if player(id,'usgn') == usgn then
if action == 1 then
if player(id,"team") == 2 then
if prison.strip_search.timer[id] <= 0 then
prison.strip_search.timer[id] = 3
id_scan = 0
dist = 32
i = 0
while (i < 32) do
i = i + 1
if player(i,"exists") and player(i,"health") > 0 and player(i,"team") == 1 then
dist_temp = math.sqrt((player(id,"x") - player(i,"x"))^2 + (player(id,"y") - player(i,"y"))^2)
if dist_temp < dist then
id_scan = i
dist = dist_temp
end
end
end
if id_scan > 0 then
wep = playerweapons(id_scan)
if (#wep*math.random()) < 0.5 then
msg2(id_scan,"warning, "..player(id,"name").." strip-searched you")
msg2(id,"you failed at strip-searching "..player(id_scan,"name").."")
else
msg2(id_scan,"warning, "..player(id,"name").." failed to strip-searched you")
msg("©000000255"..player(id,"name").." did a strip-searching on "..player(id_scan,"name").."")
if #wep <= 1 then
msg("©000255000"..player(id,"name").." found nothing on "..player(id_scan,"name").."")
end
ii = 0
while (ii < #wep) do
ii = ii + 1
if (wep[ii] == 50) == false then
msg("©255000000"..player(id,"name").." found a "..itemtype(wep[ii],"name").." on "..player(id_scan,"name").."")
end
end
end
end
end
end
end
end
edited 2×, last 05.06.12 07:00:44 pm

old Re: prison end

Todesengel
User Off Offline

Quote
Sorry, my crystal ball broke. So, whats your problem?
You just give us a code (by the way as a quote?) without any information..

old Re: prison end

Jynxxx
User Off Offline

Quote
your code was missing ends and idk why you had your second hook had this

1
2
for _, usgn in ipairs(prison1list) do
if player(id,'usgn') == usgn then

After that it should work, also it might be terribly indented sorry about that.

Spoiler >

old Re: prison end

ANOTHERDAILY
User Off Offline

Quote
user Jynxxx has written
your code was missing ends and idk why you had your second hook had this

1
2
for _, usgn in ipairs(prison1list) do
if player(id,'usgn') == usgn then

After that it should work, also it might be terribly indented sorry about that.

Spoiler >


was not sure that would work, but thanks for trying

old Re: prison end

Avo
User Off Offline

Quote
Use Notepad++, you won't miss "end"s - functions, loops, conditions are marked - you will see if you don't write "end".

old Re: prison end

ANOTHERDAILY
User Off Offline

Quote
user Avo has written
Use Notepad++, you won't miss "end"s - functions, loops, conditions are marked - you will see if you don't write "end".


I always use but never stopped to see it helped a lot thanks
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview