English Hook "USE" to open a menu

13 replies
Goto Page
To the start Previous 1 Next To the start
02.07.13 12:52:40 pm
Up
mr_s
User
Offline Off
Code:
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
addhook("use","tytyty")     
function tytyty(id,x,y)
      if (player(id,"tilex")==vehiclenpcx and player(id,"tiley")==vehiclenpcy and player("trigger car_shop")) then
      rp_msg2(id,"255000000","Vehicle Seller: Hello Which vehicle you would like to rent?")
     menu(id,"Vehicle list 1,BMW 2010 |3k,Porche |1.5k,Nissan |5k,BMW X5 |7.5k,Sedan |3k,Other Vehicles")
     elseif (player(id,"tilex")==horsenpcx and player(id,"tiley")==horsenpcy) then
      rp_msg2(id,"255000000","Horse Seller: Hello Which horse you would like to rent?")
     menu(id,"Horses,White horse |10k,Orange horse |10k,Brown horse |10k")
    elseif (player(id,"tilex")==movienpcx and player(id,"tiley")==movienpcy) then
      rp_msg2(id,"255000000"," Hello Which movie you would like to watch?")
     menu(id,"Movie,Naruto |100$,Harry Potter |100$,bye")    
     elseif (player(id,"tilex")==bridge1npcx and player(id,"tiley")==bridge1npcy) then
      rp_msg2(id,"255000000","Hi,Welcome to the island.")
     menu(id,"Bridge,Can I pass?,Buy a ticket. |30k,Bye")
     elseif (player(id,"tilex")==bridge2npcx and player(id,"tiley")==bridge2npcy) then
      rp_msg2(id,"255000000","Hi,Welcome to the island.")
     menu(id,"Bridge2,Can I pass?,Buy a ticket. |30k,Bye")
     elseif (player(id,"tilex")==vicarnpcx and player(id,"tiley")==vicarnpcy) then
      rp_msg2(id,"255000000","Vicar:Welcome to the church.")
      menu(id,"Heal,Heal |1k,Bye")
     elseif (player(id,"tilex")==licensenpcx and player(id,"tiley")==licensenpcy) then
      rp_msg2(id,"255000000","License Seller: Hello Which License you would like to Buy?")
     menu(id,"License List,Normal License |100k,Vehicle License |150k,Vip |5000k,Temp Ct power |100000k,Buy speed")    
   elseif (player(id,"tilex")==shopnpcx and player(id,"tiley")==shopnpcy) then
          if rp_Adminlevel[id] >= 1 then
          rp_msg2(id,"255000000","House Seller: Hello admin, What would you like to do?")
          menu(id,"sansnasa,This menu , is under, constuction!")
          else 
          rp_msg2(id,"255000000","House Seller: Hello, Which house you would like to Buy?")
          menu(id,"Buy House,house 1 |"..house1owner..",house 2 |"..house2owner..",house 3 |"..house3owner..",house 4 |"..house4owner..",house 5 |"..house5owner..",bye")
          end
     elseif (player(id,"tilex")==shop2npcx and player(id,"tiley")==shop2npcy) then
          if rp_Adminlevel[id] >= 1 then
          rp_msg2(id,"255000000","House Seller: Hello admin, What would you like to do?")
          menu(id,"sansnasa2,This menu , is under, constuction!")
          else 
          rp_msg2(id,"255000000","House Seller: Hello, Which house you would like to Buy?")
          menu(id,"Buy House2,house 6 |"..house6owner..",house 7 |"..house7owner..",house 8 |"..house8owner..",house 9 |"..house9owner..",house 10 |"..house10owner..",bye")
          end
    elseif (player(id,"tilex")==magicnpcx and player(id,"tiley")==magicnpcy) then
      rp_msg2(id,"255000000","Magician: Hello Which Magic you would like to learn?")
     CreateAddonsSell(id)
     elseif (checkbound(id,Config.Bank)) then
      rp_msg2(id,"255000000","Banker:Welcome to the bank.")
      menu(id,"bank,my money  |"..Bankmoney[id]..",Deposit ,Withdraw,Credit card ,Info ")
     end

