Thanks to @oooooo's recomendation I used this code to build a method for adding points.
Calling the UserPoints API in Your Code If you want to give points to
a user, you will need to call the API by inserting the codes where you
want them.
include_once
JPATH_ROOT.'/components/com_community/libraries/core.php';
include_once
JPATH_ROOT.'/components/com_community/libraries/userpoints.php';
CuserPoints::assignPoint('your.action.string');
The your.action.string is the rule registered in database with how
many points awarded to the current logged-in user. You will need to
give a unique action string to your components such as
'com_name.profile.upload.avatar'. In some situations, where you want
to give points to another user instead of the current logged-in user,
you can call the API's in the following manner:
include_once JPATH_ROOT.'/components/com_community/libraries/core.php';
include_once JPATH_ROOT.'/components/com_community/libraries/userpoints.php';
CuserPoints::assignPoint('your.action.string', 62);
By giving the userId (62) as the second parameter, the API will give
points to the specified user.
Here's the method I used. Hope it helps someone.
include_once JPATH_ROOT.'/components/com_community/libraries/core.php';
include_once JPATH_ROOT.'/components/com_community/libraries/userpoints.php';
function addPoints($user_id, $action_string = null){
if($function_name == null){ $action_string = DEFAULT_ACTION_STRING; }
CuserPoints::assignPoint('your.action.string', $user_id);
}
}