nevermind i found it out but i need to know two last things
how to increase 1
parse("setmaxhealth "..id.." +example") by example = 5
and how to make a random thing and i know what i need to edited 1×, last 19.09.09 04:09:15 am
I need help here, just a newbie questions.
how to make that only player have unlimited ammo?
not for all player unlimited ammo. how can i make the game remember something after you leave the server? playa slaya has written
how can i make the game remember something after you leave the server?
You need to write it with Lua scripts and io commands.
http://www.lua.org/pil/21.1.html
and the next chapter.
Quote
I need help here, just a newbie questions.
how to make that only player have unlimited ammo?
not for all player unlimited ammo.
You could write the script in a way that it fills the ammo of one person everytime he reloads. Then there is no "unlimited" image, but it works too so would this work
1
io.input[my script] t = io.read("*all)
well i did not understand much of that page but will continue reading SQ Moderator Offline
playa slaya has written
so would this work
1
io.input[my script] t = io.read("*all)
well i did not understand much of that page but will continue reading
well, I guess not.
This is super hero 1.2 save script (values save) :
1
2
3
4
5
6
7
function sh_pl_save(id)
	if (player(id,"usgn") > 0) then [b]-- Saves for U.S.G.N.[/b]
		file = assert(io.open(sh_sv_dir..''..player(id,"usgn")..'.txt','w')) [b]-- Makes file with usgn id name. [/b]
		file:write(pl_xp[id]) [b]-- pl_xp is experience valuable[/b]
		file:close()
	end
end
And reading (For newest script Im using shorter way) :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function sh_pl_load(id)
	if pl_load[id] == 0 then
		if (player(id,"usgn") > 0) then
			local usgn = player(id, "usgn")
			ld_data = io.open(sh_dir..'sh_data/'..player(id,"usgn")..'.txt','r')
			if (ld_data ~= nil) then
				for line in io.lines(sh_dir..'sh_data/'..player(id,"usgn")..'.txt','r') do
					local parses = totable(line)
					if (tonumber(parses[1]) > 0) then
						pl_xp[id] = tonumber(parses[1])
						ld_data:close()
					end
				end
			end
		end
		pl_load[id] = 1
	end
end
how can i make hook(attack2) work edited 1×, last 20.09.09 01:59:12 am
playa slaya has written
how can i make hook(attack2) work
You have to attach it to a function like any other hook. yes i know i meant well ill show u
1
2
3
4
addhook("attack2","mine")
function mine(id)
How to select weapon attatack from mose 1 or mouse 2??
end
read the script playa slaya has written
yes i know i meant well ill show u
1
2
3
4
addhook("attack2","mine")
function mine(id)
How to select weapon attatack from mose 1 or mouse 2??
end
read the script
If you want to detect if the player is using burst-mode or not, use the "mode" parameter. so it would be
if (mode==1) then or if (mode==2) then
but i need help with somthing more imporatant:
sorry to bother you again ,but i must know why this isnt working the script works perfect except for saveing it wont save so could u help 1
2
3
4
5
6
7
8
9
10
11
12
13
------------------
-- Save --
------------------
-- This was by: Blazzingxx thanks blazzing
addhook("leave","rpg_leave_save")
function rpg_leave_save(id)
	if (player(id,"usgn") > 0) then -- Saves for U.S.G.N.
file = assert(io.open(RPG_data_dir..''..player(id,"usgn")..'.txt','w')) -- Makes file with usgn id name.
file:write(experience[id])
		 file:write(level[id])
file:close()
end
end
and Load 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
------------------
-- Join -- the save\load by: Blazzingxx thanks blazzing
------------------
addhook("join","rpg_load")
	function rpg_load(id)
if load[id] == 0 then
if (player(id,"usgn") > 0) then
local usgn = player(id, "usgn")
ld_data = io.open(dir..'RPG_data folder/'..player(id,"usgn")..'.txt','r')
if (ld_data ~= nil) then
for line in io.lines(dir..'RPG_data folder/'..player(id,"usgn")..'.txt','r') do
local parses = totable(line)
if (tonumber(parses[1]) > 0) then
pl_xp[id] = tonumber(parses[1])
ld_data:close()
end
end
end
end
load[id] = 1
end
end
all i have is my script and a folder for saves named
RPG_data folder
the code [ code ] [ /code ] did not use tabs SQ Moderator Offline
I will fix your save and load, just wait some time... I have to do something else first
btw, dont use load function for loading!
Use team hool, join[p] = 0 then player joins game. edited 1×, last 20.09.09 12:40:41 pm
can someone make me a simple script that only no reload for 1 player, not all player, I still need a time to learn it Slaya, you had an extra quote and forgot to concatenate the "/"
1
file = assert(io.open(RPG_data_dir.."/"..player(id,"usgn")..".txt",'w'))
That should work
However, I hate saving in diferent files for each USGN
Also, you are saving the experience and the level in the same word. Ie: If have 10XP and im level 2, the file would look like "102". Write to the file like this:
1
file:write(experience[id],"\n",level[id])
edited 1×, last 20.09.09 02:59:13 pm
SQ Moderator Offline
@Flacko
This is idea in gun game 1.1
There is stats values:
Kills, Deaths, Knifekills, Points, Shots, Hits, Wins.
In file data i looks like that (Load & Save scripts much smaller):
Use "\n" to make new line.
Btw, believe... Its faster to load/save smaller file.
Instead of loading/saving huge file. Blazzingxx has written
Use "\n" to make new line.
Btw, believe... Its faster to load/save smaller file.
Instead of loading/saving huge file.
OFC it's faster, but file input/output isn't slow by itself, so I just don't care about speed and make it more confortable for me
BTW: I fixed the script to make it work, I think I should have read thw whole loading function Dx nu mia mersi deloc nici admin si de culoare nimica am pus tot ce trebuia: ( Admin/mod comment
English only plz /TheKilledDeath well i am working on attributes for my rpg and i am on my second 1 athletics.the script works perfect until level up
then i get a million messages in console saying well iforgot it works untill level up on levl 1 to level 2
but its at line 166
Spoiler 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
addhook('move','rpg_move')
function rpg_move(id)
	athleticsexp[id] = athleticsexp[id]+1 [b] --line 166[/b]
	if (athleticsexp[id]>=athletics_move) then
		athleticslevel[id] = athleticslevel[id]+1
		
		experience[id] = experience[id]+expforkill
		
		athletics_move = athletics_move+athleticsmove_icr
		
		athleticsexp = 0
		
		parse ('sv_msg2 '..id..'YOUR ATHLETICS HAVE INCREASED | LEVEL: '..athleticslevel[id])
		
	if (athleticslevel[id]==1) then
		parse('speedmod '..id..' 2')
	end
	
	if (athleticslevel[id]==2) then
		parse('speedmod '..id..' 3')
	end
	
	if (athleticslevel[id]==3) then
		parse('speedmod '..id..' 4')
	end
	
	if (athleticslevel[id]==4) then
		parse('speedmod '..id..' 6')
	end
	
	if (athleticslevel[id]==5) then
		parse('speedmod '..id..' 8')
	end
	end
end
	if (athleticslevel[id]==maxathleticslevel) then
		freehook('move','rpg_move')
		parse('sv_msg2 '..id..'YOUR ATHLETICS IS AT MAX!!! ')
		athleticsexp = 0
	end
@flacko
could i make this happen on leave to save and i do not have dir will it still work? I don't know, I never tried that
Post your leveling function and write here exactly what the console console prints whenever you get the error.
Edit: Ouch, your code has really messed up indentations (tabs) and some 'end's don't match their 'if's. yes the [ code ] does not work