arith op + between "null" and "integer"

Started by Nihongo^, Jul 14, 2022, 05:02 PM

Previous topic - Next topic

Nihongo^

Why i keep getting this error when i join server its giving me the same error OnPlayerKill function when i headshot

status[ killer.ID ].Headshots++;

NicusorN5

status[ killer.ID ] is null. Initialize it when joining inside the onPlayerJoin() function.

Nihongo^

Quote from: Athanatos on Jul 15, 2022, 01:02 AMstatus[ killer.ID ] is null. Initialize it when joining inside the onPlayerJoin() function.
Can you give any example how ?
Because
status[ killer.ID ].Kills++;  work perfectly

but when i put
status[ killer.ID ].Headshots++; Its give error same with the Joins++;

NicusorN5

Initialize the "Headshots" field in the player stats's class constructor to 0.

Nihongo^