Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //simpel simwide radar
- //you need one - three prims named like the primNames list
- integer output = 3; // 1 = one prim text green / 2 = two prims first green in 20m, second yellow over 20m / 3 = three prims first green in 20m, second yellow 20m - 96m, third over 96m
- list primNames = ["r1","r2","r3"];// name of the prims
- list av;
- string text_1;
- string text_2;
- string text_3;
- vector color_1 = <0,1,0>;
- vector color_2 = <1,1,0>;
- vector color_3 = <1,0,0>;
- render_display()
- {
- integer num = llGetListLength(av);
- integer x;
- list cach = [];
- for(x=0;x<=(num-1);x++)
- {
- if(llList2Key(av,x)!=llGetOwner())
- {
- list pos = llGetObjectDetails(llList2Key(av,x),[OBJECT_POS]);
- integer range = (integer)llVecDist((vector)llList2String(llGetObjectDetails(llList2Key(av,x),[OBJECT_POS]),0),llGetPos());
- cach += range;
- cach += llKey2Name(llList2Key(av,x));
- }
- }
- cach = llListSort(cach,2,TRUE);
- if(output == 1)
- {
- text_1 = "";
- integer nu = llGetListLength(cach);
- integer y;
- for(y=0;y<=(nu-1);y=y+2)
- {
- text_1 = text_1 + llList2String(cach,(y+1))+" "+(string)llList2Integer(cach,y)+"m \n";
- }
- }
- if(output == 2)
- {
- text_1 = "";
- text_2 = "";
- integer nu = llGetListLength(cach);
- integer y;
- for(y=0;y<=(nu-1);y=y+2)
- {
- if(llList2Integer(cach,y) < 21)
- {
- text_1 = text_1 + llList2String(cach,(y+1))+" "+(string)llList2Integer(cach,y)+"m \n";
- }
- else
- {
- text_2 = text_2 + llList2String(cach,(y+1))+" "+(string)llList2Integer(cach,y)+"m \n";
- }
- }
- }
- if(output == 3)
- {
- text_1 = "";
- text_2 = "";
- text_3 = "";
- integer nu = llGetListLength(cach);
- integer y;
- for(y=0;y<=(nu-1);y=y+2)
- {
- if(llList2Integer(cach,y) < 21)
- {
- text_1 = text_1 + llList2String(cach,(y+1))+" "+(string)llList2Integer(cach,y)+"m \n";
- }
- else if(llList2Integer(cach,y) < 97)
- {
- text_2 = text_2 + llList2String(cach,(y+1))+" "+(string)llList2Integer(cach,y)+"m \n";
- }
- else
- {
- text_3 = text_3 + llList2String(cach,(y+1))+" "+(string)llList2Integer(cach,y)+"m \n";
- }
- }
- }
- integer num_p = llGetNumberOfPrims();
- integer z;
- for(z=0;z<=num_p;z++)
- {
- if(llGetLinkName(z)==llList2String(primNames,0))
- {
- llSetLinkPrimitiveParamsFast(z,[PRIM_TEXT,text_1,color_1,1.0]);
- }
- if(llGetLinkName(z)==llList2String(primNames,1))
- {
- llSetLinkPrimitiveParamsFast(z,[PRIM_TEXT,text_2,color_2,1.0]);
- }
- if(llGetLinkName(z)==llList2String(primNames,2))
- {
- llSetLinkPrimitiveParamsFast(z,[PRIM_TEXT,text_3,color_3,1.0]);
- }
- }
- llSetTimerEvent(1);
- }
- default
- {
- state_entry()
- {
- av = llGetAgentList(AGENT_LIST_REGION,[]);
- llSetTimerEvent(1);
- }
- on_rez(integer param)
- {
- llResetScript();
- }
- attach(key attached)
- {
- if (attached != NULL_KEY)
- {
- llResetScript();
- }
- }
- timer()
- {
- llSetTimerEvent(0);
- if(llGetListLength(av) != llGetListLength(llGetAgentList(AGENT_LIST_REGION,[])))
- {
- av = llGetAgentList(AGENT_LIST_REGION,[]);
- }
- render_display();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement