Jump to content

mtamaster97

Members
  • Posts

    31
  • Joined

  • Last visited

Details

  • Gang
    BeastMode

mtamaster97's Achievements

Rat

Rat (9/54)

0

Reputation

  1. I fixed it already, sry, but now I have another problem I'm making cmd for changing names of T1 T2 on cw script that are display with function dxDrawColorText and when I use command like this "/tsn1 Test" it returns "nil" , here is the code: function teamSetName1(thePlayer,command,Name1) local team1x = tostring(Name1) T1Name = team1x end addCommandHandler("tsn1",teamSetName1)
  2. Hello, I'm making simple cw script and I've defined T1Score and T2Score to " " empty i mean and now I make this function which is supose to add 1 point to team wether is 1 or 2 and its always executed else statement I mean it outputs "Arguments allowed are: 1,2" but i type this "/ap 1" in ChatBox function addPoint(thePlayer,command,Team) if (Team == 1) then T1Score = T1Score + 1 elseif (Team == 2) then T2Score = T2Score + 1 else display("Arguments allowed are: 1,2") end end addCommandHandler("ap",addPoint)
  3. Man but atleast explain me what is wrong there? I don't see any mistake , i replaced source in 1,3 lines with "player" element and still don''t work I don't see any forking Idea why it shouldn't work not logic man I made few small scripts and I'm not totally noob at scripting, but idk whats wrong with this.. just tell me if u know
  4. ik whats nil lol, but aren't "source","thePlayer","player","ped" already defined at MTA Source codes? thats the whole script there I tryed this too but doesn't work accName = getAccountName (source) -- get his account name source = getAccountPlayer(theAccount) account = getPlayerAccount(source) --local admin = isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) mass = 100000 veh = getPedOccupiedVehicle (ped) --local oldmass = getVehicleHandlingProperty ( element, "mass" ) any hint? which function should I use to define source ?
  5. This is the whole code but idk why I get error 2 line = expected account at argument 1 got nil 4 line = expected element at argument 1 got nil 7 line = expected ped at argument 1 got nil accName = getAccountName (account) -- get his account name me = getRootElement() account = getPlayerAccount(source) --local admin = isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) mass = 100000 veh = getPedOccupiedVehicle (ped) --local oldmass = getVehicleHandlingProperty ( element, "mass" ) function show(msg) outputChatBox(msg,source, 0,81,255,true) end function turnOn(player, cmd, option) if option == "yes" then function babaking_tankYes ( me ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) and veh then bindKey ( me, "handbrake" or "space", "both", function(key,state) if state == "down" then setVehicleHandling ( veh, "mass", mass ) setVehicleHandling ( veh, "brakeDeceleration", mass ) show(tostring(getVehicleHandlingProperty ( element, "mass" ))) elseif state == "up" then setVehiceHandling (veh, "mass", true) setVehicleHandling ( veh, "brakeDeceleration", true ) show(tostring(getVehicleHandlingProperty ( element, "mass" ))) end end) addEventHandler ( "onResourceStart", getRootElement(), babaking_tankYes ) elseif not veh then return false end end elseif option == "no" then function babaking_tankNo ( me ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) and veh then bindKey ( me, "handbrake", "both", function(key,state) if state == "down" then setVehicleHandling ( veh, "mass", true ) show(tostring(getVehicleHandlingProperty ( element, "mass" ))) elseif state == "up" then setVehiceHandling (veh, "mass", true) show(tostring(getVehicleHandlingProperty ( element, "mass" ))) end end) addEventHandler ( "onResourceStart", getRootElement(), babaking_tankNo ) elseif not veh then return false end end else return false end end addCommandHandler("fpskickon", turnOn) function getVehicleHandlingProperty ( element, property ) if isElement ( element ) and getElementType ( element ) == "vehicle" and type ( property ) == "string" then local handlingTable = getVehicleHandling ( element ) local value = handlingTable[property] if value then return value end end return false end
  6. hello here is the code that i need to fix function topmap( player, command ) local map = getResourceName ( exports['mapmanager']:getRunningGamemodeMap ( ) ) local tableOrder = { } for i, v in ipairs ( getAccounts ( ) ) do table.insert ( tableOrder, { name = getAccountData ( v, "nick") or getAccountName(v), data = getAccountData ( v, map) or 0 } ) end table.sort ( tableOrder, function ( a, b ) return ( tonumber ( a.data ) or 0 ) > ( tonumber ( b.data ) or 0 ) end ) triggerClientEvent ( "returnTable", getRootElement(), tableOrder ) end addEventHandler ( "onMapStarting", root, topmap) function refresh(thePlayer) local account = getPlayerAccount(source) setAccountData(account, "nick", getPlayerName(source) ) end addEventHandler("onPlayerConnect", getRootElement(), refresh) addEventHandler("onPlayerWasted", getRootElement(), refresh) addEventHandler("onPlayerChangeNick", getRootElement(), refresh) addEventHandler("onPlayerLogin", getRootElement(), refresh) my friend gave me but it doesn't store wins nowhere he don't know how to do it either
  7. can u fix the code above? cuz I bought this resource and it doesn't work. guy that sold me that deleted me on skype and I don't understand what u mean by checking each index. If anyone have bit of time to fix it I 'd appreciate that
  8. ERROR: topwins/topc.lua:28: attempt to index local 'top' (a nill value)
  9. Can someone tell me whats wrong with this code?? Client.lua: topTable = { } addEvent ( "returnTable", true ) addEventHandler ( "returnTable", getRootElement(), function ( newTable ) topTable = newTable setTimer(removeEventHandler,5000,1,"onClientRender", getRootElement(), renderMapWins) end ) local winners = { } local localData = { } local mapName = "" local state = false local sx, sy = guiGetScreenSize ( ) local x,y = guiGetScreenSize ( ) function renderMapWins ( ) if ( state ) then dxDrawRectangle ( x-250, 60, 240, 200, tocolor(0,0,0,180), false ) dxDrawRectangle ( x-250, 60, 240, 26, tocolor(255, 0, 0, 200), false ) dxDrawText ( tostring ( mapName ), x-245, 80, 250, 60, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "center", false, false, true, false, false ) for index = 1, 8 do local top = topTable [ index ] dxDrawText ( "\n\n\n\n\n#FF0000".. tostring ( index ) ..". #FFFFFF".. tostring( top.name ), x-245, ( 20 * index ), 250, 120, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, true, false ) dxDrawText ( "\n\n\n\n\n"..tostring ( top.data ).." #ff0000wins", x-50, ( 20 * index ), x-15, 40, tocolor(255, 255, 255, 255), 1.00, "default-bold", "right", "top", false, false, true, true, false ) end else removeEventHandler ( "onClientRender", root, renderMapWins ) end end addEvent ( "onClientMapStarting", true ) addEventHandler ( "onClientMapStarting", root, function ( mapInfo ) mapName = mapInfo.name addEventHandler ( "onClientRender", root, renderMapWins ) bindKey ( "F5", "down", showMapWins ) state = true --triggerServerEvent ( "mapWins:requestList", localPlayer ) hideTimer = setTimer ( function ( ) if ( state ) then showMapWins ( ) end end ,10000, 1 ) end ) addEvent ( "mapWins:returnList", true ) addEventHandler ( "mapWins:returnList", root, function ( winners_ ) winners = { } localData = { } for index, winner in ipairs ( winners_ ) do if ( index < 11 ) then table.insert ( winners, { serial = winner.serial, nick = top.name, wins = top.kill } ) end if ( winner.serial == getPlayerSerial ( ) ) then localData = { rank = index, nick = winner.nick, wins = winner.wins } end end end ) addEvent ( "onClientMapStopping", true ) addEventHandler ( "onClientMapStopping", root, function ( ) removeEventHandler ( "onClientRender", root, renderMapWins ) winners = { } localData = { } unbindKey ( "F5", "down", showMapWins ) state = false mapName = "" if ( isTimer ( hideTimer ) ) then killTimer ( hideTimer ) end end ) function showMapWins ( ) state = ( not state ) removeEventHandler ( "onClientRender", root, renderMapWins ) if ( state ) then --triggerServerEvent ( "mapWins:requestList", localPlayer ) addEventHandler ( "onClientRender", root, renderMapWins ) else if ( isTimer ( hideTimer ) ) then killTimer ( hideTimer ) end end end addEvent ( "mapWins:show", true ) addEventHandler ( "mapWins:show", root, function ( ) if ( not state ) then showMapWins ( ) end end ) Server.lua: function topmap( player, command ) local map = getResourceName ( exports['mapmanager']:getRunningGamemodeMap ( ) ) local tableOrder = { } for i, v in ipairs ( getAccounts ( ) ) do table.insert ( tableOrder, { name = getAccountData ( v, "nick") or getAccountName(v), data = getAccountData ( v, map) or 0 } ) end table.sort ( tableOrder, function ( a, b ) return ( tonumber ( a.data ) or 0 ) > ( tonumber ( b.data ) or 0 ) end ) triggerClientEvent ( "returnTable", getRootElement(), tableOrder ) end addEventHandler ( "onMapStarting", root, topmap) function refresh(thePlayer) local account = getPlayerAccount(source) setAccountData(account, "nick", getPlayerName(source) ) end addEventHandler("onPlayerConnect", getRootElement(), refresh) addEventHandler("onPlayerWasted", getRootElement(), refresh) addEventHandler("onPlayerChangeNick", getRootElement(), refresh) addEventHandler("onPlayerLogin", getRootElement(), refresh)
  10. What to use and how to use it to create a Top Wins each map for players, u know what I mean u press "F5" and then apears dxRectangle with map name in header and 5 players names with their wins next to their names and the 6th line are wins of the client. but I don't have any Idea how to do it.
  11. Hello guys, I'm asking for help about replacing textures like nos textures, fire texture (when veh have 0 hp) ok here is a link of an image http://www.gtagarage.com/mods/screen.php?s=22884 I want to replace that in my MTA SA server, is it possible and if it is how ?
  12. Yes, can u give me a hint or something else?
  13. Oh, I've problem here.. Did anyone have idea how to get wins of all maps?
×
×
  • Create New...