root is not the player's element.
You have to use source instead of root, but for this you need to modify triggerServerEvent and set client's element (localPlayer) as event's source instead of getRootElement().
triggerServerEvent("checkPlayerAccount", localPlayer, username, password)
You should learn Lua, because it's what MTA uses and it's definately not a C-like language. Pawn isn't useful for MTA.
Useful learning resources:
https://wiki.multitheftauto.com/wiki/Scripting_Introduction
Scripting tutorials section
Scripting board
MTA discord > #scripting channels
@alexxnder