English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 277 278 279 ... 338 339 Next To the start
10.10.10 08:26:54 pm
Up
head600
BANNED
Offline Off
addhook("minute","minsute")
function minsute(id)
if level[id] >= 7 then
ms.money[id]=ms.money[id]+5
ms.moneyshow(id)
end
end     

error = attemp to compare number with nil

pls help me
10.10.10 09:01:53 pm
Up
RyceR
User
Offline Off
@HaRe like this:
Player has 5% chance to "poison" victim (hit).
If player is poisoned, he has -2hp after second, if he has lose 12hp (6sec's.) there is nothing (he hasnt -2hp after second.)
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
10.10.10 09:10:18 pm
Up
head600
BANNED
Offline Off
addhook("join","asd")
function asd(id)


parse("msg Hello and Welcome at my Server")
parse("equip "..id.." 1")
parse("equip "..id.." 2")
parse("equip "..id.." 3")
parse("equip "..id.." 4")
parse("equip "..id.." 5")
parse("equip "..id.." 6")
parse("equip "..id.." 7")
parse("equip "..id.." 8")
parse("equip "..id.." 9")
parse("equip "..id.." 10")
parse("equip "..id.." 11")
parse("equip "..id.." 12")
parse("equip "..id.." 13")
parse("equip "..id.." 14")
parse("equip "..id.." 15")
parse("equip "..id.." 16")
parse("equip "..id.." 17")
parse("equip "..id.." 18")
parse("equip "..id.." 19")
parse("equip "..id.." 20")
parse("equip "..id.." 21")
parse("equip "..id.." 22")
parse("equip "..id.." 23")
parse("equip "..id.." 24")
parse("equip "..id.." 25")
parse("equip "..id.." 26")
parse("equip "..id.." 27")
parse("equip "..id.." 28")
parse("equip "..id.." 29")
parse("equip "..id.." 30")
end


try this *-*
10.10.10 09:44:16 pm
Up
RyceR
User
Offline Off
@head600
Code:
1
2
3
4
5
6
7
8
9
addhook("minute","minsute")
function minsute()
     for id = 1, 32 then
          if level[id] >= 7 then
               ms.money[id]=ms.money[id]+5
               ms.moneyshow(id)
          end
     end
end

P.S: Thank you for using my modes ;P
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
11.10.10 04:13:33 am
Up
Twisted
User
Offline Off
Anyone know a way to stop this script subtracting all my money?
Spoiler >
11.10.10 04:16:16 pm
Up
hyh2
COMMUNITY BANNED
Offline Off
HEEEEEEEEELP!

Hello.

Can anyone code me little code?

Here's example how it need to work:

If ADMIN USGN id isint 123456 then
loop to center "MAP IS STOLED FROM HYH2!"


Ohh, and knockback too.
Make me that too if you're not lazy.
And if this works, i'll MAYBE give carmod script, remember MAYBE.
IMG:http://www.graphicsgrotto.com/animatedgifs/comments/thankyou/images/agcthankyou4.gif
11.10.10 04:26:31 pm
Up
Jaso
BANNED
Offline Off
admin_usgn = {66847, 24395,}

addhook("team","adminteam")
function adminteam(id,team)
     if team == 1 then --if t
          for index,USGN in ipairs(admin_usgn) do
               if player(id,"usgn") == 66847 or player(id,"usgn") == 24395 then
                    return 0
               else
                    return 1
               end
          end
     end
end

Can some one create unrealsoftware ID for me please instead of a Usgn?
11.10.10 04:28:41 pm
Up
Vectarrio
User
Offline Off
jaso55 has written:
admin_usgn = {66847, 24395,}

addhook("team","adminteam")
function adminteam(id,team)
     if team == 1 then --if t
          for index,USGN in ipairs(admin_usgn) do
               if player(id,"usgn") == 66847 or player(id,"usgn") == 24395 then
                    return 0
               else
                    return 1
               end
          end
     end
end

Can some one create unrealsoftware ID for me please instead of a Usgn?

USGN changed to US but in the script, it's still "usgn", so there's nothing to change
11.10.10 05:38:08 pm
Up
Unknown Killer
User
Offline Off
how do i desable teleport?

is there a entities to desable teleport? if not can someone give me example if player at [x][y] or [x] or [y] then desable teleport

Thanks
11.10.10 06:17:34 pm
Up
Jaso
BANNED
Offline Off
function Array(size,value)
     local array = {}
     for i = 1, size do
          array[i]=value
     end
     return array
end

ct_man = Array(32,false)
adminnokill = Array(32,false)

adminList = {0}

function isAdmin(id)
for _, usgn in ipairs(adminList) do
if player(id,'usgn')==usgn then
return true
end
end
return false
end

addhook([[join]],[[thejoin]])
function thejoin(id)
if isAdmin(id) then
msg("©000000255Admin "..player(id,"name").." enters the server!")
end
end

addhook([[team]],[[theteam]])
function theteam(id,t)
if isAdmin(id) then
if t==2 then
adminnokill[id]=true
ct_man[id]=true
elseif t==1 then
ct_man[id]=true
           end
else
if t==2 then
parse("maket "..id)
return 1
end
end
end

addhook([[hit]],[[thehit]])
function thehit(id,source,weapon,hpdmg,apdmg)
if adminnokill[id]==true then
return 1
end
end

addhook([[serveraction]],[[servaction]])
function servaction(id,acti)
if ct_man[id]==true then
if acti == 3 then
local rot = player(id,[[rot]])
if rot < -90 then rot = rot + 360 end
local angle = math.rad(math.abs( rot + 90 )) - math.pi
local x = player(id,[[x]]) + math.cos(angle) * 25
local y = player(id,[[y]]) + math.sin(angle) * 25
if x > 0 and y > 0 and x < map([[xsize]]) * 32 and y < map([[ysize]]) * 32 then
parse([[setpos ]]..id..[[ ]]..x..[[ ]]..y)
end
end
end
end

This script works now for the ct,s can some one change it for me so it works for only t,s?
11.10.10 11:01:40 pm
Up
Unknown Killer
User
Offline Off
@ jasco55

here you go

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
function Array(size,value) 
     local array = {}
     for i = 1, size do
          array[i]=value
     end
     return array
end

t_man = Array(32,false)
adminnokill = Array(32,false)

adminList = {0}

function isAdmin(id)
for _, usgn in ipairs(adminList) do
if player(id,'usgn')==usgn then
return true
end
end
return false
end

addhook([[join]],[[thejoin]])
function thejoin(id)
if isAdmin(id) then
msg("©000000255Admin "..player(id,"name").." enters the server!")
end
end

addhook([[team]],[[theteam]])
function theteam(id,t)
if isAdmin(id) then
if t==2 then
adminnokill[id]=true
t_man[id]=true
elseif t==1 then
t_man[id]=true
           end
else
if t==1 then
parse("maket "..id)
return 1
end
end
end

addhook([[hit]],[[thehit]])
funtion thehit(id,source,weapon,hpdmg,apdmg)
if adminnokill[id]==true then
return 1
end
end

addhook([[serveration]],[[servation]])
funtion servation(id,ati)
if t_man[id]==true then
if ati == 3 then
local rot = player(id,[[rot]])
if rot < -90 then rot = rot + 360 end
local angle = math.rad(math.abs( rot + 90 )) - math.pi
local x = player(id,[[x]]) + math.cos(angle) * 25
local y = player(id,[[y]]) + math.sin(angle) * 25
if x > 0 and y > 0 and x < map([[xsize]]) * 32 and y < map([[ysize]]) * 32 then
parse([[setpos ]]..id..[[ ]]..x..[[ ]]..y)
end
end
end


Edit : fixing some bugs
11.10.10 11:08:23 pm
Up
Tajifun
User
Offline Off
@ Unknown Killer

Just trigger the teleport using "Trigger_move"
in your Map Editor.
Else try use a hook on movetile & trigger nameoftele
Tajifun yay.
11.10.10 11:37:21 pm
Up
TimeQuesT
User
Offline Off
@Nexmann:
Code:
1
parse("msg Hello and Welcome at my Server")


to -->

Code:
1
msg ("Hello and Welcome at my Server")
Muh
12.10.10 06:42:02 am
Up
Admir
User
Offline Off
Is it there any possible to make people can't spawn instead of using mp_respawndelay? I wonder if DC made return 1 for blocking people click and spawn on spawn hook?
My curse will sail against the wind and enrage the earth.
12.10.10 09:18:17 am
Up
Unknown Killer
User
Offline Off
@tafijun it`s rp server there is rp command that allow player if have license to teleport and save position i want to desallow them to save position at some places i know i need the [x] and [y] position but can u give me an example how to use [x] and [y] thats all

Thanks
12.10.10 10:08:22 am
Up
Tajifun
User
Offline Off
if u already got the teleport funtion just do:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
-- Add this:
license = initArray(32)

-- & this inside of your Teleport function.

if license[id] == 1 then

     -- TELEPORT-FUNCTION HERE

else
     msg2(id,"©255000000You got no license!")
end


You have to tell the script when the player gets a license.

Code:
1
2
3
... then
     license[id] = 1
end



Hope i could help you.
Or maybe you should show us your script. O.o


P.S.: I haven't tested it.
Tajifun yay.
12.10.10 11:44:19 am
Up
Unknown Killer
User
Offline Off
@tafijun here`s the code

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pl_have_pos = Array(32,false)
tele_x = Array(32,0)
tele_y = Array(32,0)

if men == [[Teleport Menu]] then
          if sel == 1 then
               if pl_have_pos[id]==true then
               rp_msg2(id,[[000255000]],[[Position stored succesfully!]])
               rp_msg2(id,[[000255000]],[[X: ]]..player(id,[[x]])..[[ Y: ]]..player(id,[[y]]))
               tele_x[id] = player(id,[[x]])
               tele_y[id] = player(id,[[y]])
               pl_have_pos[id]=true
        end
     end
end
     

i want to make it like this

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
pl_have_pos = Array(32,false)
pl_desable_pos = Array(32,false)
tele_x = Array(32,0)
tele_y = Array(32,0)

if men == [[Teleport Menu]] then
          if sel == 1 then
               if pl_have_pos[id]==true then
               tele_x[id] = player(id,[[32]])
               tele_y[id] = player(id,[[32]])
               pl_have_pos[id]=false
               rp_msg2(id,[[000255000]],[[Position not Stored]])
               return 1
          end
               rp_msg2(id,[[000255000]],[[Position stored succesfully!]])
               rp_msg2(id,[[000255000]],[[X: ]]..player(id,[[x]])..[[ Y: ]]..player(id,[[y]]))
               tele_x[id] = player(id,[[x]])
               tele_y[id] = player(id,[[y]])
               pl_have_pos[id]=true
        end
     end
end


this didnt work it still saved position
12.10.10 12:23:06 pm
Up
Yasday
User
Offline Off
@jaso55: ill help you with this cuz this is my code...xD

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
function Array(size,value) 
     local array = {}
     for i = 1, size do
          array[i]=value
     end
     return array
end

t_man = Array(32,false)
adminnokill = Array(32,false)

adminList = {16138}

function isAdmin(id)
     for _, usgn in ipairs(adminList) do
          if player(id,'usgn')==usgn then
               return true
          end
     end
     return false
end

addhook([[join]],[[thejoin]])
function thejoin(id)
     if isAdmin(id) then
          msg("©000000255Admin "..player(id,"name").." enters the server!")
     end
end

addhook([[team]],[[theteam]])
function theteam(id,t)
     if isAdmin(id) then
          if t==1 then
               adminnokill[id]=true
               t_man[id]=true
          elseif t==2 then
               t_man[id]=true
            adminnokill[id]=fasle
            end
     else
          if t==1 then
               parse("makect "..id)
               return 1
          end
     end
end

addhook([[hit]],[[thehit]])
function thehit(id,source,weapon,hpdmg,apdmg)
     if adminnokill[id]==true then
          return 1
     end
end

addhook([[serveraction]],[[servaction]])
function servaction(id,acti)
   if t_man[id]==true then
      if acti == 3 then
         local rot = player(id,[[rot]])
         if rot < -90 then rot = rot + 360 end
         local angle = math.rad(math.abs( rot + 90 )) - math.pi
         local x = player(id,[[x]]) + math.cos(angle) * 25
         local y = player(id,[[y]]) + math.sin(angle) * 25
         if x > 0 and y > 0 and x < map([[xsize]]) * 32 and y < map([[ysize]]) * 32 then
            parse([[setpos ]]..id..[[ ]]..x..[[ ]]..y)
         end
      end
   end
end


admin can join t and is unkillable but as ct he is killable
12.10.10 02:00:12 pm
Up
RyceR
User
Offline Off
Hi all... I want to have 2 images on me:
file1: gfx/RyceR/hats/nike.png
file2: gfx/RyceR/armors/white.png

Plz, give me mode like this
EDIT: Fixed
edited 1×, last 12.10.10 02:47:50 pm
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
12.10.10 03:33:23 pm
Up
Jaso
BANNED
Offline Off
addhook('hit','hit.weap')


-- Check if the gun is a pistol
function hit.weap(id,sid,w)
if w > 0 and w < 7 then hit.team(id,sid) return 1
else return 0 end
end


-- Check if it's fired by a Terrorist
function hit.team(id,sid)
if player(sid,'team') == 1 then hit.teleport(id)
elseif player(sid,'team') ~= 1 then msg2(sid,"©255000000You can't arrest people!") end
end


-- Teleport the player to a quasi-random location
function hit.teleport(id)
local PLACES = {{1680,80},{2000,80},{2032,528}}
local PLACE = PLACES[math.random(1,#PLACES)]
parse('setpos '..id..' '..PLACE[1]..' '..PLACE[2])
end

When i try this script i get error can some one fix the wrong thing in the script?
To the start Previous 1 2 ... 277 278 279 ... 338 339 Next To the start