|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
08-22-2008 09:07
logicaly this is driving me nuts, im working on a age verifying sytem do to alts griefing one of the citys im working with. im trying to make it so if there age is under 30 days it will kick them from the parcel
i know it has something to do with dataserver and DATA_BORN and some sensor along with llOverParcel or something like that, can anyone give me an example?
|
|
Richard Woodin
Registered User
Join date: 8 Jul 2006
Posts: 6
|
08-22-2008 09:24
Here is something that should push you in the right direction... From: someone key Query;
default { on_rez(integer X) {llResetScript();} touch_start(integer X) { llSetText("Verifying your age...",<0,1,0>,1); Query = llRequestAgentData(llDetectedKey(0),DATA_BORN); } dataserver(key QID,string Data) { if (QID == Query) { // The following variables are set to account for leap years and assume // the days evenly distributed amongst the 12 months of a year. float YrDays = 365.25; float MnDays = YrDays / 12; float DyInc = 1 / MnDays; // This is the user's birthdate. integer uYr = (integer)llGetSubString(Data,0,3); integer uMn = (integer)llGetSubString(Data,5,6); integer uDy = (integer)llGetSubString(Data,8,9); float uXVal = uYr * YrDays + (uMn - 1) * MnDays + uDy * DyInc; // This is today's date Data = llGetDate(); integer Yr = (integer)llGetSubString(Data,0,3); integer Mn = (integer)llGetSubString(Data,5,6); integer Dy = (integer)llGetSubString(Data,8,9); float XVal = Yr * YrDays + (Mn - 1) * MnDays + Dy * DyInc; // We calculate the difference between those two dates to get the number of days. integer DDiff = (integer)(XVal - uXVal); // Here we check if the calculated age fits our requirements. if (DDiff < 180) { llSetText("Age Check Failed!\nYou are younger than 180 days!",<1,1,1>,1); } else { llSetText("Age Check Passed!",<1,1,1>,1); } } } }
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
08-22-2008 09:57
yes that helped alot, ty
|