-
Posts
6,061 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
It's the limit of how many zombies that can spawn. ZombieLimit = default (217) newZombieLimit -- you have settings about this in the meta. >get("" .. getResourceName(startedResource) .. ".Zlimit")< Check if the meta settings are correct.
-
Normally illegal characters are in the name of the script. Gives a warning: my script must be: my_script or myScript or myscript Or maybe you use some glyphs that can't be read in the server.
-
Because I though that it would make the table faster.. but I think I am wrong. btw how can I subtract tables from each other? fixed. --client
-
My [gameplay] folder is still visible, and it stays visible. No magic. Not for the server. But the content of it is visible.
-
Those [ ] makes your folder invisible for the server. Because they are invisible, you can't check them or what is inside.
-
I think it is half/fixed now, because the result is "ok" Not sure if it will lagg to much when I executed every 1 min. Thank you, for keep an eye on the mistakes I made, maybe they are still there. yes, take a look at it pls. Is table.sort() needed?
-
If I do that, it means it is still inside the table. I probally confused you with "vehicleInTheWorld", it was just a testhing to help with removing those vehicles. If I set the Vehicle to nil, will it then be out of the table? I getting little bit confused, code is let we say inefficient, but it almost works. --local removeNumberClient = {} local weaponObjectsVeh = {} function filterTableVeh() outputChatBox(#weaponObjectsVeh)--now I can do that... it works. for c, vehicle in pairs (weaponObjectsVeh) do if not vehicle then return end if not isElement( vehicle ) then outputChatBox ("a object is gone") -- local rangeVeh = #weaponObjectsVeh local removeNumber = nil for i=0,#weaponObjectsVeh,1 do if vehicle == weaponObjectsVeh[i] then removeNumber = i end end if removeNumber then --removeNumberClient[removeNumber]= {}-- update for the client table, no index needed outputChatBox(removeNumber) table.remove(weaponObjectsVeh,removeNumber) table.sort(weaponObjectsVeh) end else outputChatBox("spams for all existed vehicles") end end ----uit end function make_vehicle_weapon(vehicle, seat, jacked) local player = source; --local vehicle = getPedOccupiedVehicle (player) if vehicle then outputDebugString("vehicle found, IIYAMA is inside a vehicle",source) else outputDebugString("there is no vehicle, so I IIYAMA return this.",source) return end if weaponvehicles[getElementModel(vehicle)] then local tableVeh = weaponObjectsVeh[vehicle] local beReturn = false for k, picVeh in pairs (weaponObjectsVeh) do if vehicle == picVeh then beReturn = true outputChatBox("return") end end if beReturn == true then return end --table.insert(weaponObjectsVeh, vehicle) table.sort(weaponObjectsVeh) weaponObjectsVeh[#weaponObjectsVeh+1] = vehicle outputChatBox("not in table, new vehicle ",source) for k, players in pairs (getElementsByType ( "player" )) do if myPlayerData[player]["load"] then outputChatBox("trigger") triggerClientEvent(players,"addtotable",getRootElement(),vehicle) end end end end --addCommandHandler ("adds", make_vehicle_weapon) addEventHandler ("onPlayerVehicleEnter", getRootElement(), make_vehicle_weapon) finnaly it is working... and now I have too much headache to improve it -_-"
-
I have now this: function make_vehicle_weapon(vehicle, seat, jacked) local player = source; --local vehicle = getPedOccupiedVehicle (player) if vehicle then outputDebugString("vehicle found, IIYAMA is inside a vehicle",source) else outputDebugString("there is no vehicle, so I IIYAMA return this.",source) return end if weaponvehicles[getElementModel(vehicle)] then if not weaponObjectsVeh[vehicle] then outputChatBox("not in table, new vehicle",source) weaponObjectsVeh[#weaponObjectsVeh+1]=vehicle outputChatBox(#weaponObjectsVeh .. "wtf?") for k, players in pairs (getElementsByType ( "player" )) do if myPlayerData[player]["load"] then outputChatBox("trigger") triggerClientEvent(players,"addtotable",getRootElement(),vehicle) end end end end end --addCommandHandler ("adds", make_vehicle_weapon) addEventHandler ("onPlayerVehicleEnter", getRootElement(), make_vehicle_weapon) But how can I get the position when I know only the element that is inside? I have no idea what position this vehicle should be, at the moment I try to remove it, can't find it at the lua tutorial site. function filterTableVeh() outputChatBox(#weaponObjectsVeh) vehicleInTheWorld = getElementsByType ( "vehicle" ) for c, vehicle in pairs (weaponObjectsVeh) do if vehicle then outputChatBox ("it does work") -- output works else return end --if not isElement( vehicle ) then --outputChatBox(getElementModel(vehicle)) if not vehicleInTheWorld[vehicle] then --weaponObjectsVeh[vehicle] table.remove(weaponObjectsVeh,) outputChatBox("not element" .. c) else outputChatBox("there is") end end outputChatBox(#weaponObjectsVeh) end
-
hmm ok, Let me try that. "some_value" ? how do you know what value I need to set next one? (vehicle)
-
Gamemode play/freeroam? gameplayer/freeroam(.zip)/fr_server line: 401 addEventHandler('onPlayerChat', g_Root, function(msg, type) if type == 0 then cancelEvent() if chatTime[source] and chatTime[source] + tonumber(get("*chat/mainChatDelay")) > getTickCount() then outputChatBox("Stop spamming main chat!", source, 255, 0, 0) return else chatTime[source] = getTickCount() end if get("*chat/blockRepeatMessages") == "true" and lastChatMessage[source] and lastChatMessage[source] == msg then outputChatBox("Stop repeating yourself!", source, 255, 0, 0) return else lastChatMessage[source] = msg end local r, g, b = getPlayerNametagColor(source) outputChatBox(getPlayerName(source) .. ': #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), g_Root, r, g, b, true) outputServerLog( "CHAT: " .. getPlayerName(source) .. ": " .. msg ) end end )
-
I have never done that bevore. How can I do that? or maybe a sample. array * mytable = {} How can I make a table that stores every new object at the next open place?
-
local myPlayerData = {} local weaponObjectsVeh = {} local weaponvehicles = {[476]=true} function make_vehicle_weapon(vehicle, seat, jacked) local player = source; --local vehicle = getPedOccupiedVehicle (player) if vehicle then outputDebugString("vehicle found, IIYAMA is inside a vehicle",source) else outputDebugString("there is no vehicle, so I IIYAMA return this.",source) return end if weaponvehicles[getElementModel(vehicle)] then if not weaponObjectsVeh[vehicle] then outputChatBox("not in table, new vehicle",source) weaponObjectsVeh[vehicle]={} --<--<--< store my data for k, players in pairs (getElementsByType ( "player" )) do if myPlayerData[player]["load"] then outputChatBox("trigger") triggerClientEvent(players,"addtotable",getRootElement(),vehicle) end end end end end --addCommandHandler ("adds", make_vehicle_weapon) addEventHandler ("onPlayerVehicleEnter", getRootElement(), make_vehicle_weapon) function filterTableVeh() outputChatBox(#weaponObjectsVeh) for c, vehicle in pairs (weaponObjectsVeh) do if vehicle then outputChatBox ("it does work") -- output works else return end if not isElement( vehicle ) then --<--<--< check weaponObjectsVeh[vehicle]= nil outputChatBox("not element")) end end outputChatBox(#weaponObjectsVeh) end setTimer (filterTableVeh, 1000,0) I check if my tabledata and check if it is an element, but since I add it in the table it isn't a vehicle any more......... how can I turn it back to normal element/user data? and If I check with "#" it will always awsers 0, but it is there....
-
You calling "ammo[11]" when it does not exist in the table it self.......
-
local ammo = { 1,100,60,150,50,5,300 } -- 1 = 1 -- 2 = 100 -- 3 = 60 -- 4 = 150 -- 5 = 50 -- 6 = 300 giveWeapon(source,24,ammo[1],true) --= 1 ammo giveWeapon(source,27,ammo[2],true) --= 100 ammo giveWeapon(source,30,ammo[3],true) --= 60 ammo giveWeapon(source,34,ammo[4],true) --= 150 ammo
-
local myVictimData = {} local timerRunning = false --local player = source reduce ppppiiieeppp bugs.... function victim_def(attacker) if attacker and attacker ~= source and getElementType ( attacker ) == "ped" then local player = source myVictimData[player]={} timerRunning = true if not isTimer(dmgtimer) then dmgtimer = setTimer( damagetimer, 200, 0) end end end addEventHandler("onPlayerDamage", getRootElement(), victim_def) function damagetimer () if timerRunning == false then if isTimer(dmgtimer) then killTimer (dmgtimer) end return end local activetimer = 0 for k,player in ipairs(myVictimData) do activetimer = activetimer +1 local health = getElementHealth(player) if health > 0 then setElementHealth(player, health-1) else killPed(player) end end if activetimer == 0 then timerRunning = false end end function resourceStart () dmgtimer = setTimer( damagetimer, 200, 0) end addEventHandler ( "onResourceStart", resourceRoot, resourceStart ) function on_Player_Quit() -- remove him from the table when he leaves local player = source myVictimData[player] = nil end addEventHandler ( "onPlayerQuit", getRootElement(),on_Player_Quit) function on_Player_Wasted () -- remove him from the table when he get killed local player = source; myVictimData[player] = nil end addEventHandler ( "onPlayerWasted", getRootElement(),on_Player_Wasted)
-
test it again. If it doesn't work, check with outputDebugString("") what went wrong when you don't have any erros.
-
My qwestion is: do server "get" functions cause client ping lagg?
-
Try both pls: local myVictimData = {} local timerRunning = false --local player = source reduce ppppiiieeppp bugs.... function victim_def(attacker) if attacker and attacker ~= source and getElementType ( attacker ) == "ped" ) then local player = source myVictimData[player]={} timerRunning = true if not damagetimer then setTimer( damagetimer, 200, 0) end end end addEventHandler("onPlayerDamage", getRootElement(), victim_def) function damagetimer () if timerRunning == false then killTimer (damagetimer) return end local activetimer = 0 for k,player in ipairs(myVictimData) do activetimer = activetimer +1 local health == getElementHealth(player) if health > 0 then setElementHealth(player, health-1) else killPed(player) end end if activetimer == 0 then timerRunning = false end end function resourceStart () setTimer( damagetimer, 200, 0) end addEventHandler ( "onResourceStart", resourceRoot, resourceStart ) function on_Player_Quit() -- remove him from the table when he leaves local player = source myVictimData[player] = nil end addEventHandler ( "onPlayerQuit", getRootElement(),on_Player_Quit) function on_Player_Wasted () -- remove him from the table when he get killed local player = source; myVictimData[player] = nil end addEventHandler ( "onPlayerWasted", getRootElement(),on_Player_Wasted)
-
Can "get/is" server functions cause instable ping? Possible ? Because I use "3" t/m "5" get/is functions: (2 players, hitelement is also player) player and attacker isPedInVehicle ( attacker ) getElementPosition(attacker) getElementPosition(hitElement); getElementRotation ( attacker ) ( getControlState ( attacker,"fire" ) ) getElementType(attacker)=="player" getElementType(hitElement) =="player" isPedChoking ( hitElement ) getPedRotation(hitElement) getPlayerPing(hitElement) isPedDucked ( hitElement ) isElement(player) -- not always getPedContactElement ( player )-- not always getPlayerTeam(attacker) -- not always getPlayerTeam(player)-- not always getPedArmor(player) -- not always Do they cause client lagg? Note: the script that use these functions get executed very much. at last a set function: setElementHealth()
-
It's always good to come with another (good)solution, because the "createFire" function is useless. ( using an object as fire, it makes it possible to delete it and won't give so much trouble with teamkilling etc.) I don't think that is stupid because preventing is better than rewriting. This my opinion. Note: I will mind that, thx I let your discussion to continue, if it is still on.
-
Maybe you can change a object with a mod? (dunno if possible with currently mods, but it should be "true")
-
About that keypad thingy, you can use OnClientClick and check the distance from the X,Y,Z from the OnclientClick and the object it self and it should work. That means you click with your mouse on the button. Or https://wiki.multitheftauto.com/wiki/OnColShapeHit, to enable a key to activate the keypad. onColShapeLeave to remove the bind. Next to that you can check the distance from the player and compare that with the keypad so it will only work when you close. At last you can use animation to finish it. What's wrong with the /quit ? What else must happen when you write that? and no your English isn't bad, but your explanation is. https://wiki.multitheftauto.com/wiki/AddCommandHandler
-
ok, which encoder do you use?
-
But why this encoding? I won't see the difference.
-
I have one tab called "codering", for me it is not encoding(dutch version but it should not really matter..). In that tab there is UTF-8 without BOM converting. When I set him to "UTF-8 without BOM converting", nothing happend, the script does not have any errors. Do you have some plugins or?