House System & No-damage area
17 replies



12.10.12 07:42:39 pm
Hi, I need some help here. I know what I'm asking is very much but please help me.
I think If you want to make a menu, I recommended you to use serveraction 3
I think If you want to make a menu, I recommended you to use serveraction 3
Quote:
House System
You can't use the trigger If you not the owner of the house (e.g door1,door2,door3)
You can be the owner of the house by clicking the trigger (e.g house1,house2,house3) & pay it for 25000 (Once for forever, except If you leave the server or stop renting it).
Payment code:
House code:
house1 trigger to buy the house & door1,door2,door3 are the trigger than can be used after you buy it.
Only the trigger that written down here that will be restricted from being used without owned the house.
Player only can have one house (Even admin can't have more than one house)
Only the owner of the house can build, destroy, trigger something in the house (Admin can build, destroy, trigger something in the house even it's wasn't his house)

Code:
1
2
3
4
5
2
3
4
5
Houset ={
{house1}{door1,door2,door3},
{house2}{door4,door5,door6},
{house3}{door7,door8,door9},
},
{house1}{door1,door2,door3},
{house2}{door4,door5,door6},
{house3}{door7,door8,door9},
},

Payment code:
Code:
1
rp_money[id]=rp_money[id]-25000
House code:
house1 trigger to buy the house & door1,door2,door3 are the trigger than can be used after you buy it.
Code:
1
2
3
4
5
2
3
4
5
Houseo ={
{house1}{door1,door2,door3},
{house2}{door4,door5,door6},
{house3}{door7,door8,door9},
},
{house1}{door1,door2,door3},
{house2}{door4,door5,door6},
{house3}{door7,door8,door9},
},

Code:
1
2
3
2
3
Nouse ={
{door1,door2,door3,door4,door5,door6,door7,door8,door},
},
{door1,door2,door3,door4,door5,door6,door7,door8,door},
},


Quote:
No-damage area
You can't attack someone in some area (Absolutely can't)
If someone attack you then the attacker will receive some message (e.g You can not hurt anyone here). I don't want the attacker think that was a lag & then leave the server.

Code:
1
2
3
2
3
Nodagamea ={
{{10,20},{30,40}},
{{50,60},{70,80}},
{{10,20},{30,40}},
{{50,60},{70,80}},

edited 6×, last 04.11.12 01:00:50 pm
No damage area==>
I copied this from my Multigame. It works fine.
EDIT: ok I forgot that you Absolutely can't attack. I'll edit it.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
no_attack_zone = {
{29,22,48,42}, --zones 29,22 X pos, 48,42 Y pos (tiles) to add more zones copypaste the '{29,22,48,42},' and write more. Enter after the '{numbers}'.
}
function no_attack(id)
for n,w in pairs (no_attack_zone) do
local tilex=player(id,"tilex")
local tiley=player(id,"tiley")
if tilex>=w[1] and tilex <=w[3] and tiley >= w[2] and tiley <= w[4] then
return true
end
end
return false
end
addhook('hit','attack')
function attack(id)
if no_attack(id) then
return 1
end
end
{29,22,48,42}, --zones 29,22 X pos, 48,42 Y pos (tiles) to add more zones copypaste the '{29,22,48,42},' and write more. Enter after the '{numbers}'.
}
function no_attack(id)
for n,w in pairs (no_attack_zone) do
local tilex=player(id,"tilex")
local tiley=player(id,"tiley")
if tilex>=w[1] and tilex <=w[3] and tiley >= w[2] and tiley <= w[4] then
return true
end
end
return false
end
addhook('hit','attack')
function attack(id)
if no_attack(id) then
return 1
end
end
I copied this from my Multigame. It works fine.
EDIT: ok I forgot that you Absolutely can't attack. I'll edit it.

