-
Posts
1,058 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Saml1er
-
You can do this with meta methods ( __index and _newindex) Check ixjf post. viewtopic.php?f=91&t=80425 If you use that code then when ever you get the length of table using # it will return __n and if you see carefully you will find another table __data where all of your data is kept. For more metatable events: http://lua-users.org/wiki/MetatableEvents
-
Fazool topic.
-
You added the command handler first that's why. Even this will work: addCommandHandler ("jop", givePedJetPack) But anyway just for mire explanation. This will work although it's pretty useless for using wrapper. local _givePedJetPack = givePedJetPack -- copy the function local function givePedJetPack (TheP) -- overwrite it local p = _givePedJetPack ( TheP ) -- call the function we copied if p then -- True or no outputChatBox ("You got a Jet Pack", TheP, 0, 255, 0) -- if true then... return p -- don't forget to return it can cause problems if you're loading scripts using loadstring("return CODE")() end end
-
Is ne arguement sahi istimal kiya ta isliye overwrite kerke wo kaam ker raha tha. Proper method: _getPlayerName = getPlayerName -- copy the function local function getPlayerName (...) -- overwrite it local p = _getPlayerName ( ...) -- call the function we copied if p then -- True or no -- if true then... return p -- don't forget to return it can cause problems if you're loading scripts using loadstring("return CODE")() end end Anyway don't overwrite functions for such small things. This can can cause problems if you're calling the same function fir different script within same script.
-
Yes I tried with that too and still the same problem. Can you show me the code where you used this function?
-
You can check map extension script https://wiki.multitheftauto.com/wiki/En ... ODDistance
-
Good Job. Go to wiki and learn about elements and see what they do and how you should use them when calling functiond. This will help you in many functions like getPlayerName, getPlayerAccount etc.. And read wiki carefully.
-
If u still plan on using this then just make variables and functions local, this will at least speed up accessing variables which make the code to work faster.
-
Account data and element data are different. Element data: It is temporary and uses a lot of cpu so use it in extreme necessary. Account data: This is stored in database and it's better than element data. function callCar(player,_,car) local car = tonumber (car) local playeraccount = getPlayerAccount(player) if ( playeraccount ) then if car then setAccountData(playeraccount,"car",car) else local playercar = getAccountData ( playeraccount, "car" ) local x,y,z = getElementPosition(player) local car = createVehicle (playercar, x, y, z+3) spawnVehicle (car,x,y,z+3) end end end addCommandHandler("car", callCar) Usage: To set a new car id then: /car id Example: /car 411 To spawn your car: /car
-
I'll create a video tomorrow.
-
local sf = createRadarArea (...) setElementData (sf, "zombieProof", true) Zombie proof works with radar ^^
-
Aah, it's a basic thing. You just need to learn "How to google?". Anyway I'll help you for free. What do you want exactly?
-
Agar aap scripting ya modding mein koi question hain toh main aap ka help kersakta hoon. New topic banaye aur aapna problem post karay.
-
Since createWeapon returns an element then how can you set it's property? I mean first arguement of setWeaponProperty must be int/string. Does wiki example has a typo?
-
Why don't you set the element data sync to false otherwise this element data will be synced with server side which is not needed? setElementData(element,string,value,false) Edit: or the element data doesn't exist server side because the element is client side?
-
@Evil: Never trust anyone until you really know them.
-
- New skins - some new effects when shooting at zombies. createEffect - cool hud - zombie boss ( the most interesting thing about a zombie server ) - teams for player. Each team will have some zombies and these zombies and players will attack opposite team players and zombies. 3-4 teams would be good. If you're a lazy mapper then make 3 teams. THE BEST PART Make maps and each map has three base where players need to attack opposite team. P.S Those are my ideas and I've a plan for a zombie server in future. If you want we can work together else good luck if you can do this all by yourself
-
Where is shops defined in server side? shops = ? Also try /debugscript 3
-
Credits? Wiki open source hain. Waha per koi specific author mention nahi huva hain khair.. Aur isne yeh toh nahi kaha ke meine khud banaya hain. Iss ne sirf copy paste kiya thake iss ki help kare pata nahi iss pe ladne ki konsi baat hain.
-
SAES rvb ( saesrpg.net ) DDC ( fotl-clan.ru ) Old GMC ( sw-team.net )
-
[TUT] MTA Local Server Kese Banate Hain. (Detailed)
Saml1er replied to Bilal135's topic in Urdu / اُردُو
Nice. (y) -
Bohat zabar dast aur dumba ko zaba kiya tha