-
Posts
563 -
Joined
-
Last visited
Everything posted by Perfect
-
That's because you are trying concatenate number with a string. In which case you should do this: guiGridListSetItemText (sevenShopList, row, 3, tostring(v[3]).."$" , false, false) And for your another problem. Try replacing local weapPrice = Weapons[guiGridListGetSelectedItem (grid)][3] with local weapPrice = Weapons[guiGridListGetSelectedItem (grid) + 1][3]
-
Got you there Robhol but the thing is we can modify the 'game X' with MTA ultra magic wand, which will turn 'game X' into 'Ultra game X'. But you are right on there, unique games will bring more players and charms the atmosphere. On the other hand, doing clones of 'game X' in MTA will not just only enhance the skills of the developer/scripter(whatever you prefer to call him/her) but also shows the capability of MTA which can create clones of other games in it. Thus, making it superior among others. BTW, nice to see you again.
-
If I am right, anything after the 'return' will not execute. In your script, banPlayer function was after the 'return' which made it unable to execute. I also have indented your code which will make it easier to read. function ban(p,_,player) local accName = getAccountName(getPlayerAccount(p)) if not isObjectInACLGroup("user."..accName,aclGetGroup'Admin') then return outputChatBox("Error: You are not an Admin.",p,255,0,0) end if not player then return outputChatBox("Error: usage /ban ",p,255,0,0) end local table = getPlayerWildcard(player) if #table == 0 then return outputChatBox ( "Error: '"..player.."' matches no players.",p,255,0,0) end if #table == 1 then outputChatBox ( removeColor( getPlayerName( table[1] ) ).." has been banned by "..removeColor(getPlayerName(p)),root,255,0,0) banPlayer(player,false,false,true,p) end outputChatBox("Error: '"..player.."' matches "..#table.." players.",p,255,0,0) end addCommandHandler("ban",ban) function removeColor(string) return string.gsub(string,"#%x%x%x%x%x%x","") end function getPlayerWildcard ( string ) local player = getPlayerFromName ( string ) if ( player ) then return player end local matches = {} for id, player in ipairs ( getElementsByType ( "player" ) ) do if ( string.find ( string.upper ( getPlayerName ( player ) ), string.upper ( string ), 1, true ) ) then table.insert(matches,player) end end return #matches end
-
We don't know if you are telling a lie or a truth. Patience is the key, my friend.
-
Impossible in MTA? Nah, never, at least for such things. Here you go: https://wiki.multitheftauto.com/wiki/Se ... ePlateText
-
As GTX stated, we don't know what is the problem. I fix what I think was wrong. Try this one as well. function ban(p,_,player) local accName = getAccountName(getPlayerAccount(p)) if not isObjectInACLGroup("user."..accName,aclGetGroup'Admin') then return outputChatBox("Error: You are not an Admin.",p,255,0,0) end if not player then return outputChatBox("Error: usage /ban ",p,255,0,0) end local table = getPlayerWildcard(player) if #table == 0 then return outputChatBox ( "Error: '"..player.."' matches no players.",p,255,0,0) end if #table == 1 then return outputChatBox ( removeColor( getPlayerName( table[1] ) ).." has been banned by "..removeColor(getPlayerName(p)),root,255,0,0) banPlayer(player,false,false,true,p) end outputChatBox("Error: '"..player.."' matches "..#table.." players.",p,255,0,0) end addCommandHandler("ban",ban) function removeColor(string) return string.gsub(string,"#%x%x%x%x%x%x","") end function getPlayerWildcard ( string ) local player = getPlayerFromName ( string ) if ( player ) then return player end local matches = {} for id, player in ipairs ( getElementsByType ( "player" ) ) do if ( string.find ( string.upper ( getPlayerName ( player ) ), string.upper ( string ), 1, true ) ) then table.insert(matches,player) end end return #matches end
-
Post your current script. It is my advice to you, ask help in your respective language. There it may have a higher possibility of getting solved.
-
Does this happen in just a single server or multiple ones?
-
Try changing your resource name to something simpler like "simplescript" if you didn't already.
-
I think I got you. Try this: function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end function createVeh(player, commandName, model) local px, py, z = getElementPosition(player) local x,y = getPointFromDistanceRotation(px, py, 5, 90) local rx, ry, rz = getElementRotation(player) local createdVehicle = createVehicle(model, x, y, z, rx, ry, rz) if (createdVehicle == false) then outputChatBox("Error") end end addCommandHandler("veh", createVeh
-
I am doubting that too. I didn't check it, but let's see. By chance, it's just a map then you can make what you want using the following functions. Events:- onClientVehicleCollision -- To check if a vehicle collides with a ball. Functions:- getElementType -- Too check if the collided element is a ball getElementVelosity -- To get the velocity of vehicle and change the velocity of ball according to it setElementVelocity -- Too change the velocity of the ball and maybe vehicle if you want.
-
You can use: setWeaponProperty If that doesn't work, you can use these functions. getPedWeapon setGlitchEnabled setTimer
-
You don't need to add a function statement for function inside a timer and also you don't need to add even parenthesis of a function inside a timer. If the function has arguments then you can declare them later. @ You are assigning an argument to an argumentless function. function checkLocation() setTimer(theLocator(source), 0, 0) -- There are no arguments in theLocator end This should probably work: setTimer(theLocator, 0, 0)
-
Try replacing 'root' with 'GUIEditor_Button[112]' inside the event 'onClientGuiClick' in client side. And also is there any errors in debugscript.
-
I am assuming you want a command to work on specific location. In that case, the following will do the job. function restrictedCommand(thePlayer) if getElementZoneName (thePlayer) == "YourZoneName" then -- do your stuff end end addCommandHandler("YourCommand", restrictedCommand)
-
setPlayerSkin takes two arguments, first is the player and second is the skin id. And also to note, setPlayerSkin is an old function and may not be used in currently or in future versions of MTA and has been replace by setElementModel which takes same arguments as setPlayerSkin. Skin = {} function spawnskin(mid) if ( Skin[source] ) then setElementModel(source,tonumber(mid)) end end addEvent("spawnskin",true) addEventHandler("spawnakin",root,spawnskin)
-
Is this what you want ? c = { {"Los Santos"}, {"Las Venture"} } t = { {"Squads",0,0,150,"Los Santos"}, {"Gangs",150,0,0,"Las Venture"} } s = { {"F.B.I HQ",133.933,-85.56,1.45,"270","1,20",0,255,0,"Everyone","23.25","information22","Squads"}, {"B-Crew",133.933,-85.56,1.45,"270","1,20",0,255,0,"Everyone","23.25","information23","Squads"} } gridct = {} gridts = {} for i=1,#c do for i1, v1 in ipairs(c[i]) do for i2,v2 in ipairs(t[i]) do if v1 == v2 then table.insert(gridct, v1) end end end end for i=1,#t do for i1, v1 in ipairs(t[i]) do for i2,v2 in ipairs(s[i]) do if v1 == v2 then table.insert(gridts, v1) end end end end Now: gridct = { "Los Santos", "Los Venture"} gridts = { "Squads",0,0,0,0,0,0,0} And also its pretty useless to put a table inside the 'c' table as it has only single value , unless you are planning to put more values later.
-
The event 'onClientMarkerHit' have two arguments, first one is hitElement and the second is matchingDimension. You can use getElementDimension to get player current dimension. You can do a simple if statement between getElementDimension and matchingDimension to make gui-window open only when a player is in specific dimension.
-
Don't know if you still need help with it, But here you go: function rejestrujemy(username, password) litery = {"a", "b", "c"} local istnienieLoad = exports.DB2:pobierzWyniki("SELECT * FROM ACCS WHERE acc=?", username) if istnienieLoad == nil then for i=1, #username do local toprint = username:sub(i, i) if toprint == litery[i] then outputChatBox(toprint) else (...)
-
Yeah, it is possible. Use the function which GTX has posted. addPedClothes
-
@Raysmta, he may have misunderstood your question at first place. You should at least give him some respect for trying to help you. And about your question, you may use: setTimer getTimerDetails guiCreateLabel Set a timer using setTimer then get remaining time using getTimerDetails and then put that remaining time inside the guiCreateLabel function. Read about those function in the wiki and you will be done. Hint: timeRemaining, executesRemaining, totalExecutes = getTimerDetails(theTimer) -- Get the timers details
-
You have to use shaders to change the face of CJ or any other ped. Wiki has a good example for it, it may be what you want. Here's the link: https://wiki.multitheftauto.com/wiki/Sh ... #Ped_morph On there, You can find plenty of other useful shaders too.