
Karuzo
Members-
Posts
1,213 -
Joined
-
Last visited
Everything posted by Karuzo
-
local gRoot = getRootElement() local sWidth,sHeight = guiGetScreenSize() local Width,Height = 549,412 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) getPlayersOnline = function () local playersOnline = getElementsByType ( "player" ) local playersO = 0 for count, playerOn in pairs(playersOnline) do playersO = playersO + 1 end return playersO end local currentMoney = 0 addEventHandler ( "onClientRender", root, function ( ) local money = getPlayerMoney ( ) if ( currentMoney ~= money ) then outputChatBox ( money ) setElementData ( localPlayer, "playerMoney", money ) currentMoney = money end end ) function Scoreboard() dxDrawImage(X,Y,Width,Height, "images/back.png") dxDrawText("Name", X+60, Y+10, Width,Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText(getPlayersOnline().."/50" ,X+525, Y-15, Width,Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Ping", X+480, Y+10, Width, Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Geld", X+210, Y+10, Width, Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Team", X+350, Y+10, Width, Height, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) local players = getElementsByType ( "player" ) local playas = 0 local playerheight = 20 for amt, player in pairs(players) do playas = playas + 1 if (playas <= 20) then local ping = getPlayerPing(player) local teamp = getPlayerTeam(player) local teamn = getTeamName(teamp) local money = getElementData(player, "playerMoney") if (ping >= 250) then r,g,b = 255,0,0 elseif (ping >= 120) then r,g,b = 255,69,0 else r,g,b = 0,255,0 end dxDrawText(getPlayerName ( player ), X+60,Y+60+playerheight*(amt-1), Width,Height, tocolor(255,255,255), 1 , "default-bold","left", "top",false, false,true,true) dxDrawText(ping,X+480,Y+60+playerheight*(amt-1), Width, Height, tocolor(r,g,b), 1, "default","left", "top",false,false,true,true) dxDrawText(money.." $", X+210,Y+60+playerheight*(amt-1),Width, Height, tocolor(255,255,255), 1, "default","left", "top",false, false, true, true) dxDrawText(teamn, X+350,Y+60+playerheight*(amt-1),Width, Height, tocolor(255,255,255), 1, "default","left", "top",false, false, true, true) end end end function Zeit() local hours = getRealTime().hour local minutes = getRealTime().minute local seconds = getRealTime().second dxDrawText(hours..":"..minutes..":"..seconds, X-325, Y+525, Width, Height, tocolor(255,255,255), 1, "default-bold","left", "top",false, false,true,true) end addEventHandler("onClientRender", gRoot, Zeit) function open() opened = not opened if opened == true then addEventHandler("onClientRender", gRoot, Scoreboard) showChat(false) showPlayerHudComponent("all", false) removeEventHandler("onClientRender", gRoot, Zeit) else removeEventHandler("onClientRender", gRoot, Scoreboard) showPlayerHudComponent("all", true) showChat(true) addEventHandler("onClientRender", gRoot, Zeit) end end bindKey("tab","both",open)
-
Original:https://community.multitheftauto.com/index.php?p=resources&s=details&id=6367 Fake: https://community.multitheftauto.com/ind ... ls&id=8714 Just with other pictures... DONE
-
function open() opened = not opened if opened == true then addEventHandler("onClientRender", gRoot, Scoreboard) showChat(false) showPlayerHudComponent("all", false) else removeEventHandler("onClientRender", gRoot, Scoreboard) showPlayerHudComponent("all", true) showChat(true) end end bindKey("tab","both",open)
-
Ok i have another problem, if i'm joining my server i don't see the other players , but if i have more than 0$ i can see them, why ? Here's my code : local currentMoney = 0 addEventHandler ( "onClientRender", root, function ( ) local money = getPlayerMoney ( ) if ( currentMoney ~= money ) then outputChatBox ( money ) setElementData ( localPlayer, "playerMoney", money ) currentMoney = money end end ) local players = getElementsByType ( "player" ) local playas = 0 local playerheight = 20 for amt, player in pairs(players) do playas = playas + 1 if (playas <= 20) then local ping = getPlayerPing(player) local teamp = getPlayerTeam(player) local teamn = getTeamName(teamp) local money = getElementData(player, "playerMoney") if (ping >= 250) then r,g,b = 255,0,0 elseif (ping >= 120) then r,g,b = 255,69,0 else r,g,b = 0,255,0 end dxDrawText(money.." $", X+210,Y+60+playerheight*(amt-1),Width, Height, tocolor(255,255,255), 1, "default","left", "top",false, false, true, true) end end end
-
Stolen: https://community.multitheftauto.com/ind ... ls&id=8698 Original : https://community.multitheftauto.com/ind ... ils&id=588 DONE
-
Yeah, it's true. Just said that because he said that he knows that i can't "script" a planet. Nvm..
-
function Death() setTimer(spawnPlayer, 2000,1,source,1187,-1314,13, -90, math.random(1,50), 0, 0,nil) end addEventHandler("onPlayerWasted", getRootElement(), Death) source is the source of the function, 1187 is X-Coordinate, -1314 is Y-Coordinate, 13 is Z-Coordinate, -90 is the rotation, math.random(1,50) is the Skin, so it chooses a random skin between 1 and 50, 0, is the interior, 0, is the dimension, nil is the team. setTimer(spawnPlayer, 2000,1) means it spawns the player after 2 Seconds after he died. Hope you could understand me
-
How could you know that i can't "script" this planet ? I would just use some textures ? That's a lot easier than everythin'. And a medium scripter should know what ElementDatas are... Just sayin'.
-
Cool reasons Sarrum....
-
I think this isn't the right place for this. B2T: I don't think that this script would be that hard. Just some random Markers, giving money, etc... Just my opinion.
-
Just tested the server, it's pretty fun if you want to kill some NPCs and stuff like that. I love the /bomb function
-
Pretty cool! I like it.
-
Thank you Solidsnake14, it just works perfectly.
-
I mean if i want to save the current money the player has in his hands, just do it like this ? function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount(source))) then local accountData = getAccountData (theCurrentAccount, "money") if (accountData) then local playerMoney = getAccountData(theCurrentAccount, "money") setElementData(source,"money",getPlayerMoney(source)) end end end addEventHandler("onPlayerLogin", getRootElement(), playerLogin)
-
Can't try it at the moment, no ones online We have 12 o'clock here. And if i want to save it just get a AccountData and set the Element there?
-
Would that work ? I mean , getPlayerMoney client-sided would show the local players money just several times. e.g.: if i have 400$ my friend would also have 400$ but he has 0$. I think your script is client-side otherwise onClientRender wouldn't work.
-
Hey all, i have a small problem with my scoreboard. i want to get the player's money. but that doesn't really work, cause i cannot get the Players Money client-side,because the player would only see his money in each line. So i asked a friend and he said me that i need to use element datas. But i just don't get it how that should work.. Here's my client-side Script: local players = getElementsByType ( "player" ) local playas = 0 local playerheight = 20 for amt, player in pairs(players) do playas = playas + 1 if (playas <= 20) then local ping = getPlayerPing(player) local teamp = getPlayerTeam(player) local teamn = getTeamName(teamp) local money = --I don't know how i should make that. if (ping >= 250) then r,g,b = 255,0,0 elseif (ping >= 120) then r,g,b = 255,69,0 else r,g,b = 0,255,0 end dxDrawText(getPlayerName ( player ), X+60,Y+60+playerheight*(amt-1), Width,Height, tocolor(255,255,255), 1 , "default-bold","left", "top",false, false,true,true) dxDrawText(ping,X+480,Y+60+playerheight*(amt-1), Width, Height, tocolor(r,g,b), 1, "default","left", "top",false,false,true,true) dxDrawText(money.." $", X+210,Y+60+playerheight*(amt-1),Width, Height, tocolor(255,255,255), 1, "default","left", "top",false, false, true, true) dxDrawText(teamn, X+350,Y+60+playerheight*(amt-1),Width, Height, tocolor(255,255,255), 1, "default","left", "top",false, false, true, true) end end end
-
You could use Funsteins Converter to convert the .map file to a LUA file. http://cemgokmen.com/converter/
-
No, cause you forgot some (. addEventHandler('onClientResourceStart',resourceRoot,function () txd = engineLoadTXD( 'data/euros.txd' ) engineImportTXD( txd, 587 ) dff = engineLoadDFF('data/euros.dff', 587) engineReplaceModel( dff, 587 ) end)
-
So i've got another question. this is my code : spawnPlayer(source, 1177.51917, -1324.05542, 14.07470,-90, math.random(1,50) , 0, 0, nil) But for some reasons the player gets the CJ Skin (ID 0) and is freezed. Why ?
-
Hmm, Not really :-/ Isn't there a way to make the text with an alpha of 100? Or a way to create custom editboxes?
-
I don't really know what i should do with that.
-
Hey Guys, So i wanted to make my Panel look more beautiful, and so i setted the alpha of the Edit-Box to 0. So my Question is : The Text has also a alpha of 0 , can i make it to 100? So the players just can see the text hey write ? If not: Is there another way to create a edit-box ?