English House System & No-damage area

17 replies
Goto Page
To the start Previous 1 Next To the start
12.10.12 07:42:39 pm
Up
Hanz
User
Offline Off
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

Quote:
House System

• You can't use the trigger If you not the owner of the house (e.g door1,door2,door3)

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


• 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:

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
Houseo ={
          {house1}{door1,door2,door3},
          {house2}{door4,door5,door6},
          {house3}{door7,door8,door9},
     },


• Only the trigger that written down here that will be restricted from being used without owned the house.

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


• 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)


Quote:
No-damage area

• You can't attack someone in some area (Absolutely can't)

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


• 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.
edited 6×, last 04.11.12 01:00:50 pm
12.10.12 07:47:58 pm
Up
Suprise
BANNED
Offline Off
No damage area==>

Code:
1
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

I copied this from my Multigame. It works fine.

EDIT: ok I forgot that you Absolutely can't attack. I'll edit it.
12.10.12 08:02:06 pm
Up
Hanz
User
Offline Off
user Suprise has written:
No damage area==>

Code:
1
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

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.
12.10.12 08:55:31 pm
Up
Marcell
Super User
Offline Off
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...
CS2DArchive - Version Database www.CS2DArchive.com - WebHosting: www.BroHosting.eu
12.10.12 09:03:00 pm
Up
Jynxxx
User
Offline Off
@user Marcell: And what was the console supposed to say?
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.
12.10.12 10:13:05 pm
Up
Marcell
Super User
Offline Off
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
12.10.12 10:37:41 pm
Up
Jynxxx
User
Offline Off
@user Marcell: Are you reading what you're writing, Of course you can get killed in a NO ATTACK ZONE.
12.10.12 10:41:12 pm
Up
Marcell
Super User
Offline Off
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
13.10.12 02:29:27 am
Up
BcY
Reviewer
Offline Off
oh i need house system too for my rp lua.
Kgb2d Community - Since 2012
13.10.12 06:04:21 am
Up
Hanz
User
Offline Off
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
13.10.12 03:30:01 pm
Up
uaiek
User
Offline Off
You absolutely cannot omit related action(s) [if there are any] performed by CS2D.
read cs2d lua hook attack


My "no damage area" code
Spoiler >


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)


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.
13.10.12 05:14:26 pm
Up
Hanz
User
Offline Off
Thank you. I am still waiting for the house system.

Edit:

Seriously, I need a help lol.
edited 3×, last 19.10.12 05:48:12 pm
19.10.12 05:56:59 pm
Up
Jynxxx
User
Offline Off
@user Hanz: So you want someone to make a house system as in someone with the required money could buy the house they want?
19.10.12 06:15:28 pm
Up
Hanz
User
Offline Off
@user 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
20.10.12 03:22:21 pm
Up
Starkkz
Moderator
Offline Off
Spoiler >


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.
lol
21.10.12 12:00:50 pm
Up
Hanz
User
Offline Off
I think it's working, but I don't tested it now I don't have time hehe, bytheway thanks alot.
26.10.12 05:36:41 am
Up
Mr_God
User
Offline Off
Nice SCript
i saw Iran server using this script
04.11.12 12:57:38 pm
Up
Hanz
User
Offline Off
Starkkz, I think the script is not working. I think it need to be fixed as soon as possible.
To the start Previous 1 Next To the start