Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 2251 252 253338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
ahm i need some help with an anti faking script

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
members=12938,12488

addhook("ms100","antifaking")
function antifaking()
	for id = 1,32 do
		if (player(id,"exists")) then
			if (player(id,"name")<">'#black") then
				if (player(id,"usgn") == members) then
					--
				else
					msg("©255000000"..player(id,"name").." Got kicked due faking the Black clan")
					parse("kick "..id)
					parse("setname "..id.." I will never fake black")
				end
			end
		end
	end
end

it works but when you have an name that starts with characters like ' or > , You get kicked

alt Re: Lua Scripts/Questions/Help

murilog
User Off Offline

Zitieren
hi all i want one script like this : cts say !infoct <id> , and player go to jail and spawn on jail , if txt !free <id> the player is free thx , the jail Y : 100 X :100

alt Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Zitieren
Hello Everybody. I would like to ask for such script. If player steps on TILEX and TILEY he gets maxhealth 150,speed 20 and this TILE shuts down for a minute. And after a minute if u step on it it does the thing again.
(I am thinking of making Armor Sprite in rp server and when player steps on armor it does the things.)

Thank you for your help.

alt Re: Lua Scripts/Questions/Help

vrkiller
User Off Offline

Zitieren
can i get alittle help i just need a script
witch start when the serve start and get executed only one time, to set important variables like, building limit...
Can someone give me a example please?

alt Re: Lua Scripts/Questions/Help

Jynxxx
User Off Offline

Zitieren
can someone help me with this script
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
addhookfunction totable(t,match)
local cmd = {}
if not match then match = "[^%s]+" end
for word in string.gmatch(t, match) do
table.insert(cmd, word)
end
return cmd
end

