English Lua Scripts/Questions/Help

6,770 replies
Goto Page
To the start Previous 1 2 ... 218 219 220 ... 338 339 Next To the start
09.07.10 08:06:46 pm
Up
DRoNe
User
Offline Off
batlaizys has written:
I would like to get such a script...

when u say !hide a wall 3 or wall 2 etc. appears.

Its good for construction mod when u can hide between buildings

I managed to make 1 ,but when i say it a supply appears on ALL of players... Idk how to make this code thingy...

i would write it...

parse("mp_building_health supply 10000")

addhook("say","build")
function build(id,txt)
for id=1,32 do
if (txt=="!hide") then
parse("spawnobject 9 "..player(id,"tilex").." "..player(id,"tiley").." 1 1 1 1")
end
end
end

plz help...


Code:
1
2
3
4
5
6
addhook("say","hidesay")
function hidesay(id,txt)
     if txt == "!hide" then
          parse ("spawnobject "..math.random(3,4).." "..player(id,"tilex").." "..player(id,"tiley"))
     end
end


this work :
if player say "!hide" then in his position will appear wall1 or wall2 ...

and please can some1 help me with one problem?, read my older answer.
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
09.07.10 08:29:52 pm
Up
RyceR
User
Offline Off
I have small question: how to make this:

If I press button in menu, there is next menu in game
(Name of menu1: ms.menu menu2: ms.pistol.menu)
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
09.07.10 09:49:45 pm
Up
Homer
User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function ms.menu(p)
     menu(p, titlename1.." random,Next")--etc..You know the menu function
end
function ms.pistol.menu(p)
     menu(p, titlename2..", Button name number 1,Back")--Like above
end
addhook("menu","ms.menu.hook")
function ms.menu.hook(id,title,button)
if string.sub(title, 1, #titlename1) == titlename1 then
     if button == 2 then
          ms.pistol.menu(id)
     end
elseif string.sub(title, 1, #titlename2) == titlename2 then
     if button == 2 then
          ms.menu(id)
     end
end
end

This won't work, but it's the general idea on how to do it.
I detest that man who hides one thing in the depths of his heart, and speaks for another.
10.07.10 04:54:08 am
Up
archmage
User
Offline Off
I have a few questions:
What is the diff between a chunk & block.
What exactly is a package and how to create one
Is it possible to detect the ammo in a weapon and a weapon used by a player?
We must secure the existence of our people and a future for white children. 14/88
10.07.10 04:37:07 pm
Up
DRoNe
User
Offline Off
Code:
1
C stack overflow


What's this ?

+ 2 examples please.
IMG:http://img39.imageshack.us/img39/567/drnatimg.png
10.07.10 04:58:51 pm
Up
Snake_Eater
User
Offline Off
Hi all
Does anybody know how to write "unequal" in a lua script?

I have tried it so...

~=

Code:
1
2
3
4
5
6
addhook ("say","text")
function text(p,t)
if player(p,"name")~="Snake" and t=="Hi" then
msg ("©255000255"..player(p,"name").." said HI!@C")
end
end


Will it function??
[Death Note]
10.07.10 05:21:37 pm
Up
Flacko
User
Offline Off
Dark Byte has written:
I have a few questions:
What is the diff between a chunk & block.
What exactly is a package and how to create one
Is it possible to detect the ammo in a weapon and a weapon used by a player?


Even though old this might help
http://www.lua.org/manual/2.5/manual.html

If you're talking about the package table that appears in the documentation i would suggest you not to mess around with it because it stores data about require'd files.
10.07.10 06:43:43 pm
Up
archmage
User
Offline Off
@Flacko
I mean a package that stores Lua code or modules that are loaded with require.

I think I know the difference:
Chunk: A single line of execution
Block: list of statements that are executed (optional semicolon)
We must secure the existence of our people and a future for white children. 14/88
10.07.10 07:35:00 pm
Up
RyceR
User
Offline Off
@Homer not work
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
10.07.10 09:30:56 pm
Up
archmage
User
Offline Off
@MSek
Homer has written:
This won't work, but it's the general idea on how to do it.

He said it would not work, but a few pages back I posted a menu as an example that works.

Edit:
Here I found:
More >

It is a menu that goes on for infinity in either direction.
edited 1×, last 10.07.10 09:40:58 pm
We must secure the existence of our people and a future for white children. 14/88
11.07.10 07:58:47 am
Up
Flacko
User
Offline Off
Dark Byte has written:
@Flacko
I mean a package that stores Lua code or modules that are loaded with require.


Nothing special, it's just a .lua file or a .dll that you call with require "yourfilewithNOextension"
11.07.10 01:03:34 pm
Up
Snake_Eater
User
Offline Off
Does anybody know how to mark up players in lua script for example with a Lasershoot??O_O

sry for my bad englishcookie
[Death Note]
11.07.10 04:03:58 pm
Up
RyceR
User
Offline Off
Dark Byte VERY THANKS!!! It word very nice

new mod incoming
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
11.07.10 04:10:54 pm
Up
henrik1
User
Offline Off
i have cs2d but i can join the map who is only usng users.
12.07.10 12:27:58 pm
Up
HaRe
User
Offline Off
I need a script when you press like a button called hm1
then a menu shows up

and a script when you walk over X 1000 and Y 1000
edited 1×, last 12.07.10 03:14:46 pm
w0w im so eXotiK
13.07.10 10:36:29 am
Up
StirlizZ-Fapicon
Super User
Offline Off
Could somebody get me a small script:
If number of Ts at server = 0, then script make message (T noobs) and restarting, elseif number of playing CTs on the server = 0 - then script make message (CT noobs) and restarting. But it all working only when 20 secs have passed.

thx.




P.S. somebody there said about "Random Map Generator" for cs2d, its real?
CS2d for ANDROID Discord server is here: https://discord.gg/ww59nvf
14.07.10 08:30:53 am
Up
martis67
User
Offline Off
hi all,


im making gungame lua script 50 % done but when im upgrading to 11lvl all to me are canceled im getting usp and he granade and then i shooting and not leveling up wtf is hapen?
Learning lua
14.07.10 09:05:28 am
Up
Flacko
User
Offline Off
We can't know without looking at your script
14.07.10 09:16:54 am
Up
martis67
User
Offline Off
paste all text here???
Learning lua
14.07.10 09:21:47 am
Up
Flacko
User
Offline Off
Between [code] tags
To the start Previous 1 2 ... 218 219 220 ... 338 339 Next To the start