Llano 11 Posted June 10, 2013 Hello! Time for a new problem.. again :) init.sqf onPlayerConnected "[_id, _name] execVM ""PlayerCheck.sqf"""; PlayerCheck.sqf _name = _this select 1; _uid = _this select 0; _clientId = -1; _cycles = 0; while{_clientId == -1}do { { if (getPlayerUID _x == _uid) exitWith { _clientId = owner _x; hint ("Arma2Net.Unmanaged" callExtension format ["SQLstats [pGUID, '%1']", _clientID]); hint format["id: %1", _clientID]; }; } forEach playableUnits; _cycles = _cycles + 1; sleep .02; }; When i run the mission, i'm getting error at line 10 in PlayerCheck.sqf if (getPlayerUID _x == _uid) exitWith .. "Generic error in expression". and i have no idea why. Anyone that can hlelp me to see what's wrong? Share this post Link to post Share on other sites
Woodpeckersam 18 Posted June 10, 2013 Im not sure if I have corrected it fully as I am not at home, and that I may have not sorted out the code properly, but this code... hint ("Arma2Net.Unmanaged" callExtension format ["SQLstats [pGUID, '%1']", _clientID]); It seems logical if it was written like this hint ["Arma2Net.Unmanaged" callExtension format ["SQLstats [pGUID, '%1']", _clientID]]; Sorry I cant really check, lots at work today, im only on my 5min break :( Share this post Link to post Share on other sites
Llano 11 Posted June 10, 2013 (edited) Im not sure if I have corrected it fully as I am not at home, and that I may have not sorted out the code properly, but this code... hint ("Arma2Net.Unmanaged" callExtension format ["SQLstats [pGUID, '%1']", _clientID]); It seems logical if it was written like this hint ["Arma2Net.Unmanaged" callExtension format ["SQLstats [pGUID, '%1']", _clientID]]; Sorry I cant really check, lots at work today, im only on my 5min break :( But, has that something to do with the error that i get on line 10? Anyway, i'll try that out. thank you. EDIT: Still getting the same error. Edited June 10, 2013 by Llano Share this post Link to post Share on other sites
Larrow 2800 Posted June 10, 2013 (edited) Your passing the _id out of onPlayerConnected rather than the _uid The hint line seems more logical the way you have it as your hinting the return from a code block ( a call to an extension). Edited June 10, 2013 by Larrow Share this post Link to post Share on other sites
Llano 11 Posted June 10, 2013 Your passing the _id out of onPlayerConnected rather than the _uidThe hint line seems more logical the way you have it as your hinting the return from a code block ( a call to an extension). Sorry, didn't really understand that. I am passing wrong value? Share this post Link to post Share on other sites
Larrow 2800 Posted June 10, 2013 (edited) onPlayerConnected "[_id, _name] execVM ""PlayerCheck.sqf"""; Should that not be onPlayerConnected "[_uid, _name] execVM ""PlayerCheck.sqf"""; From WIKI as of ArmA 2 version 1.02 this function returns also variable _uid with uniqueID of player. Otherwise your comparing _id which is a float to getPlayerUID which is a string. Hence the generic error Edited June 10, 2013 by Larrow Share this post Link to post Share on other sites
Llano 11 Posted June 10, 2013 onPlayerConnected "[_id, _name] execVM ""PlayerCheck.sqf"""; Should that not be onPlayerConnected "[_uid, _name] execVM ""PlayerCheck.sqf"""; From WIKI Otherwise your comparing _id which is a float to getPlayerUID which is a string. Hence the generic error Thank you so much! Works perfectly now :) Share this post Link to post Share on other sites