Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. addEvent | addEventHandler | createBlipAttachedTo Read these pages carefully and hopefully you'll understand some basics. It doesn't has to be client-side, but if you really want to, then you'll have to use the addEvent function.
  2. It's the one from resource center.
  3. ty but is this marked at the map when the script is on? if it isnt, well then its just to make a con or something on that place I think it's not really important. But if you think it is then you can attach a blip or add an icon yourself. Maybe I'll do an update with GUI and saving money soon.
  4. - addCommandHandler - setPlayerSkin That's basically what you'll need.
  5. How isn't it working? Just doesn't display the gamemode's and map's name? Have you tried to refresh the server list?
  6. Do you have any warnings or errors while gamemode start/run? /debugscript 3
  7. Try this one: function mapName() setMapName("Name-of-the-Map") end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), mapName ) function modeName() setGameType("Name-of-the-Gamemode") end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), modeName )
  8. http://development.mtasa.com/index.php? ... _functions
  9. 50p

    kills give money

    Anywhere, you can even make your own .lua file and add its name to the meta.xml if you want to.
  10. http://img91.imageshack.us/img91/9951/bankcity3wo7.jpg
  11. Why don't you try reading this.
  12. 50p

    Bank Script Problems

    Yeah, interior should be set. Which marker doesn't show up? Does the arrow inside the building appears?
  13. 50p

    Outputting Guns

    http://development.mtasa.com/index.php? ... ayerWeapon Client-side script would do it easly, but there is no slot param for server-side function. You could do a loop with setPlayerWeaponSlot and getPlayerWeapon, but it'd make player switching through the weapons.
  14. Please, use tags so that the code is readable. Thanks. Try this one: function spawnThePlayer ( player ) local spawn_skins = { 16, 33, 61, 164, 165 } local rnd = randInt( 1, #spawn_skins ) local b = spawnPlayer ( player, -711+randInt(1,5), 957+randInt(5,9), 12.4, 90, spawn_skins[ rnd ] ) if not b then spawnThePlayer ( player ) return end fadeCamera(player,true) end
  15. local spawn_skins = { 16, 33, 61, 164, 165 } local rnd = randInt( 1, #spawn_skins ) setPlayerSkin( player, spawn_skins[ rnd ] ) It should choose a random skin from the spawn_skins table and then set player's skin.
  16. Bank System v2.3 As name of the topic says. This is a bank system resource. I've seen some topics where people where asking for a bank system so I made it. I started learning OOP in Lua and found THIS website. It contains some basic OOP that is also based on a bank account example. If you want your server players to save their money you can use this advanced system. Permanent saving is available for registered/logged in players! By default bank marker are inside "City Planing Department" (Las Venturas, behind the TransFender tuning shop) and there is also a new ATM near Cluckin' Bell (east side of LV). Banks in XML New attributes added, here is a structure of bank (also ATM) <bank name="Bank name here" blip="true" depositAllowed="true" > <location posX="0.0" posY="0.0" posZ="0.0" ATM="false" ATMRot="0.0" markerSize="2" interior="0" /> <entrance posX="0.0" posY="0.0" posZ="0.0" teleX="0.0" teleY="0.0" teleZ="0.0" teleRot="0.0" teleInterior="0" /> <exit posX="0.0" posY="0.0" posZ="0.0" teleX="0.0" teleY="0.0" teleZ="0.0" teleRot="0.0" teleInterior="0" interior="0" /> </bank> - main bank construction starts with this node name - Bank's name will be displayed at the top window bar when you enter the bank's marker (). blip(optional, default = true) - whether you want to show '$' sign on the map when close to bank or not (true/false) allowedDeposit(optional, default = true) - whether deposit tab is enabled or disabled (you can disable it if you don't want players to deposit money at ATMs) [*] - the marker location of the bank itself posX, posY, posZ - position of the main bank marker (shows bank window when entered) ATM - whether this bank is ATM or not (true/false) interior (old ATMInterior) - what interior the bank is in (this is required if interior ID is not 0, outside world) ATMRot - rotation of the ATM (Z axis) (0 => ATM object is set on the north side of the bank marker) markerSize - size of the marker, you could change it to 2 if it's a Bank and 1 if it's ATM (any value is acceptable) [*] - the marker that sends you to the different interior posX, posY, posZ - position of the marker teleX, teleY, teleZ - position where you will be teleported when you hit this marker teleRot - rotation of the player after teleportation teleInterior - interior of the teleport position (usually same as bank's interior) [*] - the marker that is placed inside the bank interior and should send you back outside the bank (somewhere near entrance) posX, posY, posZ - position of the marker teleX, teleY, teleZ - position where you should be teleported back when you hit this marker teleRot - rotation of the player after teleportation teleInterior - interior of the teleportation (usually 0, outside) Custom events MTA allows us to add custom event. I took this advantage and added a few events that can be used in your resource. Here they are: onPlayerWithdrawMoney onPlayerDepositMoney onPlayerTransferMoney onPlayerEnterBank onPlayerLeaveBank All of the event's source is player. The parameters for each of the events are in "server/test.eventsAndFunctions.lua". Exported functions Here is a list of all exported functions that can be called from other resources. getBankID( bankMarker ) getBankMarker( bankID ) getBankName( bankID ) getBankMarkers( ) getBankEntranceMarker( bankID ) getBankExitMarker( bankID ) countBanks( ) getBankAccountBalance( accountName, SQLdata ) setBankAccountBalance( accountName, newbalance, SQLdata ) getPlayersInBank( bankID ) getPlayerBank( player ) withdrawPlayerMoney( player, amount, SQLdata ) depositPlayerMoney( player, amount, SQLdata ) Most of the functions are documented in "server/bank.exported.funcs.lua". NOTE: Some of the functions have SQLdata parameter, this parameter is a table which should have 3 fields (tab, username, balance). This is optional param, if you won't use it, resource will use the data from meta.xml. More about it below. Settings in meta.xml When you open meta.xml you will see some setting nodes. These are mostly settings of SQL. useATM - if you want to use this ATMs this should be set to true (default = true) SQLTable - table name of where the money is saved into SQLUserNameField - the name of field where usernames are stored SQLMoneyField - what is the field where money are stored in Download: https://community.multitheftauto.com/index.php?p= ... ails&id=54 Installation: Place .zip file in your server's resources folder.
  17. You get a warning message, but what's that message?
  18. I said: If you create a marker, why do you create col shape if there is an event for markers already? You can use the code that szlend gives.
  19. You can create a table which will store each players' timer and then kill them when it's required. What you did was just create a timer when someone enters marker, the timer is killed, but the timer is only for one player and can be killed when you don't really want to. So, try a global table and store each player's timer in that table. eg: local timers = { } -- somewhere at the top of script ... -- replace old: timer = setTimer... with this: timers[ source ] = setTimer(blah, ...) ... -- and so killTimer killTimer( timers[ source ] )
  20. 50p

    HELP!!

    Yeah, you can create a help.xml and make it client-side. That way it will make a new tab in the F9 help window.
  21. hitElement is the marker that you hit/enter... use source. You can't give money to marker http://development.mtasa.com/index.php? ... rMarkerHit You can call "native" functions using timer. giveMoney's native, like all of the functions you can find on wiki. So there is no need of creating new function which calls 1 different function. It's not like PAWN where you must do it that way.
  22. Call giveMoney using timer. eg. timer = setTimer( giveMoney, 1000, 0, hitElement, 10 ). You shouldn't get errors using that.
  23. Use http://development.mtasa.com/index.php? ... rMarkerHit instead.
×
×
  • Create New...