Jump to content

[HELP] Spawn error in DayZ


dogidog

Recommended Posts

Hey, i tried to translate ammo in the MTA Dayz gamemode but now i have spawn error.

ERROR:

[2014-02-11 23:39:53] ERROR: [DayZ-MTA]\DayZ\spawn.lua:393: attempt to perform arithmetic on a boolean value

if data[1] == "Charg. M1911" then

plusData = math.floor(getElementData(source,data[1])/7)

elseif data[1] == "Charg. G17" then

plusData = math.floor(getElementData(source,data[1])/15)

elseif data[1] == "Charg. Deagle" then

plusData = math.floor(getElementData(source,data[1])/7)

elseif data[1] == "Charg. PDW" then

plusData = math.floor(getElementData(source,data[1])/30)

elseif data[1] == "Charg. MP5A5" then

plusData = math.floor(getElementData(source,data[1])/20)

elseif data[1] == "Charg. AK47" then

plusData = math.floor(getElementData(source,data[1])/30)

elseif data[1] == "Charg. M4A1" then

plusData = math.floor(getElementData(source,data[1])/20)

elseif data[1] == "Charg. M4A03" then

plusData = math.floor(getElementData(source,data[1])/5)

elseif data[1] == "Charg. Lee Enfield" then

plusData = math.floor(getElementData(source,data[1])/10)

elseif data[1] == "Carreaux explosifs" then

plusData = math.floor(getElementData(source,data[1])/2)

elseif data[1] == "Cart. Cal.12" then

plusData = math.floor(getElementData(source,data[1])/7)

elseif data[1] == "Cart. 2rnd" then

plusData = math.floor(getElementData(source,data[1])/2)

end

When i die, i can't respawn and my body is duplicated and i fly in the air ...

Please help me

Link to comment
  • Moderators
Search for the original ammo names everywhere else in the gamemode and replace all the occurrences.

i opened all files with Notepad ++ and make a "find in all open files" :S

You should use the "search in folder" feature, and submit the path to the root folder of your MTA DayZ gamemode.

Link to comment
Search for the original ammo names everywhere else in the gamemode and replace all the occurrences.

i opened all files with Notepad ++ and make a "find in all open files" :S

You should use the "search in folder" feature, and submit the path to the root folder of your MTA DayZ gamemode.

ok i try this function of notepad ++ but all files found are the same which i edited.

Ok je test cette fonction de notepad ++ mais les fichiers qui ont été trouvés sont les mêmes que j'ai auparavant édité :/

________________________________________________________________

EDIT : not working ... always the same error

Link to comment
  • Moderators

Damn it, thought you wouldn't set "[DayZ-MTA]" folder as root folder for the search feature.

Then hummm be sure you are checking the "Case sensitive" option and that the filder is "*.*" without quotes obviously.

If it still doesn't work, then check the database, it's probably loading objects that the player has and there are some "M1911 Mag" somewhere in the database.

If you still can't fix it, just set a default value if the getElementData function returns nil by doing like this:

getElementData(source,data[1]) or 0 

if the getElementData function returns nil then 0 will be used. So in your case, it will be like this:

plusData = math.floor( (getElementData(source,data[1]) or 0)/7 ) 

Regards,

Citizen

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...