English Lua Scripts/Questions/Help

6,774 replies
Goto Page
To the start Previous 1 2 ... 200 201 202 ... 338 339 Next To the start
12.05.10 07:16:17 am
Up
ohaz
Moderator
Offline Off
info.txt has written:
hit(id,source,weapon,hpdmg,apdmg)               on hit/damage
-id: player id
-source: source player id or 0
-weapon: weapon type / source type id
-hpdmg: caused damage (health)
-apdmg: caused damage (armor)
>return:     0 - proceed normally
          1 - ignore this hit (no damage)

As you can see, the "source" parameter is the ID of the shooting player
12.05.10 01:04:29 pm
Up
Redefinder
User
Offline Off
@gabpro,thanks.
gabpro has written:
Not very useful but I think that can do it

Better than nothing,right?
12.05.10 05:36:39 pm
Up
gabpro
User
Offline Off
@Arctic and TheKilledDeath
Quote:
-source: source player id or 0

I try it,but dont work :x
Well,I will test again...

EDIT : Yeah!Some errors in LUA,then i FIX it and works *-*
Thanks!

@redefinder
Quote:
Better than nothing,right?

Yeah
edited 1×, last 12.05.10 05:53:42 pm
13.05.10 02:48:31 am
Up
0ito
User
Offline Off
I need help to change the limit of setmaxhealth to make a zombie mod(similar to the blazzingxx zombie plague classes)
13.05.10 03:25:58 pm
Up
Szkieletor
User
Offline Off
0ito has written:
I need help to change the limit of setmaxhealth to make a zombie mod(similar to the blazzingxx zombie plague classes)

There is no way to change setmaxhealth limit. It's 250 and nothing will change it. Blazingxx mod uses another container for health, asking him if you can cut this part of script from his mod will be easiest way.
13.05.10 08:45:48 pm
Up
Redefinder
User
Offline Off
How to make a script that when typed !moneylist shows the money of all players?

Also does anyone have an idea on how to make: !setspawnpos and then teleport the player with !teleportme.
Any help is appreciated.
Thank you.
13.05.10 11:36:52 pm
Up
NaSH
User
Offline Off
redefinder has written:
How to make a script that when typed !moneylist shows the money of all players?

Also does anyone have an idea on how to make: !setspawnpos and then teleport the player with !teleportme.
Any help is appreciated.
Thank you.


Code:
1
2
3
4
5
6
7
8
9
10
11
12
addhook("say","onsay")
function onsay(id,message)
     if message=="!moneylist" then
          for i = 1,32 do
               if player(i,"exists") then
                    local iname = player(i,"name")
                    local imoney = player(i,"money")
                    parse('sv_msg2 '..id..' '..iname..' has: '..imoney)
               end
          end
     end
end


Here you are

Explain a bit "!setspawnpos"

EDIT: If I understand what you are thinking to do, don't you think would be better do this:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
addhook("say","onsay")
function onsay(id,message)
     for i = 1,32 do
          if message==("!teleportme "..i) then
               local ix = player(i,"x")
               local iy = player(i,"y")
               parse('setpos '..id..' '..ix..' '..iy)
          end
     end
end

--Command:: !teleportme IDofPlayer
edited 4×, last 14.05.10 12:03:19 am
14.05.10 05:47:52 am
Up
weiwen
User
Offline Off
For your teleport thing,

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local spawnpos = {}

addhook("say","onSay")
function onSay(id,message)
     if message == "!setspawnpos" then
          spawnpos[id] = {player(id, 'x'), player(id, 'y')}
     --[[
     elseif message == "!resetspawn" then
          onLeave(id)
     ]]
     elseif message == "!teleportme" then
          if spawnpos[id] then
               parse("setpos " .. id .. " " .. spawnpos[id][1] .. " " .. spawnpos[id][2])
          else
               msg2(id, "You have not set a spawn position, use !setspawnpos to set one.")
          end
     end
end

addhook("leave", "onLeave")
function onLeave(id)
     spawnpos[id] = nil
end
14.05.10 12:36:45 pm
Up
Szkieletor
User
Offline Off
weiwen has written:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
local spawnpos = {}