function load(id)
usgn = player(id,"usgn")
if (usgn > 0) then
local usgn = player(id,"usgn")
files = io.open("sys/lua/scelldata/"..usgn..".txt","r")
if(files~=nil) then
msg2(id,"©000255000Your save file found!@C")
msg2(id,"©160160255Your U.S.G.N ID: "..usgn.."@C")
parse('hudtxt2 '..id..' 7 "©000255000Login as: '..usgn..'" 40 

415')
for line in io.lines("sys/lua/scelldata/"..usgn..".txt","r") 

do
local parses = totable(line)
if (tonumber(parses[1])>0) then
yourmon[id] = tonumber(parses[1])
license[id] = tonumber(parses[2])
break
end
end
else
msg2(id,"©255000000Failed to load save!@C")
msg2(id,"©255000000Please check your U.S.G.N account 

settings!@C")
end
end
end

addhook("leave","save")
function save(id)
if (player(id,"usgn") > 0) then
save_data = license[id].." "..yourmon[id]
file = assert(io.open("sys/lua/scelldata/"..usgn..".txt","w"))
file:write(save_data)
file:close()
msg2(id,'©000255001Save Data Successfull!@C')
else
msg2(id,"©255000000Failed to Save!@C")
end


it says it has an error in it please help me fix it
2× editiert, zuletzt 05.09.10 12:26:50

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
Snake_Eater hat geschrieben
@HaRe say me the whole name then I can help


meh thats easy i want if you have like the name

>'#black__WHATEVER or >'#black__.... without being an member u get kicked and i already did that but i have problems with characters like < '

if you aint an member and u have an character you get kicked something like

>wtf

alt Re: Lua Scripts/Questions/Help

Theronz
User Off Offline

Zitieren
Who can do a script for me Plz

This script is classes whit lvls

Script what i can only to do

addhook("drop","sample.dropp.drop")
function sample.dropp.drop()
     return 1
end


First
Noob Lvl 1

Have Deagle and 90 hp

Noob2 Lvl1

Have 80 hp , Glock , 10 armor

Hoops lvl 2 105 hp , Ak47 , 2 he granades , speed 5

Shadow Lvl 4 Costume for him : http://img52.imageshack.us/img52/8026/shadowm.png

Stealh suit , Speed 30 , Machete , hp 100 , Deagle 5 smoke granades

Beta Soldier lvl 8 ,speed 10 , Ak47 ,M4A1 , Heavy armor
3 laser mines

Bob lvl 12 ,hp 130 Wrench m249 3 he granades glock armor

Secret Heros

Android lvl 20 power self destruct - comitting sucide and he create very big explosion
hp 200 Laser M249 heavy armor portal gun 1 laser mine

Superman lvl 20 hp 230 power if can to do - giving 250 hp 100 speed 100 armor for 20 sec
speed 65 light armor flamethrower rpg launcher tactical shield and claws - Very strength

Sephiroth lvl 20 power - Using 5 large explosions Can used 3 times

If can to do him matchete killing all for one hit. have medic armor 100 armor 250 hp speed 60 flame thrower and m249

Im Poland
Sorry for my bad english

Very Thanks if who's do this

alt Re: Lua Scripts/Questions/Help

murilog
User Off Offline

Zitieren
hi all i want one script like this : cts say !infoct <id> , and player go to jail and spawn on jail , if txt !free <id> the player is free thx , the jail Y : 100 X :100

alt Re: Lua Scripts/Questions/Help

Lee
Moderator Off Offline

Zitieren
Dark Byte hat geschrieben
Also do you know where I could learn how to implement Lua in C++? I added the source files to includes/Lua and it won't work.


You need to also link to the static library since gcc/most modern compilers cannot link from source. (the -L%LUAPATH% flag)

alt Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Zitieren
try this...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
members=12938,12488

addhook("ms100","antifaking")
function antifaking()
     for id = 1,32 do
          if (player(id,"exists")) then
               if (string.sub(player(id,"name"),1,7)==">'#black") then
                  if (player(id,"usgn") ~= nil) then
                    if (player(id,"usgn") ~= members) then
                         msg("©255000000"..player(id,"name").." Got kicked due faking the Black clan")
                         parse("kick "..id)
                         parse("setname "..id.." I will never fake black")
                    end
                   end
               end
          end
     end
end

please say if it works/doesn't work

alt Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Zitieren
Lee hat geschrieben
You need to also link to the static library since gcc/most modern compilers cannot link from source. (the -L%LUAPATH% flag)


I found a way (in VC++). Just add lua5.1\includes to VC++ Directories.Include and lua5.1\lib\dll to VC++ Directories.library then add lua5.1.lib to linker.external dependencies.

alt Re: Lua Scripts/Questions/Help

CJ7
BANNED Off Offline

Zitieren
Note that in VC++ ( Visual Studio 2010) , you also need to link the libraries. So under Linker -> Input, add lua51.lib and lua5.1.lib.

I suggest you don't use Dev-CPP, it's a crap IDE to be honest.

alt Help me plz.

Rainoth
Moderator Off Offline

Zitieren
Hello i was making a lua for friend but i keep geting error and i dont know how to fix it.
Error : attempt to call a nil value

Spoiler >


I really need help.

alt Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Zitieren
CJ7 hat geschrieben
Note that in VC++ ( Visual Studio 2010) , you also need to link the libraries. So under Linker -> Input, add lua51.lib and lua5.1.lib.

I suggest you don't use Dev-CPP, it's a crap IDE to be honest.

that is what i meant when i said input.external dependencies

lua5.1\include >> VC++ -> Include Directories
lua5.1\lib\dll >> VC++ -> Library Directories
lua5.1.lib >> Linker -> Input -> External Dependencies

alt Re: Lua Scripts/Questions/Help

Snake_Eater
User Off Offline

Zitieren
@batlaizys

Spoiler >

alt Re: Lua Scripts/Questions/Help

head600
BANNED Off Offline

Zitieren
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end

yemek1=initArray(32)
yemek=initArray(32)

addhook("minute","asd")
function asd(id)
yemek1[id]=yemek1[id]+10
yemek[id]=yemek[id]+10
parse('hudtxt2 '..id..' 4 "Susuzluk: '..yemek1[id]..'" 0 155')
parse('hudtxt2 '..id..' 4 "Aclik: '..yemek[id]..'" 0 150')
end
                         

addhook("spawn","dsa")
function dsa(id)
parse('hudtxt2 '..id..' 4 "Susuzluk: '..yemek1[id]..'" 0 155')
parse('hudtxt2 '..id..' 4 "Aclik: '..yemek[id]..'" 0 150')
end


whats wrong??

alt Re: Lua Scripts/Questions/Help

HaRe
User Off Offline

Zitieren
head600 hat geschrieben
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end

yemek1=initArray(32)
yemek=initArray(32)

addhook("minute","asd")
function asd(id)
yemek1[id]=yemek1[id]+10
yemek[id]=yemek[id]+10
parse('hudtxt2 '..id..' 4 "Susuzluk: '..yemek1[id]..'" 0 155')
parse('hudtxt2 '..id..' 4 "Aclik: '..yemek[id]..'" 0 150')
end
                         

addhook("spawn","dsa")
function dsa(id)
parse('hudtxt2 '..id..' 4 "Susuzluk: '..yemek1[id]..'" 0 155')
parse('hudtxt2 '..id..' 4 "Aclik: '..yemek[id]..'" 0 150')
end


whats wrong??


1
2
3
4
5
6
7
8
9
10
11
addhook("minute","asd")
function asd(id)
	for id = 1,32 do
		if (player(id,"exists")) then
			yemek1[id]=yemek1[id]+10
			yemek[id]=yemek[id]+10
			parse('hudtxt2 '..id..' 4 "Susuzluk: '..yemek1[id]..'" 0 155')
			parse('hudtxt2 '..id..' 4 "Aclik: '..yemek[id]..'" 0 150')
		end
	end
end
Zum Anfang Vorherige 1 2251 252 253338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht