-
Posts
298 -
Joined
-
Last visited
Everything posted by GanJaRuleZ
-
go to wiki , and search there
-
o.0 There are 2 separate files client.lua addEvent( "playByeSound", true ) addEventHandler( "playByeSound", root, function() playSound( "byebye.mp3", false ) end ) server.lua addCommandHandler( "bye", function( thePlayer, cmd ) outputChatBox( getPlayerName( thePlayer ).." would like to say Bye Everyone!", root, 255, 0, 0 ) triggerClientEvent( root, "playByeSound", root ) end ) and you must add them in meta
-
playSoundToAll isn't an function ...
-
Hai allz. I've got this script , but when im muted and i change the nick , it outputs how many players are in the server ex : im muted and i change my nick , this script disallows it , but it outputchatbox the players amount , ex there are 5 players in server , this script outputs it 5 times.. ( Sry for english , im very stressed ) function onClientChangeHisNick() local players = getElementsByType ( "player" ) for k,v in ipairs(players) do if isPlayerMuted ( source ) then outputChatBox ( "#FF0000You're not allowed to change you're nick , while you're muted!", source, 255, 255, 255, true ) cancelEvent() else outputChatBox ( "#99FF00Nick successfully changed!", source, 255, 255, 255, true ) end end end addEventHandler ( "onPlayerChangeNick", getRootElement(), onClientChangeHisNick )
-
Well , you can name the function spawnInfernus and there you can write executeCommandHandler("spawnInfernus" , source)
-
@csmit195 : I was that someone @xtherpr0mise : Well , next time look better of the script addEvent("onPlayerFinish",true) addEventHandler("onPlayerFinish",getRootElement(), function (rank,finishtime) local account = getPlayerAccount(source) if isGuestAccount(account) then outputChatBox("You must be logged in to get the points and cash" , source, 255, 0, 0, true) else if rank == 1 then givePlayerMoney(source,1000) setAccountData( account, "Points", +3 ) end if rank == 2 then givePlayerMoney(source,500) setAccountData( account, "Points", +2 ) -- removed the w end -- serverside
-
function hit ( pla, source ) if getElementType ( pla ) == "player" then if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then outputChatBox ( "Welcome, "..getPlayerName(pla).."!", pla, 0, 150, 0 ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) if ( doesPedHaveJetPack ( pla ) ) then removePedJetPack ( pla ) outputChatBox ( "***Admin Area***", pla, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." has entered the Admin Area!", g_root, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." please left the Admin Area!", pla, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) function ColShapeHit ( thePlayer, matchingDimension ) if getElementType ( pla ) == "player" then if isElementWithinColShape(pla,g_base_col) == true then if ( doesPedHaveJetPack ( pla ) ) then removePedJetPack ( pla ) end end end addEventHandler ( "onClientRender", ColShapeHit ) try it
-
local musics = { [ 'David Guetta - Where Dem Girls At' ] = { 'gfx/music/dg-wdga.mp3' }, [ 'Coldplay - Paradise' ] = { 'gfx/music/cp-pd.mp3' }, [ 'Coldplay - Viva la Vida' ] = { 'gfx/music/cp-vlv.mp3' }, [ 'Ana Malhoa - Danza Kuduro' ] = { 'gfx/music/am-dk.mp3' }, [ 'No Name - Jamming' ] = { 'gfx/music/jm.mp3' }, [ 'Klaas - Make you Feel' ] = { 'gfx/music/ks-myf.mp3' }, [ 'No Name - Vitality' ] = { 'gfx/music/vy.mp3' }, [ 'Basshunter - All I ever wanted' ] = { 'gfx/music/bh-aiew.mp3' }, [ 'Whiz Khalifa - Black and Yellow ( Ft. Snoop Dogg, Juicy J & T-Pain )' ] = { 'gfx/music/wk-bay.mp3' }, [ 'Skrillex - My name is Skrillex ( Remix )' ] = { 'gfx/music/sx-mnis.mp3' }, [ 'Italobrothers - Stamp on the Ground' ] = { 'gfx/music/ib-sotg.mp3' }, [ 'Madcon - Freaky like Me' ] = { 'gfx/music/mc-flm.mp3' }, [ 'Cut the Music - Greatest Deejay' ] = { 'gfx/music/ctm-gd.mp3' }, [ 'No Name - Time`s Vortex' ] = { 'gfx/music/tv.mp3' }, [ 'Manian - Welcome to the Club' ] = { 'gfx/music/wttc.mp3' }, [ 'Bon Jovi - It`s my Life' ] = { 'gfx/music/iml.mp3' }, [ 'Example - Changed the Way you Kissed Me' ] = { 'gfx/music/ctwykm.mp3' }, [ 'Example - Kickstart ( Bar 9 Remix )' ] = { 'gfx/music/e-ksb9rx.mp3' } } local theMusicList = unpack(musics) function showMusic () if (music_grid_column) then local row1 = guiGridListAddRow ( music_grid ) guiGridListSetItemText( music_grid, row1, music_grid_column, theMusicList, false, false ) end end -- Idk if it will work
-
function hit ( pla, source ) if getElementType ( pla ) == "player" then if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then outputChatBox ( "Welcome, "..getPlayerName(pla).."!", pla, 0, 150, 0 ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) if ( doesPedHaveJetPack ( pla ) ) then removePedJetPack ( pla ) outputChatBox ( "***Admin Area***", pla, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." has entered the Admin Area!", g_root, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." please left the Admin Area!", pla, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) function ColShapeHit ( thePlayer, matchingDimension ) if isElementWithinColShape(source,g_base_col) == true then if ( doesPedHaveJetPack ( thePlayer ) ) then removePedJetPack ( thePlayer ) end end end addEventHandler ( "onClientRender", ColShapeHit ) -- Complete script REMEMBER:SERVER-SIDE
-
function DestructionWin( ) local alivePlayers = getAlivePlayers( ) if #alivePlayers == 1 then local account = getPlayerAccount( alivePlayers[1] ) if account then if isGuestAccount( account ) then return end setAccountData( account,"Race Wins",tostring( getAccountData( account,"Race Wins" ) or 0 ) +1 ) end local playername = getPlayerName( alivePlayers[1] ) outputChatBox ( "#FFA824The player " .. playername .. " won!", root, 255, 255, 255, true ) end end addEventHandler( "onPlayerWasted", root, function( ) local account = getPlayerAccount( source ) if account then if isGuestAccount( account ) then return end setAccountData( account,"Race Loses",tostring( getAccountData( account,"Race Loses" ) or 0 )+1 ) end end ) function ratioCalculator( player ) local KDR_DECIMAL_PLACES = 2 local account = getPlayerAccount( player ) if account then if isGuestAccount( account ) then return end local raceLoses = getAccountData( account,"Race Loses" ) if raceLoses == 0 then setAccountData( account, "Ratio", "-") else local kdr = round( getAccountData( account, "Race Wins" ) / raceLoses, KDR_DECIMAL_PLACES ) setAccountData( account, "Ratio", tostring(kdr)) end end end addEventHandler( "onPlayerLogin",root, function ( ) local account = getPlayerAccount( source ) if account then if isGuestAccount( account ) then return end local raceWins = getAccountData( account,"Race Wins" ) or 0 local raceLoses = getAccountData( account,"Race Loses" ) or 0 local ratio = getAccountData( account, "Ratio" ) or 0 setElementData( source,"Race Wins",tostring( raceWins ) ) setElementData( source,"Race Loses",tostring( raceLoses ) ) setElementData( source,"Ratio",tostring( ratio ) ) end end ) function publicstatsinfo( ) if isElement( source ) then local account = getPlayerAccount( source ) if account then if isGuestAccount( account ) then return end local askdname = getPlayerName( source ) local wins = getAccountData( account, "Race Wins" ) or 0 local loses = getAccountData( account, "Race Loses" ) or 0 local ratio = getAccountData( account, "Ratio" ) or 0 if loses and wins then outputChatBox("#FFA824*" .. tostring( askdname ) .. " won " .. tostring( wins ) .. " times and he lost " ..tostring( loses ).. " times, his ratio is " .. tostring( ratio ) %, root, 255, 12, 15, true) else outputChatBox("#FFA824*" .. tostring( askdname ).. " doesen't losed or won " , root, 255, 12, 15, true) end end else outputChatBox( "Error source is not player" ) end end addEvent( "stats", true ) addEventHandler( "stats", root, publicstatsinfo ) function checkCommand( message, messageType ) if messageType == 0 then if message == "!stats" then triggerEvent( "stats", source ) cancelEvent( ) end end end addEventHandler( "onPlayerChat", root, checkCommand ) I decided to remove time played , but now i have another error : SCRIPT ERROR: stats\stats:66: unexpected symbol near ','
-
Edited , i pressed accidentaly submit instead of Full Editor
-
function ColShapeHit ( thePlayer, matchingDimension ) if isElementWithinColShape(source,nameofcol) == true then if ( doesPedHaveJetPack ( thePlayer ) ) then removePedJetPack ( thePlayer ) end end end addEventHandler ( "onClientRender", ColShapeHit )
-
*GanJaRulez won 0 times and he/she lost 2 times, his/her ratio is 0 and the total time played he/she is: 0:0:0 *GanJaRulez won 0 times and he/she lost 2 times, his/her ratio is 0 and the total time played he/she is: 0:0:0 First was made when i started the resource The second is after 10 seconds.. , so it doesen't counts...
-
As you see here : http://imageshack.us/photo/my-images/85 ... 50831.png/ I losed , but it still outputs that i didn't losed or won..
-
function hit ( pla, source ) if getElementType ( pla ) == "player" then if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then outputChatBox ( "Welcome, "..getPlayerName(pla).."!", pla, 0, 150, 0 ) else setElementData ( pla, "inRestrictedArea", "true" ) triggerClientEvent ( pla, "destroyTrepassor", g_root, pla ) if ( doesPedHaveJetPack ( pla ) ) then removePedJetPack ( pla ) outputChatBox ( "***Admin Area***", pla, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." has entered the Admin Area!", g_root, 255, 0, 0 ) outputChatBox ( "* "..getPlayerName(pla).." please left the Admin Area!", pla, 255, 0, 0 ) end end end end addEventHandler ( "onColShapeHit", g_base_col, hit ) try it , changed from source -- to pla
-
Ye , there are not any errors , but the time played is still nil:nil:nil
-
There are some errors : WARNING: stats\stats.lua:72: Bad argument @ 'setElementData' [Expected element at argument 1] WARNING: stats\stats.lua:73: Bad argument @ 'setElementData' [Expected element at argument 1] WARNING: stats\stats.lua:74: Bad argument @ 'setElementData' [Expected element at argument 1] Btw , i don't want to add them on scoreboard .
-
@myonlake : There are many errors @Kenix : Thanks , no errors , but when i write !stats , at the time played it outputs : nil:nil:nil. Can anyone help?
-
Btw , why nobody saw that the resource is stolen ? After an hour of "googling" I managed to make this what people call localchat This line means that he made it.. but the script is aleardy posted here : https://community.multitheftauto.com/index.php?p= ... ls&id=2801 That script chat_range=100 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"u","down","chatbox","LocalChat") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"u","down","chatbox","LocalChat") end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) local r,g,b = getTeamColor(getPlayerTeam(player)) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("(LocalChat)"..nick..": #ffffff"..msg,v,r,g,b,true) end end end addCommandHandler("LocalChat",onChat) His script : chat_range=75 addEventHandler("onPlayerJoin",getRootElement(), function () bindKey(source,"u","down","chatbox","NearbyChat") end) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"u","down","chatbox","NearbyChat") end end) function isPlayerInRangeOfPoint(player,x,y,z,range) local px,py,pz=getElementPosition(player) return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range end function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) local r,g,b = getTeamColor(getPlayerTeam(player)) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("(Nearby)"..nick..": #ffffff"..msg,v,r,g,b,true) end end end addCommandHandler("NearbyChat",onChat) Not many differences , huh ?
-
Ty , you too , since i haven't seen that error...
-
SCRIPT ERROR : stats\stats:41: ')' expected <to close '(' at line 19> near 'end' .. But it's aleardy closed..
-
Oh , yes , i was focused on the stats
-
function showWindow() if (guiGetVisible (music)) then guiSetVisible (music, false) showCursor (false) else guiSetVisible(music, true) showCursor (true) end end bindKey ( "F3", "down", showWindow ) Hope it works OFF: 100 posts , PFF i forgot to put [lua]
-
Well , it solved it , but now another problem.. WARNING : Loading script failed : stats\stats:18: '(' expected near 'updateTimePlayed'