addhook("say","onSay")
function onSay(id,message)
     if message == "!setspawnpos" then
          spawnpos[id] = {player(id, 'x'), player(id, 'y')}
     --[[
     elseif message == "!resetspawn" then
          onLeave(id)
     ]]
     elseif message == "!teleportme" then
          if spawnpos[id] then
               parse("setpos " .. id .. " " .. spawnpos[id][1] .. " " .. spawnpos[id][2])
          else
               msg2(id, "You have not set a spawn position, use !setspawnpos to set one.")
          end
     end
end

addhook("leave", "onLeave")
function onLeave(id)
     spawnpos[id] = nil
end


Is there a way to make this an RCON only console command? Or just make this command available only when certain value is true(ex. Cansetspawn = 1)
14.05.10 01:05:35 pm
Up
Redefinder
User
Offline Off
N-B-K has written:
Explain a bit "!setspawnpos"

I mean a player types !setspawnpos and then the script remembers his saved position until he disconnects,then he can use !teleportme and if he has atleast 4000$ money he will be teleported.

Anyways,thanks for the moneylist script
15.05.10 03:54:31 pm
Up
Sudden Death
User
Offline Off
I don't know how to change here
Spoiler >
Please change this to work
edited 1×, last 16.05.10 09:32:05 am
SoRRy FoR mY p00r EngLisH
15.05.10 08:44:01 pm
Up
Precel97
User
Offline Off
Hi, im new scripter
I wanna create worms mode.
Who can help me in this script :

Ufo - If you throw gas granade and if you hurt other player then he change to ufo .

Who can create example menu for me??

Help plz


16.05.10 03:03:37 pm
Up
Kostyan1996
User
Offline Off
Who knew such a script, where if a player joins a CT, it becomes a T, but if the player entered RCON password, or he ADMIN, it can become CT?
16.05.10 05:08:07 pm
Up
SkullFace
User
Offline Off
How do I make when I built barricade or wall,wall2,wall3 and then goes over it some sprite? Help anyone?
16.05.10 07:20:11 pm
Up
Dig-Dog-HotDog
User
Offline Off
im making an Rpg script and there are cars and boats in them so I have 2 questions :
1.Could some1 write me a code so that when I write "!leave" the player would get out of the car (the same with boat)
2.could some1 write me a code that a certain vehicle could only be in water
16.05.10 11:07:35 pm
Up
YellowBanana
BANNED
Offline Off
This should do the job.

Code:
1
2
3
4
5
function say(id,msg)
     if(msg == "!leave") then
          leavecar(id)
     end
end
Up
KenVo
User
Offline Off
I downloaded script CS2DTibia - RPG in: http://www.unrealsoftware.de/forum_posts.php?post=176932&start=0 and don't know how to add more monster to the map

Example:

Code:
1
2
3
4
5
{
          name = 'Caterpie', health = 100, image = 'gfx/weiwen/pokemon/10.png', scalex = 1.5, scaley = 1.5, r = 104, g = 152, b = 40, 
          atk = 1.1, def = 1.2, spd = 7, atkspd = 10, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 100, runat = 20, spawn1 = {62, 70}, spawn2 = {150, 150}, 
          exp = 5, money = 80, loot = {{chance = 8000, id = 1}}, 
     },


I want to add more spawn for this monster and make it spawn faster so what i have to change?

17.05.10 08:40:48 am
Up
Night Till Death
User
Offline Off
the spawnchance is a place you need to edit.
17.05.10 04:52:40 pm
Up
DRoNe
User
Offline Off
Kostyan1996 has written:
Who knew such a script, where if a player joins a CT, it becomes a T, but if the player entered RCON password, or he ADMIN, it can become CT?


you mean this ? :
Code:
1
2
3
4
5
6
7
8
9
10
11
addhook("team","adminteam")
function adminteam(id)
local usgn = player(id,"usgn")
     if usgn == HERE YOUR,FRIEND USGN then
          if team == 2 then
               parse("makect "..id)
          else
               parse("maket "..id)
          end
     end
end


i don't know with rcon_pw, sorry
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
17.05.10 05:04:26 pm
Up
Sudden Death
User
Offline Off
Omg what worng with my script? help me i can't change it, i don't understand lua in full >.>
SoRRy FoR mY p00r EngLisH
To the start Previous 1 2 ... 200 201 202 ... 338 339 Next To the start