Jump to content

Alpha

Members
  • Posts

    244
  • Joined

  • Last visited

Everything posted by Alpha

  1. I meant clientside getPlayerMoney can only get the money of the localPlayer, while serverside can get any player's money.
  2. I think it's the function itself, might not be working correctly.
  3. I forgot, clientside getPlayerMoney can only get the money of the localPlayer. https://wiki.multitheftauto.com/wiki/GetPlayerMoney
  4. You have to loop through all players, and add a row for each player with his name: for index, cPlayer in pairs(getElementsByType( "player" )) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText ( GUIEditor_Grid[1], row, money_TAB, tostring(getPlayerMoney( cPlayer )), false, false ) end
  5. The problem is, you're calling the function as soon as the script starts, and the script starts from up all the way down. So it first meats your call to the function guiCreateColorLabel, while you haven't even defined it yet. So you have to put the call for the function below the function declaring. function guiCreateColorLabel( ax, ay, bx, by,str, bool, parent ) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find( pat, 1 ) local last = 1 local r,g,b while s do if cap == "" and col then r,g,b = tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth( cap ) avc321 = guiCreateLabel( ax, ay, ax + w, by,cap,bool,parent ) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end guiLabelSetColor( avc321,r,g,b ) ax = ax + w r,g,b = tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if last <= #str then local cap = str:sub( last ) local w = dxGetTextWidth( cap ) local avc123 = guiCreateLabel( ax, ay, ax + w, by,cap,bool,parent ) guiLabelSetColor( avc123,r or 255,g or 255,b or 255 ) return avc123 end end guiCreateColorLabel(0.1494,0.383,0.4689,0.0638,"#FFFFFFTime in #FF0000London",true,zeit_Window)
  6. That's the point of the custom function.
  7. Do you know hex color codes? guiCreateColorLabel( 0.6639,0.383,0.1826,0.0638,"#FFFFFFTime in #FF0000London",true,zeit_Window)
  8. How come cPlayer is all players? Is it a table containing players?
  9. But don't change the function name itself. Example: --You use the function like this: guiCreateColorLabel( 0.6639,0.383,0.1826,0.0638,"",true,zeit_Window) --but define the function as it is: function guiCreateColorLabel( ax, ay, bx, by,str, bool, parent ) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find( pat, 1 ) local last = 1 local r,g,b while s do if cap == "" and col then r,g,b = tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth( cap ) avc321 = guiCreateLabel( ax, ay, ax + w, by,cap,bool,parent ) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end guiLabelSetColor( avc321,r,g,b ) ax = ax + w r,g,b = tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if last <= #str then local cap = str:sub( last ) local w = dxGetTextWidth( cap ) local avc123 = guiCreateLabel( ax, ay, ax + w, by,cap,bool,parent ) guiLabelSetColor( avc123,r or 255,g or 255,b or 255 ) return avc123 end end
  10. You don't need to understand it, you can simply use that code.
  11. hours = hours + 8 if hours > 24 then hours = hours - 24 end guiSetText(uhrzeitText5, ""..(hours)..":"..minutes.."")
  12. I disagree, I don't see the point of this, if a player wants to use his own custom model, he can manually replace it.
  13. racemarker = createMarker(192,182,13,"cylinder",20,0,255,0,100) function start(hitElement) if not isPedInVehicle(hitElement) then return end local vehicle = getPedOccupiedVehicle(hitElement) setElementFrozen(vehicle,true) triggerClientEvent(hitElement,"startcountdown",hitElement) setTimer(setElementFrozen,10000,1,vehicle,false) end addEventHandler("onMarkerHit",racemarker,start)
  14. In that code, you loop through all vehicles, and you freeze them all. Post your code where you handled the event onMarkerHit.
  15. Our MTA is just fine as it is. You can already use functions provided by MTA to import TXD and replace models.
  16. for index, player in pairs(getElementsByType("player")) do local row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, row, 1, getPlayerName(player), false, false) end
  17. He meant adding new objects/vehicles/peds, and not just replace current ones. It's not possible, and I really don't see the point of it.
  18. Part2: <acl name="Moderator"> <right name="general.ModifyOtherObjects" access="false"></right> <right name="command.gamemode" access="true"></right> <right name="command.changemode" access="true"></right> <right name="command.changemap" access="true"></right> <right name="command.stopmode" access="true"></right> <right name="command.stopmap" access="true"></right> <right name="command.skipmap" access="true"></right> <right name="command.mute" access="true"></right> <right name="command.unmute" access="true"></right> <right name="command.whois" access="true"></right> <right name="command.whowas" access="true"></right> <right name="function.setPlayerMuted" access="true"></right> <right name="function.kickPlayer" access="true"></right> <right name="function.banIP" access="true"></right> <right name="function.banPlayer" access="true"></right> <right name="function.banSerial" access="true"></right> <right name="function.getBansXML" access="true"></right> <right name="function.unbanIP" access="true"></right> <right name="function.unbanSerial" access="true"></right> <right name="function.getClientIP" access="true"></right> <right name="function.startResource" access="true"></right> <right name="function.stopResource" access="true"></right> <right name="function.restartResource" access="true"></right> <right name="function.redirectPlayer" access="true"></right> <right name="general.adminpanel" access="true"></right> <right name="general.tab_players" access="true"></right> <right name="general.tab_resources" access="false"></right> <right name="general.tab_maps" access="false"></right> <right name="general.tab_server" access="true"></right> <right name="general.tab_bans" access="false"></right> <right name="general.tab_adminchat" access="true"></right> <right name="command.kick" access="false"></right> <right name="command.freeze" access="true"></right> <right name="command.setnick" access="true"></right> <right name="command.shout" access="true"></right> <right name="command.spectate" access="true"></right> <right name="command.slap" access="true"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="true"></right> <right name="command.setarmour" access="true"></right> <right name="command.setmoney" access="false"></right> <right name="command.setskin" access="true"></right> <right name="command.setteam" access="true"></right> <right name="command.giveweapon" access="true"></right> <right name="command.setstat" access="true"></right> <right name="command.jetpack" access="true"></right> <right name="command.warp" access="true"></right> <right name="command.setdimension" access="true"></right> <right name="command.setinterior" access="true"></right> <right name="command.createteam" access="false"></right> <right name="command.destroyteam" access="false"></right> <right name="command.givevehicle" access="true"></right> <right name="command.repair" access="true"></right> <right name="command.blowvehicle" access="true"></right> <right name="command.destroyvehicle" access="true"></right> <right name="command.customize" access="true"></right> <right name="command.setcolor" access="true"></right> <right name="command.setpaintjob" access="true"></right> <right name="command.listmessages" access="true"></right> <right name="command.readmessage" access="true"></right> <right name="command.listresources" access="true"></right> <right name="command.start" access="false"></right> <right name="command.stop" access="false"></right> <right name="command.stopall" access="false"></right> <right name="command.restart" access="false"></right> <right name="command.execute" access="false"></right> <right name="command.setpassword" access="false"></right> <right name="command.setwelcome" access="false"></right> <right name="command.setgame" access="false"></right> <right name="command.setmap" access="false"></right> <right name="command.setweather" access="true"></right> <right name="command.blendweather" access="true"></right> <right name="command.setblurlevel" access="true"></right> <right name="command.setwaveheight" access="true"></right> <right name="command.setskygradient" access="true"></right> <right name="command.setgamespeed" access="true"></right> <right name="command.setgravity" access="true"></right> <right name="command.settime" access="true"></right> <right name="command.ban" access="false"></right> <right name="command.unban" access="false"></right> <right name="command.banip" access="false"></right> <right name="command.unbanip" access="false"></right> <right name="command.banserial" access="false"></right> <right name="command.unbanserial" access="false"></right> <right name="command.listbans" access="false"></right> </acl> <acl name="SuperModerator"> <right name="general.ModifyOtherObjects" access="false"></right> <right name="command.start" access="true"></right> <right name="command.stop" access="true"></right> <right name="command.restart" access="true"></right> <right name="command.kick" access="true"></right> <right name="command.ban" access="true"></right> <right name="command.banip" access="true"></right> <right name="command.unbanip" access="true"></right> <right name="command.refresh" access="true"></right> <right name="command.refreshall" access="true"></right> <right name="command.loadmodule" access="true"></right> <right name="command.addaccount" access="true"></right> <right name="command.delaccount" access="true"></right> <right name="command.chgpass" access="true"></right> <right name="function.addAccount" access="true"></right> <right name="function.removeAccount" access="true"></right> <right name="function.setAccountPassword" access="true"></right> <right name="general.adminpanel" access="true"></right> <right name="general.tab_players" access="true"></right> <right name="general.tab_resources" access="true"></right> <right name="general.tab_maps" access="true"></right> <right name="general.tab_server" access="true"></right> <right name="general.tab_bans" access="true"></right> <right name="general.tab_adminchat" access="true"></right> <right name="command.freeze" access="true"></right> <right name="command.mute" access="true"></right> <right name="command.setnick" access="true"></right> <right name="command.shout" access="true"></right> <right name="command.spectate" access="true"></right> <right name="command.slap" access="true"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="true"></right> <right name="command.setarmour" access="true"></right> <right name="command.setmoney" access="true"></right> <right name="command.setskin" access="true"></right> <right name="command.setteam" access="true"></right> <right name="command.giveweapon" access="true"></right> <right name="command.setstat" access="true"></right> <right name="command.jetpack" access="true"></right> <right name="command.warp" access="true"></right> <right name="command.setdimension" access="true"></right> <right name="command.setinterior" access="true"></right> <right name="command.createteam" access="true"></right> <right name="command.destroyteam" access="true"></right> <right name="command.givevehicle" access="true"></right> <right name="command.repair" access="true"></right> <right name="command.blowvehicle" access="true"></right> <right name="command.destroyvehicle" access="true"></right> <right name="command.customize" access="true"></right> <right name="command.setcolor" access="true"></right> <right name="command.setpaintjob" access="true"></right> <right name="command.listmessages" access="true"></right> <right name="command.readmessage" access="true"></right> <right name="command.listresources" access="true"></right> <right name="command.stopall" access="false"></right> <right name="command.execute" access="false"></right> <right name="command.setpassword" access="true"></right> <right name="command.setwelcome" access="true"></right> <right name="command.setgame" access="true"></right> <right name="command.setmap" access="true"></right> <right name="command.setweather" access="true"></right> <right name="command.blendweather" access="true"></right> <right name="command.setblurlevel" access="true"></right> <right name="command.setwaveheight" access="true"></right> <right name="command.setskygradient" access="true"></right> <right name="command.setgamespeed" access="true"></right> <right name="command.setgravity" access="true"></right> <right name="command.settime" access="true"></right> <right name="command.unban" access="true"></right> <right name="command.banserial" access="true"></right> <right name="command.unbanserial" access="true"></right> <right name="command.listbans" access="true"></right> </acl> <acl name="Admin"> <right name="general.ModifyOtherObjects" access="true"></right> <right name="general.http" access="true"></right> <right name="command.shutdown" access="true"></right> <right name="command.install" access="true"></right> <right name="command.aexec" access="true"></right> <right name="command.debugscript" access="true"></right> <right name="command.upgrade" access="true"></right> <right name="command.crun" access="true"></right> <right name="command.srun" access="true"></right> <right name="command.run" access="true"></right> <right name="function.addBan" access="true"></right> <right name="function.removeBan" access="true"></right> <right name="function.executeCommandHandler" access="true"></right> <right name="function.setServerPassword" access="true"></right> <right name="function.getServerPassword" access="true"></right> <right name="function.createResource" access="true"></right> <right name="function.copyResource" access="true"></right> <right name="function.addResourceMap" access="true"></right> <right name="function.addResourceConfig" access="true"></right> <right name="function.removeResourceFile" access="true"></right> <right name="function.setResourceDefaultSetting" access="true"></right> <right name="function.removeResourceDefaultSetting" access="true"></right> <right name="function.aclReload" access="true"></right> <right name="function.aclSave" access="true"></right> <right name="function.aclCreate" access="true"></right> <right name="function.aclDestroy" access="true"></right> <right name="function.aclSetRight" access="true"></right> <right name="function.aclRemoveRight" access="true"></right> <right name="function.aclCreateGroup" access="true"></right> <right name="function.aclDestroyGroup" access="true"></right> <right name="function.aclGroupAddACL" access="true"></right> <right name="function.aclGroupRemoveACL" access="true"></right> <right name="function.aclGroupAddObject" access="true"></right> <right name="function.aclGroupRemoveObject" access="true"></right> <right name="function.refreshResources" access="true"></right> <right name="function.setServerConfigSetting" access="true"></right> <right name="function.updateResourceACLRequest" access="true"></right> <right name="function.banPlayer" access="true"></right> <right name="command.aclrequest" access="true"></right> <right name="general.adminpanel" access="true"></right> <right name="general.tab_players" access="true"></right> <right name="general.tab_resources" access="true"></right> <right name="general.tab_server" access="true"></right> <right name="general.tab_maps" access="true"></right> <right name="general.tab_bans" access="true"></right> <right name="general.tab_adminchat" access="true"></right> <right name="command.kick" access="true"></right> <right name="command.freeze" access="true"></right> <right name="command.mute" access="true"></right> <right name="command.setnick" access="true"></right> <right name="command.shout" access="true"></right> <right name="command.spectate" access="true"></right> <right name="command.slap" access="true"></right> <right name="command.setgroup" access="true"></right> <right name="command.sethealth" access="true"></right> <right name="command.setarmour" access="true"></right> <right name="command.setmoney" access="true"></right> <right name="command.setskin" access="true"></right> <right name="command.setteam" access="true"></right> <right name="command.giveweapon" access="true"></right> <right name="command.setstat" access="true"></right> <right name="command.jetpack" access="true"></right> <right name="command.warp" access="true"></right> <right name="command.setdimension" access="true"></right> <right name="command.setinterior" access="true"></right> <right name="command.createteam" access="true"></right> <right name="command.destroyteam" access="true"></right> <right name="command.givevehicle" access="true"></right> <right name="command.repair" access="true"></right> <right name="command.blowvehicle" access="true"></right> <right name="command.destroyvehicle" access="true"></right> <right name="command.customize" access="true"></right> <right name="command.setcolor" access="true"></right> <right name="command.setpaintjob" access="true"></right> <right name="command.listmessages" access="true"></right> <right name="command.readmessage" access="true"></right> <right name="command.listresources" access="true"></right> <right name="command.start" access="true"></right> <right name="command.stop" access="true"></right> <right name="command.stopall" access="false"></right> <right name="command.restart" access="true"></right> <right name="command.execute" access="true"></right>
  19. Eh no. Post your whole ACL file.
  20. No, you need to add it inside the acl block itself. You should already have it by default, if you're in admin group.
  21. Open main_server.lua, go to line 9. if isGuestAccount(account) then outputChatBox("You can't use the support system until you login", player) return end Change isGuestAccount(account) to your own check, like getElementData or something.
×
×
  • Create New...