Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. 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
  2. client local money = getPlayerMoney ( ) if money > 5000 then outputChatBox("money is higher then 5000") end
  3. IIYAMA

    Return nil

    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
  4. IIYAMA

    Return nil

    yes
  5. IIYAMA

    Return nil

    you know ipairs can only check numeric stuff? Why are you trying to use ipairs with a table with markers as key?
  6. 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 )
  7. IIYAMA

    Return nil

    Line 4: for i,v in pairs(SXDueloE) do That should work reading the table
  8. 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".
  9. 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?
  10. interesting idea, It is your idea so you should development it in the first place, if there are any problems you can pm me any time. (my response is sometimes quick and sometimes it can take 1/2 days) I wish you good luck!
  11. I will recommend you only use timers, when there is no other way. If you want to go for performance then: local lastHit = getTickCount() local function collision ( thehitted ) local tickTime = getTickCount() if thehitted and tickTime > lastHit and getElementType ( thehitted ) == "vehicle" then if source == getPedOccupiedVehicle(getLocalPlayer()) then thehitted2 = thehitted triggerServerEvent ( "whowasit", source, thehitted2 ) lastHit = tickTime+1000 end end end addEventHandler("onClientVehicleCollision", root, collision) Use gametime(getTickCount()) to check if amount of time has been past. isn't 5 seconds very long? This is for DD right?
  12. np. btw something I did noticed about this event. The event onClientVehicleCollision can be triggered a lot (just for a single scratch), if this player may have bad connection there is a chance that he will be timed out very quickly. So I recommend you to choose for a minimal force before sending info to the server.
  13. btw is your operator ok? Because when you are level 17 it probably isn't going to working. if tonumber(getElementData(thePlayer, "Level") or 0 ) >= 15 then
  14. Probably his reason is because it is easy to decompile. Cause it is.
  15. When you use output to new files, you have to > * < replace that with the new name. (that is just normal for somebody that can work a little bit with a pc.....) But I set it at overwrite-files + backup it is easier and direct use able.
  16. maybe you should check your folder....... or press again compile.
  17. Try this one: http://www.mediafire.com/?5et60em7mog3yms
  18. After I compiled my code the code size got bigger, of course cause of all extra letters etc. But will performance of compiled code be better then non compiled code?
  19. --serverside function whokilledvic ( thehitted ) local thehitter = source local hitterp = getPlayerName(getVehicleOccupant( thehitter )) local hittedp = getPlayerName(getVehicleOccupant( thehitted )) setVehicleColor ( thehitter , 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255 ) outputChatBox( hitterp.. " > hitted > " ..hittedp, root ) end addEvent ( "whowasit", true ) addEventHandler ( "whowasit", root, whokilledvic )
  20. Why don't you check that with the function I gave you !!!!!
  21. Maybe you should check that.
  22. by the way, read the syntax clearly. You don't have to use an extra export.
  23. IIYAMA

    Save on death

    function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if not isGuestAccount ( playeraccount ) then -- if ( playeraccount ) then Well you didn't told me your problem. ever heard about loops? How many lines are you willing to write O_o
  24. setBotTeam don't have to be exported?
  25. set them in the same team.
×
×
  • Create New...