No damage area==>
I copied this from my Multigame. It works fine.
EDIT: ok I forgot that you Absolutely can't attack. I'll edit it.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
no_attack_zone = {
{29,22,48,42}, --zones 29,22 X pos, 48,42 Y pos (tiles) to add more zones copypaste the '{29,22,48,42},' and write more. Enter after the '{numbers}'.
}
function no_attack(id)
for n,w in pairs (no_attack_zone) do
local tilex=player(id,"tilex")
local tiley=player(id,"tiley")
if tilex>=w[1] and tilex <=w[3] and tiley >= w[2] and tiley <= w[4] then
return true
end
end
return false
end
addhook('hit','attack')
function attack(id)
if no_attack(id) then
return 1
end
end
{29,22,48,42}, --zones 29,22 X pos, 48,42 Y pos (tiles) to add more zones copypaste the '{29,22,48,42},' and write more. Enter after the '{numbers}'.
}
function no_attack(id)
for n,w in pairs (no_attack_zone) do
local tilex=player(id,"tilex")
local tiley=player(id,"tiley")
if tilex>=w[1] and tilex <=w[3] and tiley >= w[2] and tiley <= w[4] then
return true
end
end
return false
end
addhook('hit','attack')
function attack(id)
if no_attack(id) then
return 1
end
end
I copied this from my Multigame. It works fine.
EDIT: ok I forgot that you Absolutely can't attack. I'll edit it.
Thank you very much. I am gonna wait until it absolutely can't be damaged.
didn't work anywaay... i tried it... and nothing happened when i click with left mouse at this area...
i checked the console.. and nothing show'd...
i checked the console.. and nothing show'd...
CS2DArchive - Version Database www.CS2DArchive.com - WebHosting: www.BroHosting.eu
@
Marcell: And what was the console supposed to say?
No doesn't work this way. if you want a message to show up add it in the function.

Code:
1
Console: You can't attack here.
No doesn't work this way. if you want a message to show up add it in the function.
no... i mean when i attack.. i won't get kill... so not work specially!
CS2DArchive - Version Database www.CS2DArchive.com - WebHosting: www.BroHosting.eu
@
Marcell: Are you reading what you're writing, Of course you can get killed in a NO ATTACK ZONE.

sorry... i think'd that this script cause dead when you attack someone or click left mouse as on yates's server
CS2DArchive - Version Database www.CS2DArchive.com - WebHosting: www.BroHosting.eu
I don't believe that cannot be done, because I've a no-damage code but it only designed for admin (They can't be killed whatever you do except you force him to die with using killplayer on console or they get crashed by a dynwall) I don't know how to change that to work per area not per admin.
I don't know did you understand
I don't know did you understand
You absolutely cannot omit related action(s) [if there are any] performed by CS2D.
read
attack
My "no damage area" code
Instructions:
input start x,y tile coordinates in a sub-nodmgarea table [1],[2]
and then input end x,y tile coordinates in the sub-nodmgarea table[3][4]
If you stand in X tile, you're protected.
If you want only 1 tile, input like the second sub-table.
Your tables must be like these:
It works fine for me, I'd hope it works for you too.
read

My "no damage area" code
Instructions:
input start x,y tile coordinates in a sub-nodmgarea table [1],[2]
and then input end x,y tile coordinates in the sub-nodmgarea table[3][4]
Code:
(S)XXXXXXX
XXXXXXXX
XXXXXXXX
XXXXXXX(E)
XXXXXXXX
XXXXXXXX
XXXXXXX(E)
If you stand in X tile, you're protected.
If you want only 1 tile, input like the second sub-table.
Your tables must be like these:
Code:
1
nodmgarea = {{10,20,10,20},{30,40,30,40},{50,60,50,60},{70,80,70,80}}
It works fine for me, I'd hope it works for you too.
edited 1×, last 13.10.12 03:44:24 pm
It seems to be good.
Thank you. I am still waiting for the house system.
Edit:
Seriously, I need a help lol.
Edit:
Seriously, I need a help lol.
edited 3×, last 19.10.12 05:48:12 pm
@
Hanz: So you want someone to make a house system as in someone with the required money could buy the house they want?

@
Jynxxx: I want they buy the house & The house will be their house If they do not leave the server or until the round restart.

edited 2×, last 20.10.12 06:24:58 am
I'm not sure if works or not, I haven't tested it.
Use:
Quote:
MakeProperty"PROPERTY_NAME_HERE"{areaStartX,areaStartY,areaEndX,areaEndY}{"trigger1","trigger2","trigger3","etc..."}{price}
It works only with USGN registered players.



