
bandi94
Members-
Posts
1,037 -
Joined
-
Last visited
Everything posted by bandi94
-
when i make my autoteam i use only onPlayerJoin onPlayerLogin .... and i get bad argument's get Player Name account .. and that timer make a litel time after Login to don't get Bad argument's
-
teamAdmin = createTeam ( "Admin", 0, 255, 0 ) function addtoteam(player) if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Admin" ) ) then setPlayerTeam ( player,teamAdmin ) end end function addtoteamtimer() setTimer(addtoteam,3000,1,source) end addEventHandler("onPlayerLogin",getRootElement(),addtoteamtimer)
-
for guiCreateLabel use bool relative true and x,y 0-1 and then put in the right corner it will be +/- x =0 or 0.1 and y 0.8 or 0.9 test it that cordinates are +/-
-
if you got again this error attempt to get length of field '?' (a nil value) then the getElementData(....,"route") its nil (no data is stored or is sotred wrong) and for button's you wanna 2 butons if i pres the city then stores the city variable and .... use local citybutton = guiCreateButton(.......) "onClientGUIClick",citybutton,and the function name from city ariables
-
then use debugscript to find the error and fix it don't whait to some one test it for you bk we won't
-
nope only your script is full buged ( i tested my self only debugscript created team player added to team and done no team on scoreboard and so on .. and an autoeam don't need admin right's) and you don't change anything and i am just helping @Hunterix for the fastest solution for his problem
-
try this local route = math.random(1, #routes[getElementData(player,"route")] )
-
on client side ... i don't know in what line you need to add it on the button press function what trigger the server evet
-
if you mean the gui window then use guiSetVisible(theGui,true or false)
-
client local ussername =guiCreateEdit ( float x, float y, float width, float height, string text, bool relative, [element parent = nil] ) local pass = guiCreateEdit ( float x, float y, float width, float height, string text, bool relative, [element parent = nil] ) local button = guiCreateButton ( float x, float y, float width, float height, string text, bool relative, [ element parent = nil ] ) function login() local name = guiGetText(ussername) local password = guiGetText(pass) triggerServerEvent("login",getLocalPlayer(),name,password) end addEventHandler ( "onClientGUIClick", button, login ) server addEvent("login",true) function loginplayer(account,password) logIn (source, account, password) end addEventHandler("login",getRootElement(),loginplayer)
-
try to use this dat1 ={"1614.837","2052.229"} -- x cordinates for each location dat2 ={"-1301.275","1559.058"} -- y cordinates for each location dat3 ={} --- z cordinates for each one dat4 ={} -- and so on dat5 ={} dat6 ={} dat7 ={} dat8 ={} and then local rand = math.random(1, #dat1) and then setCameraMatrix(dat1[rand],dat2[rand],dat3[rand],dat4[rand],dat5[rand],dat6[rand], dat7[rand], dat8[rand])
-
yes the best way is that if is possible use a litel server side part i make a online radio gui .... and to other's can't use it very easy the radio name , links list and other stuf's are stored on server side and when the player join to the server the client side script ask from the server the list ... and the client side script is complied whit LuaComplierENG then if somebody wanna use my gui he need to decomplie it and find out how the server send the data's
-
Detect account data in LOGED OUT accounts. Help!
bandi94 replied to Headshot4Fun's topic in Scripting
this is wrong for i,v in getAccounts() do it need to be for i,v in pairs(getAccounts()) do and getPlayerData is not a function that need to getAccountData(v,"char.none") and on tabel insert you instert whit v the account now i don't know if you wanna insert the account or the account data and if the "nome" is not a local nome = ... the need to be "nome" not nome function checarConta(nome) local resultado = {} for i,v in pairs (getAccounts()) do if getAccountData(v,"char.nome") == nome then table.insert(resultado,v) return else end end if resultado[1] then -- Fail elseif not resultado[1] then -- Win! end end addEventHandler ( "checarConta", getRootElement ( ), checarConta) -
guiCreateWindow guiCreateMemo guiMemoSetReadOnly guiCreateButton showCursor guiSetVisible "onClientGUIClick"
-
the solution is my autoteam downlaod it from here : https://community.multitheftauto.com/ind ... ls&id=2833
-
i already change the corinates just copy paste my code again
-
oh sorry i change the x,y,z to test it copy and paste again i put back your coridnates
-
tested and working local vehicle1 =createVehicle ( 520, 302.74, 1818.85, 17.64) ArmyVehicles ={[vehicle1]=true} ArmyTeam = { ["Army"]=true } function ArmyenterVehicle ( player, seat, jacked ) local team = getPlayerTeam(player) if ( ArmyVehicles[source] ) and ( not ArmyTeam[getTeamName ( team )] ) then cancelEvent() outputChatBox ( "You aren't an Army Member , you mayn't drive this.", player ) --and tell the player why end end addEventHandler ( "onVehicleStartEnter", getRootElement(), ArmyenterVehicle )
-
yes i was modifing the code in the same time whit you ... but you press submint some sec faster
-
kimmis9 you'r function name is " ArmyenterVehicle" and on addEventHandler is " copenterVehicle" and in exchange of removePedFromVehicle use cancelEvent() ArmyVehicles = createVehicle ( 520, 302.74, 1818.85, 17.64) ArmyTeam = { ["Army"]=true } function ArmyenterVehicle ( player, seat, jacked ) local team = getPlayerTeam(player) if ( ArmyVehicles[getElementModel ( source )] ) and ( not ArmyTeam[getTeamName ( team )] ) and ( seat == 0 ) then cancelEvent() outputChatBox ( "You aren't an Army Member , you mayn't drive this.", player ) --and tell the player why end end addEventHandler ( "onVehicleStartEnter", getRootElement(), ArmyenterVehicle )
-
local root = getRootElement() addEventHandler("onPlayerWasted", root, function (ammo, killer, weapon, bodypart) local r, g, b = getColorFromString(string.upper(get("color"))) local message if killer then if killer ~= source then local killerType = getElementType(killer) if killerType == "player" then message = getPlayerName(killer).." killed "..getPlayerName(source).."." elseif killerType == "vehicle" then message = getPlayerName(getVehicleController(killer)).." killed "..getPlayerName(source).."." if get("show_vehiclename") then message = message .. " ("..getVehicleName(killer)..")" end end else message = getPlayerName(source).." committed suicide." end else message = getPlayerName(source).." died." end if weapon and get("show_weapon") then local weaponName = getWeaponNameFromID(weapon) if weaponName then message = message.." ("..weaponName..")" end end if bodypart and get("show_bodypart") then local bodypartName = getBodyPartName(bodypart) if bodypartName then message = message.." ("..getBodyPartName(bodypart)..")" end end outputChatBox(message, root, r, g, b,true) end )
-
You welcome.
-
copy paste again i make some change's
-
copy paste again the code i edit it
-
try this local teamAdmin local teamPlayers function createTeamsOnStart () teamAdmin = createTeam ( "Admins", 0, 255, 0 ) --change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB teamPlayers = createTeam ( "Players", 200, 0, 100 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) --we attach the function to this resource's root element function setteam(player) local account = getPlayerAccount(player) if not account or isGuestAccount(account) then setPlayerTeam ( player, teamPlayers ) return end local accName = getAccountName ( account) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then setPlayerTeam ( player, teamAdmin) else setPlayerTeam ( player, teamPlayers ) end end function timer() setTimer(setteam,3000,1,source) end addEventHandler("onPlayerLogin",getRootElement(),timer) addEventHandler("onPlayerJoin",getRootElement(),timer)