-
Posts
1,105 -
Joined
-
Last visited
Everything posted by Aibo
-
MTA webserver does not have PHP. and PHP SDK does not serve this purpose, its used on your common webserver to process requests from an MTA server.
-
your conditions are wrong. and its elseif and use indents, it will help you.
-
your conditions are wrong: window = guiCreateWindow(x/2 - -100,y/2 - 110,280,310,"World",false) label7 = guiCreateLabel(10,180,80,40,"Reset Colors:",false,window) box2 = guiCreateComboBox(100,180,60,90,"Sky",false,window) guiComboBoxAddItem(box2,"Sky") guiComboBoxAddItem(box2,"Water") guiComboBoxAddItem(box2,"Sun") function resetColors() if (source == button13) then if guiComboBoxGetSelected(box2) == -1 or guiComboBoxGetSelected(box2) == 0 then resetSkyGradient() elseif guiComboBoxGetSelected(box2) == 1 then resetWaterColor() elseif guiComboBoxGetSelected(box2) == 2 then resetSunColor() end end end addEventHandler("onClientGUIClick",button13,resetColors) PS: x/2 - -100 == x/2 + 100
-
[ and ] are special characters used to denote a character set in a pattern. "[DM]" is a pattern and it means "D or M". that's why special characters must be escaped with %.
-
1. you'll have set gamespeed back to normal using timer/respawn event or something else. 2. you have outputChatBox already in your script. simplest thing you can do is copy it in your event. personal note: if you can't do anything without help (even edit few lines in some script you copied somewhere), can't type function name properly — scripting is not your thing. not now, anyway.
-
no, root is a predefined global variable that exists in every resource.
-
they don't. but if you want pixel-perfect display of your images — then yes, power of 2 is the way. otherwise you'll have blurring issues. yes.
-
use 32-bit color mode (modes that are x32).
-
and here the source is the root element, read triggerServerEvent
-
that would be dxDrawPolygon
-
1. use images with sizes that are a power of 2. like 16x16, 32x64, 64x16, 128x32, etc. for your image you can use 512x128, for example 2. resize images carefully, or better not resize at all.
-
function onResourceStart() door = createObject(3095, 1279.9134521484, -2054.0205078125, 62.628402709961, 0, 271.07666015625, 0) end addEventHandler("onResourceStart", resourceRoot, onResourceStart) function move(thePlayer,cmd) local x, y, z = getElementPosition(door) if cmd == "dooropen" then if z < 72 then moveObject ( door, 10000, x, y, 72.628402709961) else outputChatBox("Door is already open",thePlayer,0,255,0,true) end elseif cmd == "doorclose" then if z > 63 then moveObject ( door, 10000, x, y, 62.628402709961) else outputChatBox("Door is already closed", thePlayer,0,255,0,true) end end end addCommandHandler("dooropen", move) addCommandHandler("doorclose", move)
-
with this code you are creating a table that is stored in Profile_Window variable and the rest (including Profile_Data) are nil. -- if you use commas like: local a, b, c, d = -- you should provide the values accordingly: local a, b, c, d = "string goes in a", 2, "c", {"this table goes into d variable"}
-
both can, yes, but setting element ID to find some element right away (when you can use the same event) is unnecessary. 1. what if client recieves the event before this element ID is synced with this client (im not sure if its possible, though)? 2. what will happen when the next element recieves the same ID? now there's a real problem.
-
you DO know that events have arguments that you can pass along (like you random player or vehicle here)?
-
messages = { "هههه مسوي برو ق1", "لول نوب انت؟؟", "خخخخ انت ولعبك المنوب", "ههه انا لله وانا اليه راجعون" } outputChatBox("Wasted_System_v2.0",255,255,0) outputChatBox("AnTi-Fist_v1.0",0,255,255) function wasted (killer, weapon, bodypart) outputChatBox ( messages[math.random(1,#messages)], 255, 0, 0 ) local sound = playSound("sounds/wasted.mp3") setSoundVolume(sound, 0.5) end addEventHandler ("onClientPlayerWasted", getLocalPlayer(), wasted) addEventHandler ("onClientPlayerDamage", root, function (attacker,weapon,bodypart) if weapon == 0 then cancelEvent() elseif weapon == 24 or weapon == 31 or weapon == 34 then if bodypart == 9 then local x,y,z = getElementPosition(source) local sound = playSound ("sounds/headshot.mp3",false) setSoundVolume (sound,4) setGameSpeed (0.25) setCameraTarget (source) fxAddBlood (x,y,z+0.8,0,0,0,500) setPedHeadless (source,true) setElementHealth (source,0) setTimer (setGameSpeed,2000,1,1) end end end)
-
what is thePlayer client-side?
-
added (thanks to lil_Toady). also BBCode button added, so people could quickly link wiki pages, like: [ wiki]shader = shader
-
why the hell you're doing dx drawing now. forget about bandi94's comment, it's UNRELATED. read this: https://wiki.multitheftauto.com/wiki/GuiCreateWindow element guiCreateWindow ( float x, float y, float width, float height, string titleBarText, bool relative ) relative: This is whether sizes and positioning are relative. If this is true, then all x,y,width,height floats must be between 0 and 1, representing sizes/positions as a fraction of the screen size.
-
well you don't really need guiGetScreenSize to make gui positioning relative.
-
you should read wiki about "relative" gui argument. it's present in every "guiCreate..." function. excuse me, how is this related to the topic? that's the second time i see you posting totally unrelated code, please stop that.
-
Bad argument @ "getElementByID" | Switch two functions
Aibo replied to dragonofdark's topic in Scripting
element ID is a string and it is optional. "balis" in your script is already an element (unless you redefine balis variable somewhere), the one you created with createObject. so you dont need getElementByID. i'm not sure if attachElements will work correctly with the element that is already attached to something, never tried that. -
use relative positioning instead of absolute?
-
you just upload the new version of the same resource, it will be automatically detected as an update to the existing resource.
