Jump to content

deltamta

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by deltamta

  1. It works awesome and well and thanks GTX. But when I run the scripts shouldn't it like play the music and load the files etc. ? Cause it doesn't although the files are downloaded. If you could help me with that guys would be awesome. Regards, Delta.
  2. I don't wanna save a freakin' script I wanna save a file. For example lets say a music file. In order to be ran I need to save it in the client cache. Since I'm using 'pcall ( loadstring )' I have to transfer everything manually. And even if you don't understand can't you just tell me how to move a file from serverside to clientside. I know why I wanna do that. Regards, Delta.
  3. Not if you want to do what I'm trying to succeed. I want to make a server with many gamemodes inside and to succeed that I have to trigger the map elements, scripts and files Client Side to load them for the specific player that has joinned the specific gamemode. All I want to know is how to trigger a file from server side to client side so I can stick it in cache. Regards, Delta.
  4. Hello guys, I was just wondering if there is a way to transmit Server Side files within maps to Client Side Cache. I already looped through a map's file but I can't seem to understand how to transfer the actual file to client side. The reason I wanna do that is cause I'm running clientside scripts on 'pcall ( loadstring )' and no meta file from the actual map is read. So I can't play the music files etc etc. I tried something like that : Server Side : for Index, MapFile in ipairs( g_RaceFiles ) do -- For all the scripts read them completely. g_RaceFiles[Index] = { } g_RaceFiles[Index].names = MapFile g_RaceFiles[Index].files = readMapFile ( readMapFile ( ":"..MapResourceName.."/"..MapFile ) ) end triggerLatentClientEvent ( Player, 'onClientReceiveMap', 9999999999999, false, Player, g_Vehicles, g_Spawnpoints, g_Checkpoints, g_Objects, g_Pickups, g_RaceScriptFiles, g_RaceFiles ) ReadMapFile Server Side Function : function readMapFile ( MapFile ) local file = fileOpen( MapFile ) if ( file ) then local scriptInformation = fileRead( file, fileGetSize( file ) ) fileClose( file ) return scriptInformation end return false end Client Side : for i, file in ipairs ( g_RaceFiles ) do outputChatBox ( file.files ) local RaceFile = fileCreate( file.names ) if ( RaceFile ) then local RaceWrite = fileWrite ( RaceFile, file.files ) if ( RaceWrite ) then fileClose ( RaceFile ) outputChatBox ( "#ff8c00* #ffffffSuccessfully have written inside the file.", 255, 255, 255, true ) end end end This though doesn't seem to work... I would appreciate some help Regards, Delta
  5. As GTX said a Port is already in use or blocked. Try to close your skype and try again.
  6. I found another way I made my own functions like getDXAlpha setDXAlpha it works now just kept adding 10 everytime.
  7. I'm making my own client side library for making scripts easy in the future ( I might be releasing ) and I have a query. Could you please tell me how could I fade a player screen through time? I tried some ways but it doesnt fade it through time. And fadeCamera fades it completely Thanks
  8. deltamta

    save [help]

    Im not so sure but try function playerLogin (_, theCurrentAccount, autoLogin) local account = getAccountName (theCurrentAccount ) if not (isGuestAccount (account)) then -- no need to get the players account local accountData = getAccountData (account , "Deaths") local accountData = getAccountData (account , "Kills") if (accountData) then setElementData(source,"Deaths",accountData ) --use the account data var instead of getting another var plus use setElementData setElementData(source,"Kills",accountData ) --use the account data var instead of getting another var plus use setElementData end end end addEventHandler("onPlayerLogin", getRootElement(), playerLogin)
  9. yes ofc i did that and I also put HTTP port But still aint working. ( I also tested with a different host but still nothing )
  10. Sorry for bumping but your code gives me an ERROR 22! I have read CURL and it shows this : CURLE_HTTP_RETURNED_ERROR (22) This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400. Sorry if I look like a nab but i actually never worked with callRemote.
  11. Crystal ur suggestion is good but I figured out another way to do it and it works. I just created a GUI and set the alpha to 0 so when the mouse hovers over the gui it draws the dx rectangle. It might sound weird but it works well
  12. Heyo Guys, I have a query... As you all might know on GUI's we use onClientMouseEnter or onClientMouseLeave as hover functions to make our GUI's look cooler But im making a script using dx Drawings and I was curious if there is any specific function when you hover a dx Rectangle to change to a different color Thanks, Delta
  13. It has to set a timer of 10 seconds to increase +30 hp every second till it has reached @ about 333 hp
  14. Heyo, I have a quick query because I'm trying to make a race function... I want to make a function that when your vehicle's health reaches to a critical moment so basically just before it starts burning, I want it to slowly start replenishing it's health to 30% in 30 seconds. ( I also want it to wait 10 seconds before the replenishment proccess starts ) Now I don't want it to pass 30% because then the script would not be fair for other players ... Here is my research till now : --[[ Repair Script By *Delta^# ]] function setHealth ( loss ) vehicle = source setTimer ( function () local health = getElementHealth ( vehicle ) outputChatBox ( health ) if ( health <= 120 ) then setElementHealth( vehicle, health + 30.0) end end, 1000, 0 ) end addEventHandler( "onVehicleDamage", getRootElement(), setHealth ) Thank you.
  15. Hi I made a nice version which you can do /collide [which player you should collide] [yes or no] and only admins can set collisions on and off! It might not work though cause I made it in school and didn't have a chance to test it! If it doesn't work just tell me so I can get home and fix it. ( Credits go to NeXTreme for making the : getPlayerFromParticalName(thePlayerName) which is usefull so you don't have to put the exact name ) Also make sure the ends and elses are correctly because I kind of rushed! It is server side Here : -- Damage proof Script for by *Delta^# -- addCommandHandler ( "collide", function ( player, command, playerName, check ) if ( isObjectInACLGroup( "user." .. getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Admin" ) ) ) then if ( playerName and check ) then if (getPlayerFromParticalName (playerName)) then whichPlayer = (getPlayerFromParticalName (playerName)) vehicle = getPedOccupiedVehicle ( whichPlayer ) if ( check == "yes" ) then damagetrue = setVehicleDamageProof ( vehicle, true ) if ( damagetrue ) then outputChatBox ( "#ff8900[iNFO] #ffffffYou have became damage proof by #ff8900"..player, whichPlayer, 255, 137, 0, true ) outputChatBox ( "#ff8900[iNFO] #ffffffYou have successfully made #ff8900"..whichPlayer.. "#ffffff damage proof", player, 255, 137, 0, true ) end elseif ( check == "no" ) then if ( damagetrue ) then damagefalse = setVehicleDamageProof ( vehicle, false ) if ( damagefalse ) then outputChatBox ( "#ff8900[iNFO] #ffffffYou have unbecame damage proof by #ff8900"..player, whichPlayer, 255, 137, 0, true ) outputChatBox ( "#ff8900[iNFO] #ffffffYou have successfully made #ff8900"..whichPlayer.. "#ffffff undamage proof", player, 255, 137, 0, true ) end else outputChatBox ( "#ff8900[iNFO] #ffffffPlayer is already undamage proof!", player, 255, 137, 0, true ) end else outputChatBox ( "#ff8900[iNFO] #ffffffIncorect syntax : #ff8900/collide [player] [yes/no]", player, 255, 137, 0, true ) end else outputChatBox ( "#ff8900[iNFO] #ffffffCannot find player : #ff8900 "..playerName, player, 255, 137, 0, true ) end else outputChatBox ( "#ff8900[iNFO] #ffffffIncorect syntax : #ff8900/collide [player] [yes/no]", player, 255, 137, 0, true ) end else outputChatBox ( "#ff8900[iNFO] #ffffffYou are not an Administrator therefore you cannot access this command!", player, 255, 137, 0, true ) end end ) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end
  16. Im sure I didn't write that ':~' lol. but anyway just replace the values im sure you can figure that out urself since it's self explanatory.
  17. If your team named 'Staff' has an ACL group then its more safe to use something like : if ( isObjectInACLGroup( "user." .. getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Staff" ) ) ) then
  18. Heyo i had exactly the same problem. Its something to do with the admin panel. I have managed to give the code a small edit. Here is a fix ( just replace it in resources --> [admin] ) : http://www.mediafire.com/?iu1oc81fawbc9a5 Your welcome!
  19. Hey this is the one i made and gave to >VIP< Ages ago ( its based on that mappers script ) : local sx, sy = guiGetScreenSize () function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, left, top, clip, wordbreak, postGUI) -- Reason for this is for using more than 1 color instead of using two dxDrawText Functions local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font ) ax = ax + w color = tocolor( tonumber( "0x"..col:sub( 1, 2 ) ), tonumber( "0x"..col:sub( 3, 4 ) ), tonumber( "0x"..col:sub( 5, 6 ) ), 255 ) end last = e + 1 s, e, cap, col = str:find( pat, last ) end if last <= #str then cap = str:sub( last ) local w = dxGetTextWidth( cap, scale, font ) dxDrawText( cap, ax, ay, ax + w, by, color, scale, font, left, top, clip, wordbreak, postGUI ) end end function startMusic() outputChatBox ("#00aa46[RADIO] #ffffffPress #00aa46'R' #ffffffto Listen To The Radio", 255,137,0, true ) setRadioChannel(0) song = playSound ("http://www.181.fm/asx.php", true) setSoundVolume(song,0) end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(song,1) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) function renderPlayerJoined ( ) dxDrawColorText(listening,sx/4, sy/23,sx,sy,tocolor(255,255,255),1.3,"sans","center","top",true,true,false) end listening = "#00aa46[RADIO] #ffffffYou are currently #00aa46listening #ffffffto the radio" addEventHandler ( "onClientRender", root, renderPlayerJoined ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderPlayerJoined ) end ,3000,1 ) if ( renderPlayerJoined ) then removeEventHandler ( "onClientRender", root, renderShit ) end else setSoundVolume(song,0) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) function renderShit ( ) dxDrawColorText(notlistening,sx/4, sy/23,sx,sy,tocolor(255,255,255),1.3,"sans","center","top",true,true,false) end notlistening = "#00aa46[RADIO] #ffffffYou are currently #00aa46not listening #ffffffto the radio" addEventHandler ( "onClientRender", root, renderShit ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, renderShit ) end ,3000,1 ) if ( renderShit ) then removeEventHandler ( "onClientRender", root, renderPlayerJoined ) end end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) bindKey("r","down",toggleSong) addEventHandler("onClientResourceStop",getResourceRootElement(getThisResource()),startMusic) My scripts are kind of messy but I hope u understood Good luck Hope I have helped.
  20. You are the boss thanks! It functions!
  21. ehm is there a way to use /ubm and to replace the map you bought with a random map? So basically like buy a random map?
  22. I have solved it for those of you who are wondering how to do it : account = user..pass mysql_escape_string( handler, sha1(user..pass) )
×
×
  • Create New...