-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
server.lua addCommandHandler("godmode", function (thePlayer) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Sr.Admin")) then triggerClientEvent(thePlayer,"god_mode",thePlayer) end end) client.lua addEvent("god_mode",true) addEventHandler("god_mode",getRootElement(), function () addEventHandler ( "onClientPlayerDamage", getRootElement(), function() cancelEvent() end) end) meta.xml <meta> <info author='Castillo' version='1.0' name=God mode' description= type='script' /> <script src='client.lua' type='client' /> <script src='server.lua' type='server' /> </meta>
-
the "scoreboard" is a resource, you can find it on server folder at "resources" folder.
-
now i'm totally lost, you said you wanted to give a random player $1250 every 1 second and now what are you saying??
-
my bad, i'm sleepy (i should go to sleep )
-
what do you mean by "1 vehicle" ? my code should add a element data to that player only, his was working for everyone.
-
addEventHandler("onPlayerJoin",getRootElement(), function () setElementData(source,"car1",false) end) function spawnAcar(carID, playerSource) for i,v in ipairs (disallowedVehicle) do if (v[1] == carID) then outputChatBox("This is disallowed vehicle!",source,255,0,0) return false end end playerX,playerY,playerZ = getElementPosition(source) if getElementData(source,"car1") == true then destroyElement ( vehicle ) vehicle = createVehicle ( carID,playerX +0,playerY +0, playerZ +0.5 ) warpPedIntoVehicle ( source, vehicle ) setElementData(source,"car1",false) else vehicle = createVehicle ( carID,playerX +0,playerY +0, playerZ +0.5 ) warpPedIntoVehicle ( source, vehicle ) setElementData(source,"car1",true) end end
-
yeah, aiboforcen its right, lol. you should make some other check like element data.
-
i'm bored and i won't go to sleep thats why fast reply
-
car1 = false function spawnAcar(carID, playerSource) for i,v in ipairs (disallowedVehicle) do if (v[1] == carID) then outputChatBox("This is disallowed vehicle!",source,255,0,0) return false end end playerX,playerY,playerZ = getElementPosition(source) if car1 == true then destroyElement ( vehicle ) else vehicle = createVehicle ( carID,playerX + 1,playerY +1, playerZ +0.5 ) warpPedIntoVehicle ( source, vehicle ) car1 = true end end
-
wow i just checked the video and its really cool stuff, good job Kayl and MTA team. Merry Christmas to all of you!
-
Great! congratz mta!
-
my_blip = createBlip ( 0, 0, 0, 37 )
-
so my code works now, right?
-
i didn't even checked it, i just changed the timer arguments o_O. btw thats because he never added a function function random() local randomPlayer = getRandomPlayer ( ) outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount end setTimer ( random, 1000, 0 ) -- 1000 = 1 second 0 = how much times will the timer work (0 = infinite)
-
omgf, he is telling you the same as i did! J-U-S-T F-I-N-D A-N-O-T-H-E-R G-A-M-E M-O-D-E
-
function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow (X, Y, Width, Height, "Please log in.", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin) Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Password", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.025 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log in.", true, wdwLogin) guiSetVisible(wdwLogin, false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createLoginWindow() outputChatBox("Welcome to Fun Flight Server. Please log in.") if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else outputChatBox("An unexpected error has ocurred. Please visit funflightserver.webs.com and report this error.") end showCursor(true) guiSetInputEnabled(true) addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end ) function clientSubmitLogin(button,state) if button == "left" and state == "up" then local username = guiGetText(edtUser) local password = guiGetText(edtPass) if username and password then triggerServerEvent("submitLogin", getRootElement(), username, password) guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) showCursor(false) else outputChatBox("Please enter wanted username and password.") end end end
-
just open the link below, everything is explained there and also has examples. https://wiki.multitheftauto.com/wiki/CreateBlip
-
omg volk-rus! you did it wrong lol, try this. local randomPlayer = getRandomPlayer ( ) outputChatBox ( getPlayerName ( randomPlayer ).." Has win 1025$ " ) givePlayerMoney ( randomPlayer, 1025 ) --give the player money according to the amount setTimer ( randomPlayer, 1000, 0 ) -- 1000 = 1 second 0 = how much times will the timer work (0 = infinite)
-
function bluntequip () local xl,yl,zl = getPedBonePosition (getLocalPlayer(), 25) local blunt = createObject (1485, 0,0,0) attachElements ( blunt, getLocalPlayer(), xl, yl, zl + 1 ) end addCommandHandler ( "smokeblunt" , bluntequip ) maybe that? i didn't know why you put out of the function the getPedBonePosition and as argument you put "ped"
-
Cavorta, this project is dead i guess, also it wasn't anything new if you want a RPG mode you can get it on community searching for "lolmode" or "j-rpg"
-
ammunations = { { 2150.1499023438, 936.83428955078, 10.306272506714 }, { 782.69812011719, 1872.9688720703, 4.4971857070923 }, {-1508.8366699219, 2603.4729003906, 55.322311401367} } function findNearestAmmunation(thePlayer) local i=0 local minDistance=100000 local minAmmu = 0 local posX, posY, posZ = getElementPosition( thePlayer ) for key,val in ipairs(ammunations) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minAmmu=i end end return ammunations[minAmmu][1],ammunations[minAmmu][2],ammunations[minAmmu][3] end addCommandHandler("warp", function(thePlayer) local xx,yy,zz = findNearestAmmunation(thePlayer) spawnPlayer(thePlayer,xx,yy,zz) end)
-
now it works. function createRulesWindow() local sWidth, sHeight = guiGetScreenSize() local Width,Height = 445,445 local X = (sWidth/2) - (Width/2) local Y = (sHeight/2) - (Height/2) rulesWindow = guiCreateWindow(X,Y,Width,Height,"Rules",false) guiWindowSetMovable(rulesWindow,false) guiWindowSetSizable(rulesWindow,false) rulesButton = guiCreateButton(137,394,158,37,"Accept",false,rulesWindow) rulesLabel = guiCreateLabel(10,25,425,359,[[ Welcome to Fun Flight Server! Please carefully read the rules before accepting. By accepting the rules, you are agreeing to play by them. Anyone caught breaking these rules will be kicked and/or banned from this server. If you do not accept the rules within 90 seconds, you will be kicked. 1: No cheating. 2: No bug abuse. 3: No mods to your game. 4: No flaming. 5: Respect other players. 6: Be nice!]],false,rulesWindow) guiLabelSetHorizontalAlign(rulesLabel,"center",true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createRulesWindow() addEventHandler("onClientGUIClick",rulesButton,acceptRules,false) showCursor(true,true) end ) function acceptRules(button,state) if button == "left" and state == "up" then guiSetVisible(rulesWindow, false) showCursor(false,false) outputChatBox("Thank you for accepting our rules. Have fun!") if rulesWarningTimer then killTimer(rulesWarningTimer) rulesWarningTimer = nil end end end function inactivePlayer(status) if status == 1 then outputChatBox("Please accept our rules or be kicked.") rulesWarningTimer = setTimer(inactivePlayer,30000,1,2) elseif status == 2 then outputChatBox("FINAL WARNING: Please accept our rules or be kicked.") rulesWarningTimer = setTimer(inactivePlayer,30000,1,3) elseif status == 3 then triggerServerEvent("clientKickInactivePlayer",getLocalPlayer()) end end addEvent("clientKickInactivePlayer",true) function kickInactivePlayer() kickPlayer(client,"Please accept our rules.") end addEventHandler("clientKickInactivePlayer",root,kickInactivePlayer) your error: your didn't added the event handler for gui-button.
-
oh i see, well then lets wait for another member that may know if its possible to fix that.
-
i have no idea how you can fix that. Question: why you want to show that big RED area in the radar? for me it would suck