English Base will spawn in Flare pos

6 replies
Goto Page
To the start Previous 1 Next To the start
17.11.20 09:23:06 am
Up
DX
User
Offline Off
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
addhook("projectile","a")
function a(id,wpn,x,y)
     if (wpn == 54) then
          local team = player(id,"team")
               x = player(id,"tilex")   
               y = player(id,"tiley")
                         parse ("spawnobject 11 "..(x-2).." "..(y-2).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x-1).." "..(y-2).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x).." "..(y-2).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x+1).." "..(y-2).." 0 0 "..team.." "..id)
                         parse ("spawnobject 11 "..(x+2).." "..(y-2).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x+2).." "..(y-1).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x+2).." "..(y).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x+2).." "..(y+1).." 0 0 "..team.." "..id)
                         parse ("spawnobject 11 "..(x+2).." "..(y+2).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x+1).." "..(y+2).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x).." "..(y+2).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x-1).." "..(y+2).." 0 0 "..team.." "..id)
                         parse ("spawnobject 11 "..(x-2).." "..(y+2).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x-2).." "..(y+1).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x-2).." "..(y).." 0 0 "..team.." "..id)
                         parse ("spawnobject 1 "..(x-2).." "..(y-1).." 0 0 "..team.." "..id)
                    parse ("spawnobject 6 "..(x-1).." "..(y-1).." 0 0 "..team.." "..id)
                    parse ("spawnobject 6 "..(x).." "..(y-1).." 0 0 "..team.." "..id)
                    parse ("spawnobject 6 "..(x+1).." "..(y-1).." 0 0 "..team.." "..id)
                    parse ("spawnobject 6 "..(x+1).." "..(y).." 0 0 "..team.." "..id)
                    parse ("spawnobject 6 "..(x+1).." "..(y+1).." 0 0 "..team.." "..id)
                    parse ("spawnobject 6 "..(x).." "..(y+1).." 0 0 "..team.." "..id)
                    parse ("spawnobject 6 "..(x-1).." "..(y+1).." 0 0 "..team.." "..id)
                    parse ("spawnobject 6 "..(x-1).." "..(y).." 0 0 "..team.." "..id)
          end               
     end


When I throw the flare the base will appear not on my player position

if the first one is too long you can give me an example with this one

Code:
1
2
3
4
5
6
7
8
9
10
11
addhook("projectile","a")
function a(id,wpn,x,y)
     if (wpn == 54) then
          local team = player(id,"team")
                    parse ("spawnobject 11 "..((x-16)/32).." "..((y-16)/32).." 0 0 "..team.." "..id)
                    parse ("spawnobject 11 "..((x-16)/31).." "..((y-16)/33).." 0 0 "..team.." "..id)
                    parse ("spawnobject 11 "..((x-16)/33).." "..((y-16)/31).." 0 0 "..team.." "..id)
                    parse ("spawnobject 11 "..((x-16)/30).." "..((y-16)/34).." 0 0 "..team.." "..id)
                    parse ("spawnobject 11 "..((x-16)/34).." "..((y-16)/30).." 0 0 "..team.." "..id)
          end
     end
edited 3×, last 18.11.20 01:06:49 pm
Kontol bapak kau pecah!!!
17.11.20 07:39:09 pm
Up
The Dark Shadow
User
Offline Off
Your profile picture makes me to not even read what you asked for.

Admin/mod comment:

rules §4.5 - Stick to the point! Do not write stuff which is not related to the original topic! Why are you posting in this thread in the first place? Such stuff should be talked privately. /user Fraizeraust
17.11.20 10:19:13 pm
Up
DX
User
Offline Off
@user The Dark Shadow: Thanks
Kontol bapak kau pecah!!!
18.11.20 12:48:06 pm
Up
Cebra
User
Offline Off
@user DX: i would suggest that you ask/express a question, if you have one. Of course, we know what are you asking for, but this would show, that you have thought about your request and you know what are you doing. You would also show a minimum of respect.
And it is simply polite. (btw i think user The Dark Shadow is right)

