-
Posts
503 -
Joined
-
Last visited
Everything posted by TorNix~|nR
-
same 15: attempt to concatenate local 'targetPlayerName' (a boolean / userdata value) addCommandHandler("sendmoney",function(player,cmd,targetPlayer,money) money = tonumber(money) and math.floor(tonumber(money)) or nil if not (targetPlayer) or not (money) then outputChatBox("use /" .. cmd .. " [Player] [Amount]",player,255,0,0,true) else local targetPlayerName = getPlayerFromName (targetPlayer) if targetPlayer then if (targetPlayer==player) then outputChatBox(" You cant give money to yourself.",player,255,0,0,true) elseif money <= 0 then outputChatBox(" Minimum ammount is 0.",player,255,0,0,true) elseif getPlayerMoney(player) >= money then takePlayerMoney(player,money) givePlayerMoney(targetPlayerName,money) outputChatBox ( "You gave " .. targetPlayerName .. " " .. money .. "$", player, 0, 255, 0, true) -- THIS LINE outputChatBox ( "" .. player .. "gave you " .. money .. "$", targetPlayer, 0, 255, 0, true ) -- THIS LINE else outputChatBox(" You dont have enough money.",player,177,9,45,true) end end end end)
-
guys the script works fine, but the line 16 and 17 have problem :attempt to concatenate local 'targetPlayer' (a userdata value) help please? addCommandHandler("sendmoney",function(player,cmd,targetPlayer,money) money = tonumber(money) and math.floor(tonumber(money)) or nil if not (targetPlayer) or not (money) then outputChatBox("use /" .. cmd .. " [Player] [Amount]",player,255,0,0,true) else local targetPlayer = getPlayerFromName (targetPlayer) local sourcename = getPlayerName (source) if targetPlayer then if (targetPlayer==player) then outputChatBox(" You cant give money to yourself.",player,255,0,0,true) elseif money <= 0 then outputChatBox(" Minimum ammount is 0.",player,255,0,0,true) elseif getPlayerMoney(player) >= money then takePlayerMoney(player,money) givePlayerMoney(targetPlayer,money) outputChatBox ( "You gave " .. targetPlayer .. " " .. money .. "$", source, 0, 255, 0, true) -- THIS LINE outputChatBox ( "" .. sourcename .. "gave you " .. money .. "$", targetPlayer, 0, 255, 0, true ) -- THIS LINE else outputChatBox(" You dont have enough money.",player,177,9,45,true) end end end end)
-
in my opinion VPS is more better.
-
:attempt to concatenate local 'targetPlayer' (a userdata value)
-
@TheMOG, the final help please? I don't know why the line 16 doesnt work help? addCommandHandler("sendmoney",function(player,cmd,targetPlayer,money) money = tonumber(money) and math.floor(tonumber(money)) or nil if not (targetPlayer) or not (money) then outputChatBox(syntax.." /" .. cmd .. " [Player] [Amount]",player,255,0,0,true) else local targetPlayer = getPlayerFromName (targetPlayer) local sourcename = getPlayerName (source) if targetPlayer then if (targetPlayer==player) then outputChatBox(" You cant give money to yourself.",player,255,0,0,true) elseif money <= 0 then outputChatBox(" Minimum ammount is 0.",player,255,0,0,true) elseif getPlayerMoney(player) >= money then takePlayerMoney(player,money) givePlayerMoney(targetPlayer,money) outputChatBox ( "You gave " .. targetPlayer .. " " .. money .. "$", source, 0, 255, 0, true) -- LINE outputChatBox ( "" .. sourcename .. "gave you " .. money .. "$", targetPlayer, 0, 255, 0, true ) -- LINE else outputChatBox(" You dont have enough money.",player,177,9,45,true) end end end end)
-
Guys there is a problem with this script please help! for example I can use /sendmoney "name" -9000 and I take 9000$ from his money any help please? function sendmoney (source, commandname, target, ammount) local sourcemoney = getPlayerMoney (source) local sourcename = getPlayerName ( source ) local targetp = getPlayerFromName (target) if targetp then if sourcemoney >= tonumber (ammount) then takePlayerMoney (source, ammount) givePlayerMoney (targetp, ammount) outputChatBox ( "You gave " .. target .. " " .. ammount .. "$", source, 0, 255, 0) outputChatBox ( "" .. sourcename .. "gave you " .. ammount .. "$", targetp, 0, 255, 0 ) else outputChatBox ( "You do not have enough money", source, 0, 255, 0 ) end else outputChatBox ( "Invalid target specified", source, 0, 255, 0 ) end end addCommandHandler("sendmoney", sendmoney)
-
Hello guys, please I need help! my admin panel has a problem, it's as default, I do not edit anything when I give a mute, it doesn't unmute with the time, it gives mute for permanent time. Help please?
-
this is a client-side. addCommandHandler ( "turnmodson", function ( ) if ( not Downloader.gotResponse ) then outputChatBox ( "We're still waiting for the server to accept our request. Please wait", 255, 255, 0 ); return false; end for i, v in pairs ( Downloader.Mods ) do Mods.SetModEnabled ( i, true ); end end );
-
I made a one by the command, but I do not know how to make it with for example resourcestart or playerlogin.. help please? addCommandHandler ( "turnmodson", function ( ) if ( not Downloader.gotResponse ) then outputChatBox ( "We're still waiting for the server to accept our request. Please wait", 255, 255, 0 ); return false; end for i, v in pairs ( Downloader.Mods ) do Mods.SetModEnabled ( i, true ); end end );
-
Hello guys, I have GTA IV on my steam account, but it's boring ( just make a boring lobby or join normal servers ) I want that custom servers like mta, I search on google and I found this: IV:MP GTA free is it real? is it by the mta? we can play it and make servers? the website is: http://gta-ivmp.com
-
there is no errors on debugscript
-
Guys, it works, thank you so much
-
Hello guys, I have a problem on my script, it's job, when the blip AttachedTo, it stay only few seconds, then it destoryed, I don't know why, help please? Client: local client = getLocalPlayer( ) local rootElement = getRootElement() local marker = nil local blip = nil addEvent("bus_set_location",true) addEventHandler("bus_set_location",rootElement, function (x, y, z) marker = createMarker(tostring(x), tostring(y), tostring(z)-1, "cylinder", 3.5, 255, 255, 0, 170) blip = createBlipAttachedTo ( marker, 41, 2, 255, 255, 255, 255, 0, 65535, localPlayer ) addEventHandler("onClientMarkerHit",marker,onBusStopHit) end) function onBusStopHit(hitPlayer) if not hitPlayer == client then return end triggerServerEvent("bus_finish",client,client) if isElement(blip) then destroyElement(blip) end if isElement(marker) then removeEventHandler("onClientMarkerHit",marker,onBusStopHit) destroyElement(marker) end end addEventHandler("onClientVehicleExit",rootElement, function () if isElement(marker) then removeEventHandler("onClientMarkerHit",marker,onBusStopHit) destroyElement(marker) end if isElement(blip) then destroyElement(blip) end end) Server: local rootElement = getRootElement() local busses = {[431] = true, [437] = true} local busTable = { [1]={1812.65198, -1889.86047, 13.41406}, [2]={1825.22791, -1635.03711, 13.38281}, [3]={1855.01685, -1430.47449, 13.39063}, [4]={1732.81580, -1296.87122, 13.44294}, [5]={1473.19226, -1295.77124, 13.48315}, [6]={1443.60376, -1498.26660, 13.37650}, [7]={1426.37280, -1716.12439, 13.38281}, [8]={1315.06909, -1656.43799, 13.38281}, [9]={1359.06250, -1432.39734, 13.38281}, [10]={1169.82983, -1392.34473, 13.41728}, [11]={930.76508, -1392.92627, 13.26561}, [12]={815.24756, -1317.91345, 13.44460}, [13]={585.04199, -1320.53748, 13.40609}, [14]={526.99365, -1624.20361, 16.63225}, } function getNewBusLocation(thePlayer, ID) local x, y, z = busTable[ID][1], busTable[ID][2], busTable[ID][3] triggerClientEvent(thePlayer,"bus_set_location",thePlayer,x,y,z) end function onVehicleEnter(thePlayer) if not busses[getElementModel(source)] then return end local x, y, z = getNewBusLocation(thePlayer, 1) setElementData(thePlayer,"busData",1) end addEventHandler("onVehicleEnter",rootElement,onVehicleEnter) addEvent("bus_finish",true) addEventHandler("bus_finish",rootElement, function (client) if not isPedInVehicle(client) then return end if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end givePlayerMoney(client, 75) outputChatBox("Successfully, you get $75, go get more!", source, 0, 255, 0, true) setTimer(outputChatBox,5000,1,"It will never stop of job, when you're tired, just quit from vehicle.",source,0,255,0,true) if #busTable == tonumber(getElementData(client,"busData")) then setElementData(client,"busData",1) else setElementData(client,"busData",tonumber(getElementData(client,"busData"))+1) end getNewBusLocation(client, tonumber(getElementData(client,"busData"))) end)
-
this works but there is a little problem, it makes it for all pickups, even on other scripts, I have other pickups for example of wanted level, all pickups become that text Help?
-
Hello guys, I have a problem on my script, the first pickup worked, but the second is not working, also I'm gonna add more, so I need help please? local aPickup = createPickup ( -2661.68, 627.43, 14.45, 3, 1239, 1000 ) and createPickup ( -2657.33, 631.34, 14.45, 3, 1239, 1000 ) function aa ( source ) cancelEvent() outputChatBox("test", source, 0, 255, 255, true) end addEventHandler ( "onPickupHit", aPickup, aa )
-
Done! guys I fix it, the problem was on this script https://community.multitheftauto.com/index.php?p=resources&s=details&id=990 Ty!
-
Not work I want when a player login, turn all the mods automatically, that's what I need, a help please?
-
@pa3ck thank you but please can you explain more for me? which line to modify on cMods.lua ?