hey i have a strange bug on my friend server, after some time when players are playing all gets fucked up i have no clue why this is happening i have tryed many things and nothing worked,
function playerSpawn()
local playerTeam = getElementData(source, "team")
local playerSkin = getElementData(source, "skin")
check(source)
local xmlFile = xmlLoadFile("Spawns.xml")
player = xmlFindChild(xmlFile, "skin", playerSkin-1)
positionX = xmlNodeGetAttribute(player,"x")
positionY = xmlNodeGetAttribute(player,"y")
positionZ = xmlNodeGetAttribute(player,"z")
spawnPlayer(source, positionX, positionY, positionZ, 0)
id = xmlNodeGetAttribute(player,"id")
setElementModel(source, id)
I = 0
while (xmlFindChild(player, "weapon", I)) do
local weapon = xmlFindChild(player, "weapon", I)
local weaponAttributes = xmlNodeGetAttributes(weapon)
giveWeapon(source, weaponAttributes.name, weaponAttributes.amount)
I = I + 1
end
end
addEvent("spawnHim",true)
addEventHandler("spawnHim", getRootElement(), playerSpawn)
errors:
bad argument xmlNodeGetAttribute from line positionX = xmlNodeGetAttribute(player,"x") to 36
bad argument spawnPlayer (this is because attributes aren't working)
bad argument while xmlFindChild line (xmlFindChild(player, "weapon", I)) do
i hope someone can give me a hand, thanks in advance.