i want help in this because i want to use trigger car_shop for vehicle shop
trigger addon_shop for magic book shop
trigger license_shop for license shop
trigger island_shop for island shop
............................
EDIT : no reply?
edited 1×, last 02.07.13 08:05:12 pm
IMG:http://www.gs4u.net/350x20/cs2d/5.231.50.192:36963.png
02.07.13 09:57:04 pm
Up
Alistaire
User
Offline Off
Indeed no reply. This code is a mess, and you should put it out of its misery.
IMG:http://i.imgur.com/5zhwOTP.png
03.07.13 08:45:31 am
Up
mr_s
User
Offline Off
please, i need very simple code that i forgot it
how to open a menu for the player who triggered the trigger
IMG:http://www.gs4u.net/350x20/cs2d/5.231.50.192:36963.png
03.07.13 11:25:07 am
Up
Rainoth
Moderator
Offline Off
Code:
1
2
3
4
5
6
addhook("usebutton","potato")
function potato(id,x,y)
     if x == 800 and y==85 then 
          menu(id,"Weekdays,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday")
     end
end
05.07.13 01:12:25 pm
Up
mr_s
User
Offline Off
it dont work, please help me
p.s : it won't add hook
IMG:http://www.gs4u.net/350x20/cs2d/5.231.50.192:36963.png
05.07.13 01:40:48 pm
Up
Rainoth
Moderator
Offline Off
That's because you have to write appropriate tiles on where the button is.

Code:
1
2
3
4
5
6
addhook("trigger","alsoapotato")
function alsoapotato(neim,sours)
     if neim=="80085" then
          menu(id,"Weekdays,Mon,Tue,Wed,Thurs,Fri,Sat,Sun")
     end
end
20.07.13 12:55:07 pm
Up
mr_s
User
Offline Off
and it isnt work, same problem, won't add hooks =((
IMG:http://www.gs4u.net/350x20/cs2d/5.231.50.192:36963.png
20.07.13 01:43:18 pm
Up
Bowlinghead
User
Offline Off
Did you REALLY wrote:
Code:
1
2
3
4
addhook("trigger","alsoapotato") -- THIS
function alsoapotato(neim,sours) -- AND THIS?
...
end


Because then the hook should be added.
Share time limited free games here
20.07.13 03:46:40 pm
Up
mr_s
User
Offline Off
user Bowlinghead has written:
Did you REALLY wrote:
Code:
1
2
3
4
addhook("trigger","alsoapotato") -- THIS
function alsoapotato(neim,sours) -- AND THIS?
...
end


Because then the hook should be added.

yes i wrote them
i think it is a cs2d bug because my script use tons of hooks
IMG:http://www.gs4u.net/350x20/cs2d/5.231.50.192:36963.png
20.07.13 04:01:45 pm
Up
Rainoth
Moderator
Offline Off
When you open console, does it list that hook as added or do you get an error ?
20.07.13 04:15:14 pm
Up
mr_s
User
Offline Off
i dont see anything about use hook when i open the console
IMG:http://www.gs4u.net/350x20/cs2d/5.231.50.192:36963.png
20.07.13 04:40:08 pm
Up
Rainoth
Moderator
Offline Off
Then you are running wrong script.
Or your script file isn't added in server.lua or similar stuff.

It's NOT POSSIBLE to get NO error and have a hook not added if you actually run that script.
21.07.13 08:26:28 am
Up
mr_s
User
Offline Off
user Rainoth has written:
Then you are running wrong script.
Or your script file isn't added in server.lua or similar stuff.

It's NOT POSSIBLE to get NO error and have a hook not added if you actually run that script.

but i have
IMG:http://www.gs4u.net/350x20/cs2d/5.231.50.192:36963.png
21.07.13 01:17:48 pm
Up
_Yank
User
Offline Off
Sorry but i dont trust on you.
Send me pm and let me do teamviewer to your computer
To the start Previous 1 Next To the start