Forum

> > CS2D > Scripts > position
Forums overviewCS2D overview Scripts overviewLog in to reply

English position

2 replies
To the start Previous 1 Next To the start

old position

Marcell
Super User Off Offline

Quote
There is a table with parse commands
like parse("explosion "..x.." "..y.. 100 100")
And i would lile to do that example i type into chat !explosion 54 55
its makes explosion at 54 55 with 100 100 values
i would like to use cordinates not tiles

old Re: position

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function boom(id,x,y)
    parse("explosion "..x*32+16 .." "..y*32+16 .." 100 100 "..id)
end

function string.split(str,pat) -- Splitting strings (sentences) into separate words
    local t = {}
    for word in string.gmatch(str,pat or "[^%s]+") do
        t[#t+1] = word
    end
    return t
end

addhook("say","callboom")
function callboom(id,t)
     local cmd = t:split()
     if cmd[1] == "!boom" then
          boom(id,tonumber(cmd[2]),tonumber(cmd[3]))
		  return 1
     end
end
edited 1×, last 30.03.14 09:41:43 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview