View Issue Details

IDProjectCategoryView StatusLast Update
0001679Multi Theft Auto : San AndreasGeneralpublic2006-12-04 05:41
ReporterRansomAssigned ToJax 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Versionblue_sa.r2.a12 
Target VersionFixed in Versionmtasadm_v1.0-dp1 
Summary0001679: Weapon skills not assigning sometimes on playerjoin
Description

On my map "cir" theres a lua ran called "circleofdeathlua.lua". It assigns hitman status to each weapon on map start and playerjoin. I seem to have pinned this down to people who join the server after I start the map.

If a player was there when the map was loaded, they will attain the hitman statuses when disconnecting and reconnecting. On the other hand, if they were not there when the map was loaded, they will not attain the weapon skills I set when they join. One more note, I tested to see if weapon skill was merely carried (checking to see if it needed to be reset manually, since people there on mapload always got the skills), but port 69 reset the weapon skills.

From what I asked erorr404, this code in the additional notes should be correct. So it should be a bug. I cannot debug to make absolutely sure because the debugger gets turned off on disconnect. This should also be changed so people can debug player joining stuff.

Additional Information

root = getRootElement ()
players = {}

addEventHandler ( "onMapLoad", root, "onMapLoad" )
function onMapLoad ( name, root )
players = getElementsByType( "player" ) -- k,v is key value (way of applying to all players)
for k,v in players do
statsup = 69
while statsup <= 79 do
setPlayerStat ( v, statsup, 1000 )
statsup = statsup + 1
end
end
end

addEventHandler ( "onPlayerSpawn", root, "playerSpawn" )
function playerSpawn ( spawnpoint )
giveWeapon ( source, randInt ( 2, 9 ), 1 )
mainrandom = randInt ( 1, 3 )
if mainrandom == 1 then
giveWeapon ( source, 22, 100 )
elseif mainrandom == 2 then
giveWeapon ( source, 23, 100 )
elseif mainrandom == 3 then
giveWeapon ( source, 28, 100 )
end
end

addEventHandler ( "onPlayerJoin", root, "onPlayerJoin" )
function onPlayerJoin ()
setPlayerStat ( source, 69, 1000 )
setPlayerStat ( source, 70, 1000 )
setPlayerStat ( source, 71, 1000 )
setPlayerStat ( source, 72, 1000 )
setPlayerStat ( source, 73, 1000 )
setPlayerStat ( source, 74, 1000 )
setPlayerStat ( source, 75, 1000 )
setPlayerStat ( source, 76, 1000 )
setPlayerStat ( source, 77, 1000 )
setPlayerStat ( source, 78, 1000 )
setPlayerStat ( source, 79, 1000 )
end

TagsNo tags attached.

Activities

erorr404

2006-12-02 02:09

developer   ~~0003687

Last edited: 2006-12-02 02:09

Still here.. Sometimes doesn't work onMapLoad as well.

Talidan

2006-12-03 08:43

administrator   ~~0003688

surely this is because you're assigning stats before the player has spawned, so it cant assign them? What about doing this onspawn rather than on join and on load. It's what i do and i find its more efficient.

erorr404

2006-12-03 14:07

developer   ~~0003690

Possibly, but either way it should work.

Jax

2006-12-04 05:41

administrator   ~~0003696

Logically, it shouldn't work, the player hasn't even been created until he spawns after joining, but i've fixed it anyway.

Issue History

Date Modified Username Field Change