Jump to content

Citizen

Moderators
  • Posts

    1,803
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Citizen

  1. Then show us what you tied ...
  2. Are you serious ?? It's not a problem since it was coded this way ... It's really simple to do that, just use your brain seriously. You have to do a simple: if someVar == someValue then --show the gui (code I gave you) -- update someVar else --hide the gui (do the reverse of the code I gave you) -- update someVar end If you can't do it, then you will have to go back on the wiki to learn the basics (again ?)
  3. Like this ? addEventHandler("onClientResourceStart", resourceRoot, function () buton1 = guiCreateButton(520, 192, 64, 28, "", false) buton2 = guiCreateButton(480, 383, 84, 40, "", false) buton3 = guiCreateButton(348, 383, 84, 40, "", false) buton4 = guiCreateButton(480, 433, 84, 40, "", false) buton5 = guiCreateButton(348, 433, 84, 40, "", false) buton6 = guiCreateEdit(328, 220, 250, 158, "", false) guiSetVisible(buton1, false) guiSetVisible(buton2, false) guiSetVisible(buton3, false) guiSetVisible(buton4, false) guiSetVisible(buton5, false) guiSetVisible(buton6, false) end ) function drawPanel() dxDrawRectangle(313, 166, 276, 343, tocolor(0, 0, 1, 122), false) dxDrawRectangle(313, 166, 276, 22, tocolor(0, 0, 209, 237), false) dxDrawText("HELP PALNEL", 344, 170, 598, 184, tocolor(255, 255, 255, 255), 0.40, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("helpmanager", 315, 489, 446, 503, tocolor(0, 60, 88, 237), 0.50, "bankgothic", "left", "top", false, false, true, false, false) end function showPanel() guiSetVisible(buton1, true) guiSetVisible(buton2, true) guiSetVisible(buton3, true) guiSetVisible(buton4, true) guiSetVisible(buton5, true) guiSetVisible(buton6, true) addEventHandler("onClientRender", root, drawPanel) end addCommandHandler("panel", showPanel)
  4. We aren't talking on a phone ... please write a complete sentence with more details of what you want to do and what's the problem.
  5. Even without collision you still be able to get damages ?? Ok then, hummm just use cancelEvent for the onClientPlayerDamage event with conditions you will define.
  6. Citizen

    Help

    Oh yeah my bad, I forgot the 3rd line. function doTask(thePlayer, cmd, taskId, playername, arg3, arg4) if taskId then local taskId = tonumber(taskId) --forgot this line local player = getPlayerFromName(playername or "") if player then if taskId == 1 then local duration = (tonumber(arg3) or 0) * 60 * 1000 setPlayerMuted(player, true) outputChatBox("You have been muted for "..tostring(arg3).." mins.", player) setTimer( function() setPlayerMuted(player, true) outputChatBox("You have been unmuted.", player) end, duration, 1, player ) elseif taskId == 2 then local reason = tostring(arg3) kickPlayer(player, theClient, reason) elseif taskId == 3 then local duration = (tonumber(arg3) or 0) * 60 local reason = tostring(arg4) banPlayer(player, true, true, true, thePlayer, reason, duration) else -- wrong taskId end else --player not found end else --no taskId given end end addCommandHandler("task", doTask)
  7. Ah yeah sorry, I could guess if I knew that functions (Never used them so ^^)
  8. Hello, Stop shopping in the MTA Forum. Here is your new favorite part of the mta community: https://wiki.multitheftauto.com/wiki/Main_Page
  9. For the first one, try this: local MAX_CHAR_PER_LINE = 40 --define the max amount of letters per line function chatMessageSplitter(message, messageType, isMine) -- we will only send normal chat messages, action and team types will be ignored if messageType ~= 0 or not isMine then return end cancelEvent() --block the default behavior of chat system --doing our own below local nbChars = string.len(message) for k=1, nbChars, MAX_CHAR_PER_LINE do local line = string.sub(message, k, k+MAX_CHAR_PER_LINE-1) triggerEvent("onPlayerChat", source, message messageType, true) end end addEventHandler("onPlayerChat", root, chatMessageSplitter) Didn't tested yet, because I need to go out soon. For the second question, what do you mean by interior ? Inside a building for example ? or the mta interior (in the code) ?
  10. Then none of the collisions can be turned off, I don't even understand how the collisions are turned off after a restart ...
  11. No need to be a pro scripter to say you should use a table. Btw to answer your question, you can use loadstring. But it needs a lot of computer/server resources (relativly with a code which would use tables): for i = 1, #returnTable do loadstring("guiSetText(num"..i..", returnTable[i][1])")() loadstring("guiSetText(acc"..i..", returnTable[i][2])")() loadstring("guiSetText(top"..i..", returnTable[i][3])")() end
  12. As far I know, you only can explicitly disable the collisions from the script. You just shown us your map file. (I finally understood you want to turn off the collisions for some objects and it only works when you restart the resource. If you just connect, the collisions are still on for that same objects.)
  13. Citizen

    Help

    I did a mistake that Solidsnake fixed but no one saw that (even me till now ) replace: function doTask(thePlayer, taskId, playername, arg3, arg4) by this: function doTask(thePlayer, cmd, taskId, playername, arg3, arg4) Final code: function doTask(thePlayer, cmd, taskId, playername, arg3, arg4) if taskId then local player = getPlayerFromName(playername or "") if player then if taskId == 1 then local duration = (tonumber(arg3) or 0) * 60 * 1000 setPlayerMuted(player, true) outputChatBox("You have been muted for "..tostring(arg3).." mins.", player) setTimer( function() setPlayerMuted(player, true) outputChatBox("You have been unmuted.", player) end, duration, 1, player ) elseif taskId == 2 then local reason = tostring(arg3) kickPlayer(player, theClient, reason) elseif taskId == 3 then local duration = (tonumber(arg3) or 0) * 60 local reason = tostring(arg4) banPlayer(player, true, true, true, thePlayer, reason, duration) else -- wrong taskId end else --player not found end else --no taskId given end end addCommandHandler("task", doTask)
  14. It does work, the problem is when I start the script i'm not in a team so it gives the error can I prevent it to check if I'm in the team Police when my team is empty Just change this: if getTeamName(police) == "Police" then into this: if police and getTeamName(police) == "Police" then It won't evaluate getTeamName(police) if police is equal to false (means he is not in a team yet).
  15. Check this section from the Lua Reference Manual: http://www.lua.org/manual/5.1/manual.html#5.4.1 So you basically want to escape the brackets using % if string.find ( Nick,"%[VIP%]" ) then
  16. Your problem is still not clear at all. That's why no one can suggest fixes. We just understood there are problems with collisions but that's not enough.
  17. Maybe 'cuz those functions doesn't even exist ? Please explain better or use the correct words / function names
  18. Citizen

    Button.

    Please use at least google translate.
  19. For me, this: For me it means that he wants to spawn a ped with the skin id 240 when he writes /ped 1 etc. Of course he can add other skins to the list.
  20. This ? (server-script) local skinList = { 240, -- 1 217 -- 2 } function pedCreated(thePlayer, cmd, skinNumber) local x, y, z = getElementPosition(thePlayer) local thePed = createPed(skinList[tonumber(skinNumber)] or 0, x, y + 5, z) end addCommandHandler("ped", pedCreated)
  21. By leaving the server, it forces him to logout ...
  22. Citizen

    gamemode help

    Never give up before you really start ! I was just like you five years ago but I wanted to learn. So I read the wiki and did all the exemples in it. Then I tried to modify them to add so basic stuff. I started by creating a command to create a vehicle and now I can write a whole gamemode from A to Z. You can't just come here and says: "Hey ! I will write an entire gamemode !". That's not how it works. Take 2 weeks or more to do the "Scripting" block on the Main Page of the wiki (the first block on the write) and I swear you will do it by your own. Obviously we can help you here if you are getting stuck with your code. Best regards, Citizen
  23. Citizen

    Help

    It's already done, now you have to use the right function to kick ban and mute. Then ingame you will do /task 1 Nikolai96 5 to mute Nikolai96 for five minutes. You will need: setPlayerMuted --to mute or unmute the guy setTimer --to call setPlayerMuted to unmute the guy kickPlayer --to kick the guy banPlayer --to ban the guy --and a little of maths: myvar*60*1000 --minutes to milliseconds for the setTimer myvar*60 --minutes to seconds (for the ban function)
  24. Citizen

    Help

    Something like this ? function doTask(taskId, playername, arg3, arg4) if taskId then local player = getPlayerFromName(playername or "") if player then if taskId == 1 then --mute using ar3 for duration elseif taskId == 2 then --kick using arg3 for reason elseif taskId == 3 then --ban using arg3 for reason and arg4 for duration else -- wrong taskId end else --player not found end else --no taskId given end end
×
×
  • Create New...