ps: maybe you start to learn lua scripting (here?)
loading...
18.11.20 12:52:19 pm
Up
DX
User
Offline Off
@user Cebra: okay
Kontol bapak kau pecah!!!
20.11.20 02:23:01 pm
Up
VADemon
User
Offline Off
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
70
71
72
73
74
addhook("attack", "vFlareBase.attack")
vFlareBase = {}

function vFlareBase.attack(id) --on throwing
     if player(id, "weapontype")==52 or player(id, "weapontype")==0 then
          vFlareBase.check_for_flare(id)
     end
end

function vFlareBase.check_for_flare(PLAYERID)
     local list = projectilelist(0,tonumber(PLAYERID)) --flying projectiles

     for k,p in pairs(list) do
          if projectile(p.id, PLAYERID, "type")==54 then
               print(p.id, PLAYERID)
               timer(1000, "vFlareBase.flareLanded", p.id.."\n"..PLAYERID)
               --msg("New flare detected")
          end
     end
end

function vFlareBase.flareLanded(timerNameArg)
     local projID, playerID = string.match(timerNameArg, "(%d+)\n(%d+)")
     local projID, playerID = tonumber(projID), tonumber(playerID)
     
     
     local pX, pY = projectile(projID, playerID, "x"), projectile(projID, playerID, "y")
     local pTileX, pTileY = math.floor(pX / 32), math.floor(pY / 32)
     
     vFlareBase.buildBase(pTileX, pTileY, playerID)
     
     parse("freeprojectile "..timerNameArg)
end

function vFlareBase.buildBase(x, y, playerID)
     local id = playerID
     local team = player(playerID, "team")
     
     parse ("spawnobject 11 "..(x-2).." "..(y-2).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x-1).." "..(y-2).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x).." "..(y-2).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x+1).." "..(y-2).." 0 0 "..team.." "..id)
     parse ("spawnobject 11 "..(x+2).." "..(y-2).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x+2).." "..(y-1).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x+2).." "..(y).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x+2).." "..(y+1).." 0 0 "..team.." "..id)
     parse ("spawnobject 11 "..(x+2).." "..(y+2).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x+1).." "..(y+2).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x).." "..(y+2).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x-1).." "..(y+2).." 0 0 "..team.." "..id)
     parse ("spawnobject 11 "..(x-2).." "..(y+2).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x-2).." "..(y+1).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x-2).." "..(y).." 0 0 "..team.." "..id)
     parse ("spawnobject 1 "..(x-2).." "..(y-1).." 0 0 "..team.." "..id)
     
     for xOffset = -1, 1, 1 do -- for each x (-1,0,1)
          for yOffset = -1, 1, 1 do -- for each y (-1,0,1)
               print(xOffset ..",".. yOffset)
               if not (xOffset == 0 and yOffset == 0) then
                    parse("spawnobject 6 "..(x+xOffset).." "..(y+yOffset).." 0 0 "..team.." "..id)
               end
          end
     end
     --[[ refactored into for-loop above
     parse ("spawnobject 6 "..(x-1).." "..(y-1).." 0 0 "..team.." "..id)
     parse ("spawnobject 6 "..(x).." "..(y-1).." 0 0 "..team.." "..id)
     parse ("spawnobject 6 "..(x+1).." "..(y-1).." 0 0 "..team.." "..id)
     parse ("spawnobject 6 "..(x+1).." "..(y).." 0 0 "..team.." "..id)
     parse ("spawnobject 6 "..(x+1).." "..(y+1).." 0 0 "..team.." "..id)
     parse ("spawnobject 6 "..(x).." "..(y+1).." 0 0 "..team.." "..id)
     parse ("spawnobject 6 "..(x-1).." "..(y+1).." 0 0 "..team.." "..id)
     parse ("spawnobject 6 "..(x-1).." "..(y).." 0 0 "..team.." "..id)
     ]]
end


Based on my old anti-teamflash code. That code was removed from uploads here because a certain -iq user by the name of user sheeL thought I stole his code (lie) and complained to user DC who then removed my original (and better) code without looking into it.

@user DX: You should be able to easily adapt/change the code above.
20.11.20 08:17:54 pm
Up
DX
User
Offline Off
@user VADemon: Thanks for the script but it's a little complicated so I can't understand it
Kontol bapak kau pecah!!!
To the start Previous 1 Next To the start