-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
try this, addEventHandler("onPlayerWasted", getRootElement(), function(ammo, killer) if getElementType(killer) == "player" then outputChatBox(getPlayerName(killer).." has just killed you!", source, 0, 255, 0) end end )
-
hey, i've got a problem with a script of account data dunno why it keeps saying bad argument at triggerClientEvent and all seems fine, here is a piece of my code, function onLoginStuff() local acc = getPlayerAccount ( source ) local zombieKills = getAccountData(acc, "zombieKills") if (tonumber(getAccountData (acc,"level")) == 1) then killsTimer = setTimer (function ( ) local killsData = getAccountData(acc,"zombieKills") triggerClientEvent(source,"updateKills",source,killsData,100) end,1000,0) elseif (tonumber(getAccountData (acc,"level")) == 2) then killsTimer = setTimer (function ( ) local killsData = getAccountData(acc,"zombieKills") triggerClientEvent(source,"updateKills",source,killsData,200) end,1000,0) end end addEventHandler( "onPlayerLogin", getRootElement(), onLoginStuff)
-
this is stolen do you understand me ?? i remade the GUI but now MTA crash i will not stole it .. he said Please post the server side part, since its already on community there is no problem of post it right?
-
please don't steal my credits this userpanel its made by me (Castillo), i really hate those who steal the credits.
-
use [lua][/lua] tags please, it makes the code more redeable.
-
why you don't use onClientRender since the script its client side, player = getLocalPlayer() x,y,z = getElementPosition (player) function updateCamera () x,y,z = getElementPosition (player) setPedAimTarget (player,x,y+100,z) rx,ry,rz = getPedTargetEnd (player) setPedAimTarget (player,rx,ry+100,rz+0.7) setCameraMatrix (x+0.5,y-0.5,z+0.7,rx-0.1,ry,z+0.4) end addEventHandler("onClientRender",getRootElement(),updateCamera) for me i think its much better
-
well i guess if you wanted to make the HUD like GTA IV you must make it by yourself
-
hi, i've got a problem making a cool nemesis, i made it and imported his txd,dff files into a object and attached it to a ped i created but my problem is, how i can make the ped move around and this way nemesis object will move with him also, if someone can tell me i will appreciate it, Tanks in advance.
-
that won't work if i'm right, i've made a fully race userpanel for a friend and added that also, here is the code function hunterAlert(mapInfo, pickupID, pickupType, vehicleModel) info = mapInfo.modename if info == "Destruction derby" then if pickupType == "vehiclechange" then if vehicleModel == 425 then outputChatBox("HUNTER ALERT: "..getPlayerName(source).." has a hunter!",getRootElement(),25,125,225) end end end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),hunterAlert)
-
maybe would be better you to use a guiLabel, dunno its easier to use it
-
this should do the job, spawnmenu = guiCreateWindow(573,383,220,213,"Spawn Menu",false) spawnmenugrid = guiCreateGridList(0.1273,0.1174,0.7545,0.6677,true,spawnmenu) guiGridListSetSelectionMode(spawnmenugrid,2) guiGridListAddColumn(spawnmenugrid,"Spawn Team",0.9) spawnmenubutton = guiCreateButton(0.1636,0.7887,0.7136,0.1174,"Spawn",true,spawnmenu) spawnmenumemo = guiCreateMemo(187,484,362,99,"",false) guiSetText ( spawnmenumemo, "Pick a team!!" ) guiMemoSetCaretIndex(spawnmenumemo,true) showCursor ( true ) spawnteams= {{"Mechanics"},{"Taxi"},{"Police"},{"Hippie"},{"Limo Driver"},{"Medic"},{"Maffia"},{"Truckers"}} for i,v in ipairs (spawnteams) do local row = guiGridListAddRow (spawnmenugrid) guiGridListSetItemText (spawnmenugrid, row, 1, v[1], false, true) guiGridListSetItemText (spawnmenugrid, row, 2, v[2], false, true) end function guiClick (button, state, absoluteX, absoluteY) if (source == spawnmenubutton) then if not (guiGridListGetSelectedItem (spawnmenugrid) == false) then local row,col = guiGridListGetSelectedItem (spawnmenugrid) local spawnteamname = guiGridListGetItemText (spawnmenugrid, row, 1) outputChatBox ( "." ..spawnteamname ) else outputChatBox ("First select your location please.", 255, 0, 0, true) end end end addEventHandler ("onClientGUIClick", getRootElement(), guiClick) function gridClick ( state, absoluteX, absoluteY) local campos = guiGridListGetItemText ( spawnmenugrid, guiGridListGetSelectedItem ( spawnmenugrid ), 1 ) if campos == "Hippie" then guiSetText ( spawnmenumemo, "baaaaaaarrrrskkkkkkk...") end if campos == "Police" then guiSetText ( spawnmenumemo, "Police will blablalbla") else outputChatBox ("...." ) end end addEventHandler ("onClientGUIClick", spawnmenugrid, gridClick)
-
seriusly, i don't know i ever use getRootElement()
-
when you are in-game do /debugscript 3 (first log in as admin of course)
-
Hmmm, i think this function its only client side and that would mean that won't work at server side script.
-
oh sorry, my bad i didn't saw it.
-
setVehicleGravity dosn't exist, check wiki again for gravity functions.
-
I need GM Role Play for MTA I recommend you to start learning at mta wiki and make it by yourself like all does.
-
this is not a requesting forum, here you can ask for help at troubles while you make scripts not ask for scripts. here are some links for you to start learning, https://wiki.multitheftauto.com/wiki/Scripting_Introduction https://wiki.multitheftauto.com/wiki/Introduction_to_Scripting_the_GUI
-
You could ever start to learn by yourself, its cool.
-
I guess this code is stealed cause he only posted the client side part and that uses server too if i'm right.
-
meta.xml: <meta> <script src="saveteam.lua" type="server" /> </meta> saveteam.lua: function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local playerTeam = getAccountData (theCurrentAccount, "team") setPlayerTeam(source,playerTeam) end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement,thePreviousAccount) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then local team = getPlayerTeam(source) local teamName = getTeamName(team) setAccountData (account, "team", teamName) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) this should work.
-
read again what he asked please, you are giving a resource that detects acl groups not save his team into his account.
