I want to implement a script so that when a new player enters the game as a civilian, he must have the player's UID in a specific table in the database. Otherwise, the task ends. This is my script.
Code: fn_initciv.sqf
private _uid = getPlayerUID player;
if !(_uid in _whitelist)then{
["NotWhitelisted",false,true] call BIS_fnc_endMission;
};
[_whitelist] remoteExec ["DB_fnc_whitelist", 2];
Code: pwhitelist.sql
CREATE TABLE `pwhitelist` (
`playerUID` VARCHAR(32) NULL DEFAULT NULL,
`reason` VARCHAR(17) NULL DEFAULT NULL,
PRIMARY KEY (`playerUID`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1
;
I don't know how to write next, so that I can add player UID to the database before players can play. This is similar to a whitelisting system, any help would be greatly appreciated!