
Chlorek
Members-
Posts
131 -
Joined
-
Last visited
Everything posted by Chlorek
-
GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) guiSetVisible(GUIEditor_Window[1],false) GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) guiSetFont(GUIEditor_Label[1],"sa-header") GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) addEventHandler("onClientGUIClick",getRootElement(), function () if (source == GUIEditor_Button[13]) then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) end end) function show() showCursor(true) guiSetVisible(GUIEditor_Window[1], true) end bindKey("F5","down", show)
-
=====CL-Bank Script===== This script adds 13 banks (v1.0.0) in San Andreas. Each bank is visible as "$" sign and you can use it when you enter to red bank marker. Just type amount and press deposit or withdraw! Bank shows your bank balance and cash in hands. GUI is friendly and easy to use. It's little bank script but works very well! =====Adding a new bank===== Adding a new bank is very easy. You need to open banks.lua and at begin of the file put: local bank* = createMarker ( x, y, z, "cylinder", 1.5, 255, 0, 0, 170 ) local bankBlip* = createBlip ( x, y, z, 52, 2, 0, 0, 0, 255, 0, 15, getRootElement()) addEventHandler( "onMarkerHit", bank*, bankHit ) * - instead * put number of a new bank (in v1.0.0 are 13 banks so set 14 and upper) Script tested with MTA 1.0.4 version. All buggs and suggestions post in this topic please Download: https://community.multitheftauto.com/index.php?p=resources&s=details&id=2013 Comments: https://community.multitheftauto.com/index.php?p=resources&s=comments&id=2013
-
Proracer, this has nothing to do with "freeroam", this is a normal script. Yea.... LUA is LUA! But it's not important... we should help and don't talk about shit!
-
First thing, do you wanna take player money from his "bank account" or from his hands? Secound thing, your thinking isn't right... how did you say "I'm a total noob" if you wanna make any scripts you should know anything about LUA but if you wanna know how to do this script I'll tell you. You did mistake... you must use: function giveMeWeapon(weapon, amount) if weapon > 50 then return end if table.find(getOption('weapons.disallowed'), weapon) then errMsg((getWeaponNameFromID(weapon) or tostring(weapon)) .. 's are not allowed', source) else local playerMoney = getPlayerMoney(source) if(tonumber(weapon) == 28) then if(tonumber(playerMoney) >= 1000)then takePlayerMoney(source, 1000) giveWeapon(source, weapon, amount, true) else outputChatBox("You haven't enough money!", source, 255, 0, 0) end elseif(tonumber(weapon) == 22) then if(tonumber(playerMoney) >= 200)then takePlayerMoney(source, 200) giveWeapon(source, weapon, amount, true) else outputChatBox("You haven't enough money!", source, 255, 0, 0) end else giveWeapon(source, weapon, amount, true) end end end When you wanna add any other weapon you need to add only: elseif(tonumber(weapon) == 22) then if(tonumber(playerMoney) >= 200)then takePlayerMoney(source, 200) giveWeapon(source, weapon, amount, true) be4 last word "else"! That's everything!
-
It won't save it but Dayokun don't want to save money to account data if I understand his post right. But if he wanna using account data money saving it's not much to do.... Just: function giveMeWeapon(weapon, amount) if weapon > 50 then return end if table.find(getOption('weapons.disallowed'), weapon) then errMsg((getWeaponNameFromID(weapon) or tostring(weapon)) .. 's are not allowed', source) else local playerMoney = getAccountData(getPlayerAccount (source), "server-money") if(tonumber(weapon) == 28) then if(tonumber(playerMoney) >= 1000)then newCash = playerMoney-1000 setAccountData (getPlayerAccount (source), "server-money", newCash) giveWeapon(source, weapon, amount, true) else outputChatBox("You haven't enough money!", source, 255, 0, 0) end else giveWeapon(source, weapon, amount, true) end end end
-
You need edit freeroam script. Adding price="1000" isn't way bcuz scripts don't know what's value and how to use it! Easy example - if you want to add price to weapons you can use one thing without add prices to .xml file. Just open file fr_server.xml and look at 283 line. There is function: function giveMeWeapon(weapon, amount) if weapon > 50 then return end if table.find(getOption('weapons.disallowed'), weapon) then errMsg((getWeaponNameFromID(weapon) or tostring(weapon)) .. 's are not allowed', source) else giveWeapon(source, weapon, amount, true) end end And change it to: function giveMeWeapon(weapon, amount) if weapon > 50 then return end if table.find(getOption('weapons.disallowed'), weapon) then errMsg((getWeaponNameFromID(weapon) or tostring(weapon)) .. 's are not allowed', source) else local playerMoney = getPlayerMoney(source) if(tonumber(weapon) == 28) then if(tonumber(playerMoney) >= 1000)then takePlayerMoney(source, 1000) giveWeapon(source, weapon, amount, true) else outputChatBox("You haven't enough money!", source, 255, 0, 0) end else giveWeapon(source, weapon, amount, true) end end end This code (maybe I didn't test) add price for Uzi (ID is 28), price is 1000$. You can edit my code and add price for all weapons.
-
Ehm... I really don't understand you -,-
-
It's not difficult. Just you need to create function which check are you policeman (by team or any other value) and if you used correct weapon and attacked player is wanted then (check used weapon e.g. knife) set player (LUA knows player as element when you wanna set his position) position to prison and set correct interior. To do tht you need things like: setElementPosition onPlayerDamage maybe GetWeaponNameFromID OnPlayerWasted // to clear wanted level on player death GetWantedLevel
-
I know one way only - learn LUA! Nobody give you ready script to use (look on community)
-
I downloaded it but there aren't source files (eg .cpp .h). Can anybody give link to download, when I enter I wanna start downloading.
-
onClientClick i createPickup ... problem
Chlorek replied to Piorun's topic in Pomoc ze skryptami i programowaniem w Lua
Jak chcesz to pobierz moj pickup creator z community. Jest on prosty i mozesz sie z niego wiele nauczyc jesli chodzi o tworzenie pickup'ow i przesylanie zmiennych miedzy stroną klienta a server'a https://community.multitheftauto.com/index.php?p= ... ls&id=1874 A niebawem upload znacznie lepszej wersji! ;D -
Yo guys, so I am looking for MTA:SA client source but I found server source only. Can anybody give me link to GTA:SA client source?
-
Yeah, say us what's wrong - what doesnt working?
-
I'll add commands in next version. It'll be uploaded soon.
-
Pickup creator GUI for admins. To open GUI press 'o' but it's available for admins only! You can set 4 types of the pickup: - health - armor - weapon - money You can set position, model(for weapon it's weapon ID, for other types look of the pickup), cost(player who take must pay for pickup), amount(for money pickups only), ammo(for weapon pickups only). This pickup creator let you create one pickup per type in one time. I'll add more to next versions. Pickups aren't respawned. You can create by this creator e.g. health pickup with building, tree, bomb, etc. model! Download link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1874 If you found any buggs post it
-
I scripted Pickup Creator but I don't know how to set creator GUI for admins only. So how to create GUI for admins only. My GUI is opening by "O" key. Plz quickly help!
-
Yea, but he can add one thing to block selecting wrong ID. Just if e.g. ID 199 is valid he can set if(tonumber(skin) == 199) then skin = math.random(0,200) end Then if skin ID is 199 it'll be generated again p.s. the code is example and in IDs 0-200 isn't many valid.
-
O yeah, thanks Citizen. First code: "setPedControlState(theBot, forwards, false)" doesn't work. But secound works very well.
-
If I right understand you wanna add timer but it doesn't work... Try use addEventHandler("onPlayerWasted", getRootElement(), function () local x, y, z = getElementPosition(source) local skin = math.random(0, 200) setTimer(spawnPlayer, 5000, 1, source, x, y, z, 0, skin) end ) I am not great scripter so if not work set line "setTimer(spawnPlayer, 5000, 1, source, x, y, z, 0, skin)" to setTimer(spawnPlayer, 5000, 1, source, x, y, z, 0, tonumber(skin))
-
So, I am scripting bot creator and commands for him. I have problem becouse when I type /moveforward, ped don't move. My script code: function createBot() local thePlayer = getLocalPlayer() local x, y, z = getElementPosition(thePlayer) x = x + 1 y = y + 1 local destroyOldBot = getElementData(thePlayer, "botData") destroyElement(destroyOldBot) local pedBot = createPed(125, x, y, z) setElementData(thePlayer, "botData", pedBot) end addCommandHandler ( "createbot",createBot ) addCommandHandler ( "cb",createBot ) function onFootForward() local thisPlayer = getLocalPlayer() outputChatBox("Bot is moving forward!", thisPlayer, 255, 255, 0) local theBot = getElementData(thisPlayer, "botData") setPedControlState(theBot, forwards, false) end addCommandHandler ( "moveforward",onFootForward ) addCommandHandler ( "mf",onFootForward )
-
Hey, I can't find on wiki how to spawn player in car. So if anybody give me an example or link to the topic on wiki I'll be happy
-
I try to find on wiki how to spawn player in car but I can't find that. So I ask on forum. Anybody know how to spawn player in car? Any example or link to wiki?
-
If you can create marker add onMarkerHit handler and in this function add setElementPosition or setElementInterior. On marker hit https://wiki.multitheftauto.com/wiki/OnMarkerHit Set element position https://wiki.multitheftauto.com/wiki/SetElementPosition
-
Really good script. I found few little bugs but it's ok.