
karlis
Members-
Posts
1,314 -
Joined
-
Last visited
Everything posted by karlis
-
a bit too easy, but still good job!
-
hey, as i needed it for my IVhud resource, i learned a basics of HLSL, and made a simple pixel shader to draw texture in circular shape, however shader somewhy fail to start(returns false when trying to create shader). is it problem of hardware, or theres some errors? .fx script: int radius; int2 centerPos; float4 borderCol; texture theMap; sampler2D theMapSampler = sampler_state { Texture = (theMap); MinFilter = Anisotropic; MagFilter = Anisotropic; AddressU = Border; AddressV = Border; BorderColor = borderCol; } float4 PixelShaderFunction( float2 texCord : TEXCOORD0, int2 pixelPos : VPOS0 ) : COLOR0 { float4 newColor newColor = tex2D(theMapSampler,texCord); if (distance(pixelPos,centerPos)>radius) newColor.a = 0; return newColor; } technique circularDraw { pass Pass1 { AlphaBlendEnable = TRUE; DestBlend = INVSRCALPHA; SrcBlend = SRCALPHA; PixelShader = compile ps_2_0 PixelShaderFunction(); } } the cut from main script, with all the values etc: local mapBorderCol={0,255,120,255} local texture=dxCreateTexture("images/radar.jpg") local shader=dxCreateShader("shader.fx") dxSetShaderValue(shader,"radius",size) --size is radius of the drawing, it IS defined dxSetShaderValue(shader,"centerPos",x,y) --x,y is center of drawing, it IS defined dxSetShaderValue(shader,"borderCol",mapBorderCol[1]/255,mapBorderCol[2]/255,mapBorderCol[3]/255,mapBorderCol[4]/255) dxSetShaderValue(shader,"theMap",texture) and yes, its in proper nightly 1.1 version.
-
Calling them complete idiots are not way to go too.
-
they say the new one is not user friendly...
-
they would just stop updating it then. almost half of them even still use old race editor.
-
true, ill have to rewrite it all. it basically takes out all the hard part of script, do'h. expect it release even later. and srry for delay and inactivity, i was in countryside.
-
doh that means i cant call myself gtfo anymore but for real, cool code, would never figure smthign like that out
-
roundednum=math.floor(number*(10^digitCountAfterDot)+0.5)/(10^digitCountAfterDot)
-
btw i suggest you adding something like a dot to place where the bone is located, imo would look better.
-
setElementData(element theElement,string name,string/float/table/boolean data, boolean sync) getElementData(element theElement,string name) but you need to call setElementData each time you change the var.
-
remove the " " class="kw2">getPlayerTeam "section, thats just lua highlighter bug.
-
i suggest you cheking this http://en.wikipedia.org/wiki/Matrix_%28mathematics%29
-
I dont really understand how, but your code add more 4~6 fps, thanx) he doesn't load all the bones if ped is far away.
-
bother reading some pages before?streaming is bugged
-
you should reduce the sending to ~100 ms, and add a velocity var, so sync can still be proper
-
or theSound=playSound3D() --args here destroyElement(theSound) if, the sound wont be needed again, it will be more efficient that way
-
try dxDrawText("random text",0,0,100,100,"default",0.5) you will see the problem that low res just cant handle smaller texts etc.
-
so it would have a default value.
-
it is needed when you need real distance between 2 3D object in map, or when you want to calculate rotation for some vector.
-
you cant do that without map editor plugin, you can, however, just reject/modify the map when the gamemode is started.
-
event didn't trigger when you would need to. function luzesPartidasDesligarBlip() if getVehicleLightState(source,0)==1 and getVehicleLightState(source,1 )==1 then destroyElement(blip) --make sure that blip defined end end addEventHandler ( "onVehicleDamage", getRootElement(), luzesPartidasDesligarBlip )
-
copVehicles = { [523]=true,[598]=true,[596]=true,[597]=true,[599]=true} copSkins = { [280]=true,[281]=true,[282]=true,[283]=true,[284]=true,[288]=true } function copenterVehicle ( player, seat, jacked ) if ( copVehicles[getElementModel ( source )] ) and ( not copSkins[getElementModel ( player )] ) and ( seat == 0 ) then removePedFromVehicle ( player )--force the player out of the vehicle outputChatBox ( "You aren't a Police Officer , you mayn't drive this.", player ) --and tell the player why end end addEventHandler ( "onVehicleEnter", getRootElement(), copenterVehicle ) there was obvious syntax errors in the tables.
-
1)why you define player name twice? 2)handler is not proper, it doesn't have a function. 3)very strange code, duplicated, not needed length, etc. 4)many syntax errors, and 1 typo addEventHandler("onClientResourceStart",getResourceRootElement(),function() ServerRulesWindow = guiCreateWindow(272,134,521,480,"Server Rules by Klesh",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(52,76,424,339,false,ServerRulesWindow) GUIEditor_Tab[1] = guiCreateTab("Information Server",GUIEditor_TabPanel[1]) GUIEditor_Label[1] = guiCreateLabel(18,32,183,23,"CSS Owner :",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[1],0,247,255) GUIEditor_Label[2] = guiCreateLabel(18,69,114,25,"- Klesh",false,GUIEditor_Tab[1]) GUIEditor_Label[3] = guiCreateLabel(18,107,114,25,"CSS Leaders :",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[3],0,247,255) GUIEditor_Label[4] = guiCreateLabel(19,147,114,25,"- Klesh",false,GUIEditor_Tab[1]) GUIEditor_Label[5] = guiCreateLabel(19,180,114,25,"- Pr1v4t3",false,GUIEditor_Tab[1]) GUIEditor_Label[6] = guiCreateLabel(19,216,114,25,"Web Site :",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[6],0,247,255) GUIEditor_Label[7] = guiCreateLabel(114,214,261,20,"\"The Web Site of the Clan is on Construccion.\"",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[7],255,0,0) GUIEditor_Label[8] = guiCreateLabel(20,263,375,22,"The join is open, only with an invitation!",false,GUIEditor_Tab[1]) guiLabelSetColor(GUIEditor_Label[8],255,0,0) GUIEditor_Tab[2] = guiCreateTab("General Rules",GUIEditor_TabPanel[1]) GUIEditor_Label[9] = guiCreateLabel(12,18,166,26,"Server Rules",false,GUIEditor_Tab[2]) guiLabelSetColor(GUIEditor_Label[9],255,0,0) guiSetFont(GUIEditor_Label[9],"default-bold-small") GUIEditor_Label[10] = guiCreateLabel(10,56,166,26,"- Respect other players.",false,GUIEditor_Tab[2]) GUIEditor_Label[11] = guiCreateLabel(9,91,192,22,"- Don't ask how to be an admin.",false,GUIEditor_Tab[2]) GUIEditor_Label[12] = guiCreateLabel(8,124,265,19,"- Only you can enter on the with an invitation.",false,GUIEditor_Tab[2]) GUIEditor_Label[13] = guiCreateLabel(9,158,283,19,"- The spam or flood in the chat can get muted.",false,GUIEditor_Tab[2]) GUIEditor_Label[14] = guiCreateLabel(9,193,283,19,"- The Cheats are not allowed in this server.",false,GUIEditor_Tab[2]) GUIEditor_Label[15] = guiCreateLabel(8,228,283,19,"- Use the report system if you spotted a hacker.",false,GUIEditor_Tab[2]) GUIEditor_Tab[3] = guiCreateTab("Commands",GUIEditor_TabPanel[1]) GUIEditor_Label[16] = guiCreateLabel(16,22,102,24,"Me Commands :",false,GUIEditor_Tab[3]) guiLabelSetColor(GUIEditor_Label[16],0,247,255) GUIEditor_Label[17] = guiCreateLabel(16,69,399,20,"- /hi : Hi to Everybody",false,GUIEditor_Tab[3]) GUIEditor_Label[18] = guiCreateLabel(14,98,399,20,"- /bb : Bye Bye to Everybody",false,GUIEditor_Tab[3]) GUIEditor_Label[19] = guiCreateLabel(13,129,399,20,"- /brb : Will be right Back!",false,GUIEditor_Tab[3]) GUIEditor_Label[20] = guiCreateLabel(13,159,399,20,"- /tyt : Thank you too!!",false,GUIEditor_Tab[3]) GUIEditor_Label[21] = guiCreateLabel(12,192,399,20,"- /ty : Thanks to you!!",false,GUIEditor_Tab[3]) GUIEditor_Label[22] = guiCreateLabel(12,224,399,20,"- /gg : Good Game!",false,GUIEditor_Tab[3]) GUIEditor_Label[23] = guiCreateLabel(11,256,399,20,"The constant abuse of the commands can get ban.",false,GUIEditor_Tab[3]) guiLabelSetColor(GUIEditor_Label[23],0,247,255) AcceptButtom = guiCreateButton(148,430,224,30,"I Accept with The Rules",false,ServerRulesWindow) PlayerNameLabel = guiCreateLabel(143,39,236,18,"Welcome to CSS Window Help.",false,ServerRulesWindow) local playerName=getPlayerName(getLocalPlayer()) guiSetText( PlayerNameLabel, "Welcome to CSS Window Help: [ " .. playerName .. " ]" ) guiLabelSetColor(PlayerNameLabel,0,247,255) guiLabelSetHorizontalAlign(PlayerNameLabel,"center",false) guiSetFont(PlayerNameLabel,"clear-normal") bindKey ("F9", "down", ServerRulesWindow) end) function ServerRulesWindow () getVisible = guiGetVisible (ServerRulesWindow) guiSetVisible(ServerRulesWindow,not getVisible) showCursor(not getVisible) end
-
the difference in lua is that all variables is defined automatically, you don't have to. lua decides itself is it string, number, table or whatever.