-
Posts
6,063 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
so how to fix the code ! Learn lua pfff, setElementModel ( player, allSkins[math.random(#allSkins)] )
-
btw what will this be? a userdata? can I check with this, if the one that did send it, is still in the server?
-
it is as long the elementdata is set in the right way.
-
well it doesn't matter if is a zip or a folder, it can be done that way.
-
local levelTextColor = tocolor(0,255,0,255) local levelColor = tocolor(255,255,0,255) local function showLevel() local theLevel = getElementData(localPlayer, "Level") or 0 dxDrawText("Current Level:", x*0.78, y*0.46, 0, 0, levelTextColor, 3) dxDrawText("" ..theLevel, x*0.905, y*0.46, 0, 0, levelcolor, 3) end function HandleTheRendering ( ) addEventHandler("onClientRender", getRootElement(), showLevel) end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering) if it shows 0 then the level is 0 or the level haven't been set successfully. UPDATED AT 3-8-2013
-
well I still prefer to use destroyElement, cause when a new player joins the server he will see the marker. In my opinion it is only a handy function when you just want to hide it for a single or a few players.
-
I think so, it returns 0, why would it not return another value?
-
with how many people are you racing?
-
function getOtherPlaces(vehicle) local rank = exports["race"]:getPlayerRank(source) if rank then outputChatBox("Player rank: " .. rank) end end addEventHandler("onPlayerRaceWasted",getRootElement(),getOtherPlaces) Updated Reasons why it did not work: - non defined player, (source) - wrong event: onRacePlayerWasted > onPlayerRaceWasted - defined the vehicle as rank
-
Define source as argument isn't very smart. Source only gets created by events as solidsnake said. A addCommandHandler don't have any source if you using it. server side addCommandHanlder("test", function (player) end) -- VS -- addEventHandler("onPlayerWasted",root, function() local player = source end)
-
well as far I know mta don't see a zip folder as a zip. He sees it simple as a folder, did you ever seen zip folders in your resource-cache ? no? cause they are unzipped. When you copie the files out of a zip folder, with the function: fileCopy and you put them in a new folder. (new folders,only possible at serverside) https://wiki.multitheftauto.com/wiki/FileCopy You are simply unzipping the folder.
-
I give you a 3/5, for the low quality and unread able text. Also when you make a video like this, show us all the loops and when you should use them. Cause they all have their own ability's.
-
well there is a function that can get the file size. So if you would download files manually then you know what your download size is. Not sure if it support all kind of files. https://wiki.multitheftauto.com/wiki/FileGetSize
-
How to use this function with an 'if' in client-side?
IIYAMA replied to EstrategiaGTA's topic in Scripting
client local money = getPlayerMoney ( ) if money > 5000 then outputChatBox("money is higher then 5000") end -
np. BTW:(I don't know if you know this, just as extra info) When you want to check if a table is empty, with keys like that. Use: next(table) local myTable = { ["marker"]=true} if #myTable > 0 then outputChatBox("# is working") -- no it isn't end if next(myTable) then outputChatBox("next is working") -- yes it is end
-
you know ipairs can only check numeric stuff? Why are you trying to use ipairs with a table with markers as key?
-
all client side? or did you put client side and serverside in 1 file? server function tila4(thePlayer, command) outputChatBox("Onnistui", thePlayer, 0,255,0) setElementData ( thePlayer, "metroMatkustaja", true ) end addCommandHandler("amission5", tila4 ) function tila3(thePlayer, command) outputChatBox("Onnistui", thePlayer, 0,255,0) setElementData ( thePlayer, "metroMatkustaja", false ) end addCommandHandler("amission6", tila3 ) Or you can choose for clientside. client function tila4(command) outputChatBox("Onnistui", 0,255,0) setElementData ( localPlayer, "metroMatkustaja", true ) end addCommandHandler("amission5", tila4 ) function tila3(command) outputChatBox("Onnistui", 0,255,0) setElementData ( localPlayer, "metroMatkustaja", false ) end addCommandHandler("amission6", tila3 )
-
Line 4: for i,v in pairs(SXDueloE) do That should work reading the table
-
lastHit = { } local function whokilledvic ( thehitted ) local thehitter = source if thehitter ~= victimvehicle then if thehitted == victimvehicle then lastHit [ thehitted ] = thehitter outputChatBox( " Data Stored! ", root ) --i get this check output end end end addEvent ( "whowasit", true ) addEventHandler ( "whowasit", root, whokilledvic ) --- what is victim2 ? local function isthevictimkilled() if isElement( victim2 ) then if isPedDead ( victim2 ) then local lastHitter = lastHit [ source ] if lastHitter then -- check if there is data from the table local player = getVehicleOccupant(lastHitter) if player then -- check if there is a player in the vehicle local hittername = getPlayerName(player) --bad argument @ getVehicleOccupant outputChatBox(" The last hitter was " ..hittername , root ) end end end end end addEventHandler ( "onPlayerWasted", root, isthevictimkilled ) I fixed some of the code, but I think it is more handy to use the player as key and the vehicle as data. this code I posted will not work, because you can't find players within a table with only vehicles as key. You have now: lastHit[vehicle]= player But I will recommend you to create the table like this: lastHit[player]= vehicle Because vehicles can be replaced, and the table can be cleared with the event: "onPlayerQuit".
-
Why check the local player, when he is the only player that can execute the event? function manualSpectate() bindKey(SPECTATE_KEY, "up", spectator) end Something like this or what?