[Tutorial] [TuT] How to house
#1

Code:
Code:
Code:
	Yo, here used to be bored here not net: D so I did sort of like the house system: boss: tet still makes includ where buou available cars. 
_________________________________________________ [/hr] 
below the top include:
Code:
 new house1pick / / - Do you pickup where it will house. 
   new house1pick2 / / - Do you pickup in the house way you walk out. 
   new Menu: house1menu / / - Let 'menu for the house. 
   new mdum1a / / - This is the owner of a house that no one will buy nemoch. 
   new mdum1b [MAX_PLAYERS ];//- This is playerid Moch need to unlock the house. 
   new dum1z / / - Protection.
_________________________________________________ [/hr]
Do OnGameModeInt:
Code:
 house1menu = CreateMenu (~ r ~ Houde ", 2, 214.0, 194.0, 250.0, 250.0); 
   AddMenuItem (house1menu, 0, "Buy"); 
   AddMenuItem (house1menu, 0, "Sell"); 
   AddMenuItem (house1menu, 0, "Lock"); 
   AddMenuItem (house1menu, 0, "Unlock"); 
   AddMenuItem (house1menu, 0, "Information"); 
   AddMenuItem (house1menu, 0, "Go to house"); 
   AddMenuItem (house1menu, 0, "None"); 
/ / This is the menu. 
   house1pick2 = CreatePickup (1318,1,235.2655,1186.6844,1080.2578) / / To make pickup 
   house1pick = CreatePickup (1273,1,2071.5552, -1701.3064,13.5469) / / also do pickup 
/ / Pickup
OnPlayerPickUpPick:
Code:
 if (pickupid == house1pick2) ( 
   SetPlayerInterior (playerid, 0) / / This is so vistoupн When he sets the interior 0 
   SetPlayerPos (playerid, 2071.5552, -1701.3064,13.5469) / / where he was portno 
   ) 
   if (pickupid == house1pick) ( 
   ShowMenuForPlayer (house1menu, playerid); / / - show him the menu. 
   TogglePlayerControllable (playerid, false) / / - freeze him (nepovinй) 
   )
_________________________________________________ [/hr]
To OnPlayerSelectedMenuRow:
Code:
 new Menu: Current = GetPlayerMenu (playerid );//- Define the menu (maybe you) 
   if (Current == house1menu) ( 
   switch (row) ( 
   case 0: ( 
   TogglePlayerControllable (playerid, true) / / defrost 
   if (GetPlayerMoney (playerid) <50000) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: You have 7 000 0 $") / / When no least 50,000 
   if (mdum1a == 1) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: Sorry, this house was his own man!") / / - When someone has their own shows this 
   mdum1a = 1 / / can holder for 1 so it could not buy one 
   mdum1b [playerid] = 1 / / Can it to 1 can odemikat 
   GivePlayerMoney (playerid, -70000) / / will give him money -70,000 
   SendClientMessage (playerid, COLOR_ZELENA, "[• •]: odnynн This house is yours!") / / Shows that the odeted 
 ) 
  ) 
  ) 
  
   if (Current == house1menu) ( 
   switch (row) ( 
   case 1: ( 
   TogglePlayerControllable (playerid, true) / / defrost 
   if (mdum1b [playerid] == 0) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: Are you the owner of this house!") / / indicates that the owner is not 
   mdum1a = 0 / / give the owner at zero so they can one buy a house 
   mdum1b [playerid] = 0; / / It had nothing to do nemoch of the house 
   GivePlayerMoney (playerid, 70000); / / Return the money 
   SendClientMessage (playerid, COLOR_ZELENA, "[• •]: House sold, they were recovered only half the price (7 000 0 $)!") / / Vipнše it is sold 
   
 ) 
  ) 
  ) 
  
   if (Current == house1menu) ( 
   switch (row) ( 
   case 2: ( 
   TogglePlayerControllable (playerid, true) / / defrost 
   dum1z = 0 / / Locks 
   if (mdum1b [playerid] == 0) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: Are you the owner of this house!"); 
   SendClientMessage (playerid, COLOR_ZELENA, "[• •]: The house was locked!") / / Shows the locked 
   
 ) 
  ) 
  ) 
   if (Current == house1menu) ( 
   switch (row) ( 
   case 3: ( 
   TogglePlayerControllable (playerid, true) / / defrost 
   dum1z = 1 / / It can house a state odemknutйho. 
   if (mdum1b [playerid] == 0) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: Are you the owner of this house!") / / - shows that it is not the owner. 
   SendClientMessage (playerid, COLOR_ZELENA, "[• •]: The house was unlocked!") / / - Vipнše the house unlocked. 
   
 ) 
  ) 
  ) 
   if (Current == house1menu) ( 
   switch (row) ( 
   case 4: ( 
   TogglePlayerControllable (playerid, true) / / - defrost 
   SendClientMessage (playerid, COLOR_ZELENA, "Info on the house:"); 
   SendClientMessage (playerid, COLOR_ZELENA, "Number: '1'."); 
   if (dum1z == 0) ( 
   SendClientMessage (playerid, COLOR_WHITE, 'Lock: locked. "); 
   ) else ( 
   SendClientMessage (playerid, COLOR_WHITE, 'Lock: unlock. "); 
   ) 
   if (mdum1a == 0) ( 
   SendClientMessage (playerid, COLOR_WHITE, "K: yes"); 
   ) else ( 
   SendClientMessage (playerid, COLOR_WHITE, "for sale: No"); 
   ) 
   SendClientMessage (playerid, COLOR_WHITE "Price: 10 000 0 $."); 
 ) 
  ) 
  ) 
   if (Current == house1menu) ( 
   switch (row) ( 
   case 5: ( 
TogglePlayerControllable (playerid, true) / / - defrost 
   if (dum1z == 0) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: This house is boužel locked!") / / - ascertain if zamknutej And if it sends a message. 
   SetPlayerPos (playerid, 234.8819,1189.8713,1080.2578) / / - portno him into the house. 
   SetPlayerInterior (playerid, 3) / / - Can interior. 
   SendClientMessage (playerid, COLOR_ZELENA, "[• •]: Vэtej in the house!") / / - Odessa it is in the house 
   
 ) 
  ) 
  ) 
   if (Current == house1menu) ( 
   switch (row) ( 
   case 6: ( 
   TogglePlayerControllable (playerid, true) / / - defrost. 
   
 ) 
  ) 
  ) [/ Code] 
This is about all ....

Cars I did not :(
Reply
#2

nice
Reply
#3

Quote:
Originally Posted by Avest-X
Yo, here used to be bored here not net: D so I did sort of like the house system: boss: tet still makes includ where buou available cars.
_________________________________________________ [/ hr]
[color = # FF0000] [b] below the top include: [/ b] [/ color]
Code:
 new house1pick / / - Do you pickup where it will house. 
  new house1pick2 / / - Do you pickup in the house way you walk out. 
  new Menu: house1menu / / - Let 'menu for the house. 
  new mdum1a / / - This is the owner of a house that no one will buy nemoch. 
  new mdum1b [MAX_PLAYERS ];//- This is playerid Moch need to unlock the house. 
  new dum1z / / - Protection. [/ code] 
_________________________________________________ [/ hr] 

[color = # FF0000] [b] Do OnGameModeInt: [/ b] [/ color] 
Code:
 house1menu = CreateMenu (~ r ~ Dum ", 2, 214.0, 194.0, 250.0, 250.0); 
  AddMenuItem (house1menu, 0, "Buy"); 
  AddMenuItem (house1menu, 0, "Sell"); 
  AddMenuItem (house1menu, 0, "Lock"); 
  AddMenuItem (house1menu, 0, "Unlock"); 
  AddMenuItem (house1menu, 0, "Information"); 
  AddMenuItem (house1menu, 0, "Vztoupit"); 
  AddMenuItem (house1menu, 0, "None"); 
/ / This is the menu. 
  house1pick2 = CreatePickup (1318,1,235.2655,1186.6844,1080.2578) / / To make pickup 
  house1pick = CreatePickup (1273,1,2071.5552, -1701.3064,13.5469) / / also do pickup 
/ / Pickup [/ code] 
_________________________________________________ [/ hr] 
[color = # FF0000] [b] OnPlayerPickUpPick: [/ b] [/ color] 
Code:
 if (pickupid == house1pick2) ( 
  SetPlayerInterior (playerid, 0) / / This is so vistoupн When he sets the interior 0 
  SetPlayerPos (playerid, 2071.5552, -1701.3064,13.5469) / / where he was portno 
  ) 
  if (pickupid == house1pick) ( 
  ShowMenuForPlayer (house1menu, playerid); / / - show him the menu. 
  TogglePlayerControllable (playerid, false) / / - freeze him (nepovinй) 
  ) [/ Code] 
_________________________________________________ [/ hr] 
[color = # FF0000] [b] Do OnPlayerSelectedMenuRow: [/ b] [/ color] 
Code:
 new Menu: Current = GetPlayerMenu (playerid );//- Define the menu (maybe you) 
  if (Current == house1menu) ( 
  switch (row) ( 
  case 0: ( 
  TogglePlayerControllable (playerid, true) / / defrost 
  if (GetPlayerMoney (playerid) <50000) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: You have 7 000 0 $") / / When no least 50,000 
  if (mdum1a == 1) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: Sorry, this house was his own man!") / / - When someone has their own shows this 
  mdum1a = 1 / / can holder for 1 so it could not buy one 
  mdum1b [playerid] = 1 / / Can it to 1 can odemikat 
  GivePlayerMoney (playerid, -70000) / / will give him money -70,000 
  SendClientMessage (playerid, COLOR_ZELENA, "[• •]: odnynн This house is yours!") / / Shows that the odeted 
 ) 
 ) 
  ) 
  
  if (Current == house1menu) ( 
  switch (row) ( 
  case 1: ( 
  TogglePlayerControllable (playerid, true) / / defrost 
  if (mdum1b [playerid] == 0) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: Are you the owner of this house!") / / indicates that the owner is not 
  mdum1a = 0 / / give the owner at zero so they can one buy a house 
  mdum1b [playerid] = 0; / / It had nothing to do nemoch of the house 
  GivePlayerMoney (playerid, 70000); / / Return the money 
  SendClientMessage (playerid, COLOR_ZELENA, "[• •]: House sold, they were recovered only half the price (7 000 0 $)!") / / Vipнše it is sold 
  
 ) 
 ) 
  ) 
  
  if (Current == house1menu) ( 
  switch (row) ( 
  case 2: ( 
  TogglePlayerControllable (playerid, true) / / defrost 
  dum1z = 0 / / Locks 
  if (mdum1b [playerid] == 0) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: Are you the owner of this house!"); 
  SendClientMessage (playerid, COLOR_ZELENA, "[• •]: The house was locked!") / / Shows the locked 
  
 ) 
 ) 
  ) 
  if (Current == house1menu) ( 
  switch (row) ( 
  case 3: ( 
  TogglePlayerControllable (playerid, true) / / defrost 
  dum1z = 1 / / It can house a state odemknutйho. 
  if (mdum1b [playerid] == 0) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: Are you the owner of this house!") / / - shows that it is not the owner. 
  SendClientMessage (playerid, COLOR_ZELENA, "[• •]: The house was unlocked!") / / - Vipнše the house unlocked. 
  
 ) 
 ) 
  ) 
  if (Current == house1menu) ( 
  switch (row) ( 
  case 4: ( 
  TogglePlayerControllable (playerid, true) / / - defrost 
  SendClientMessage (playerid, COLOR_ZELENA, "Info on the house:"); 
  SendClientMessage (playerid, COLOR_ZELENA, "Number: '1'."); 
  if (dum1z == 0) ( 
  SendClientMessage (playerid, COLOR_WHITE, 'Lock: locked. "); 
  ) else ( 
  SendClientMessage (playerid, COLOR_WHITE, 'Lock: unlock. "); 
  ) 
  if (mdum1a == 0) ( 
  SendClientMessage (playerid, COLOR_WHITE, "K: yes"); 
  ) else ( 
  SendClientMessage (playerid, COLOR_WHITE, "for sale: No"); 
  ) 
  SendClientMessage (playerid, COLOR_WHITE "Price: 10 000 0 $."); 
 ) 
 ) 
  ) 
  if (Current == house1menu) ( 
  switch (row) ( 
  case 5: ( 
TogglePlayerControllable (playerid, true) / / - defrost 
  if (dum1z == 0) return SendClientMessage (playerid, COLOR_ZELENA, "[• •]: This house is boužel locked!") / / - ascertain if zamknutej And if it sends a message. 
  SetPlayerPos (playerid, 234.8819,1189.8713,1080.2578) / / - portno him into the house. 
  SetPlayerInterior (playerid, 3) / / - Can interior. 
  SendClientMessage (playerid, COLOR_ZELENA, "[• •]: Vэtej in the house!") / / - Odessa it is in the house 
  
 ) 
 ) 
  ) 
  if (Current == house1menu) ( 
  switch (row) ( 
  case 6: ( 
  TogglePlayerControllable (playerid, true) / / - defrost. 
  
 ) 
 ) 
  ) [/ Code] 
[b] [color = # FF0000] This is about all ....[/ color] [/ b]
Sorry the spelling errors in both, and in other cases, it's from my Tutu of pawno.cz
Reply
#4

Wow, good for noobs like me
Reply
#5

excuse me if i am being rude, its a good tutorial but i couldn't understand it because of the [ / code] [/ hr ] and the bad english on it
Reply
#6

Thanks, I always wanted to know "How to House".......
Reply
#7



---------- I ended up with this ?? Sorry i've never scripted a house before...

C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(6) : error 001: expected token: ";", but found "/"
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(7) : error 001: expected token: ";", but found "/"
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn( : error 001: expected token: ";", but found "/"
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(9) : error 001: expected token: ";", but found "/"
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(11) : error 001: expected token: ";", but found "/"
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(39) : error 017: undefined symbol "r"
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(39) : error 017: undefined symbol "Houde"
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(39) : warning 215: expression has no effect
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(39) : warning 215: expression has no effect
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(39) : warning 215: expression has no effect
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(39) : warning 215: expression has no effect
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(39) : warning 215: expression has no effect
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(39) : warning 215: expression has no effect
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(39) : error 001: expected token: ";", but found ")"
C:\Users\ctb77\Desktop\S. A. M. P\filterscripts\House.pwn(39) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


9 Errors.
Reply
#8

Gooooooooood !!!!
Thanks !
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)