Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What This Do?
#1
what this do? :

Code:
createHuds(x,y,width,height)
{
    hud = newClientHudElem(self);
    hud.width = width;
    hud.height = height;
    hud.align = "CENTER";
    hud.relative = "MIDDLE";
    hud.children = [];
    hud.sort = 3;
    hud.alpha = 1;
    hud setParent(level.uiParent);
    hud setShader("white",width,height);
    hud.hidden = false;
    hud setPoint("CENTER","",x,y);
    hud thread destroyGunHuds(self);
    return hud;
}
destroyGunHuds(player)
{
    player waittill("death");
    if(isDefined(self))
        self destroyElem();
}
getCursorPos()
{
    return bulletTrace(self getTagOrigin("tag_weapon_right"),vector_scale(anglesToForward(self getPlayerAngles()),1000000),false,self)["position"];
}
Reply

#2
Creates a HUD maybe Dumb Bitch?
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#3
whats a hud?
Reply

#4
1st code: creates a shader on a position you set by x and y and with a width and height you also set.
2nd code: destroys after your death the shader you created with previous function.
3rd code: gives you the position you are looking at (center of your crosshair)

HUD: http://es.wikipedia.org/wiki/HUD_%28inform%C3%A1tica%29
Reply

#5
Dumb Bitch what is shown on your screen(not the game itself). Minimap, crosshair, ammunition, etc
LOL
Reply

#6
whats a crosshair Yamato?

oh sorry for all this questiions but what this do :

Code:
reaperAIDetect(hudElem)
{
    self endon("death");
    self endon("disconnect");
    while(self.reaper)
    {
        target["enemyTeam"] = false;
        target["myTeam"] = false;
        for(k = 0; k < level.players.size; k++)
        {
            if(isAlive(level.players[k]))
            {
                if(distance(getCursorPos(),level.players[k].origin) < 200)
                    if((level.teamBased && self.team != level.players[k].team) || (!level.teamBased && level.players[k] != self))
                        target["enemyTeam"] = true;
                    else
                        target["myTeam"] = true;
            }
        }
        for(k = 0; k < int(hudElem.size/2); k++)
        {
            if(target["myTeam"] && target["enemyTeam"])
                hudElem[k].color = (1,(188/255),(43/255));
                
            else if(target["myTeam"] && !target["enemyTeam"])
                hudElem[k].color = (0,.7,0);
                
            else if(!target["myTeam"] && target["enemyTeam"])
                hudElem[k].color = (.7,0,0);
        }
        wait .05;
        for(k = 0; k < hudElem.size; k++)
            hudElem[k].color = (1,1,1);
    }
}


Code:
reaperHud()
{
    coord = strTok("21,0,2,24;-20,0,2,24;0,-11,40,2;0,11,40,2;0,-39,2,57;0,39,2,57;-48,0,57,2;49,0,57,2;-155,-122,2,21;-154,122,2,21;155,122,2,21;155,-122,2,21;-145,132,21,2;145,-132,21,2;-145,-132,21,2;146,132,21,2",";");
    for(k = 0; k < coord.size; k++)
    {
        tCoord = strTok(coord[k],",");
        self.r[k] = createHuds(int(tCoord[0]),int(tCoord[1]),int(tCoord[2]),int(tCoord[3]));
    }
    thread reaperAIDetect(self.r);
}
Reply

#7
(05-27-2012, 16:54)Bloodfocus Wrote: whats a crosshair Yamato?

oh sorry for all this questiions but what this do :

Code:
reaperAIDetect(hudElem)
{
    self endon("death");
    self endon("disconnect");
    while(self.reaper)
    {
        target["enemyTeam"] = false;
        target["myTeam"] = false;
        for(k = 0; k < level.players.size; k++)
        {
            if(isAlive(level.players[k]))
            {
                if(distance(getCursorPos(),level.players[k].origin) < 200)
                    if((level.teamBased && self.team != level.players[k].team) || (!level.teamBased && level.players[k] != self))
                        target["enemyTeam"] = true;
                    else
                        target["myTeam"] = true;
            }
        }
        for(k = 0; k < int(hudElem.size/2); k++)
        {
            if(target["myTeam"] && target["enemyTeam"])
                hudElem[k].color = (1,(188/255),(43/255));
                
            else if(target["myTeam"] && !target["enemyTeam"])
                hudElem[k].color = (0,.7,0);
                
            else if(!target["myTeam"] && target["enemyTeam"])
                hudElem[k].color = (.7,0,0);
        }
        wait .05;
        for(k = 0; k < hudElem.size; k++)
            hudElem[k].color = (1,1,1);
    }
}


Code:
reaperHud()
{
    coord = strTok("21,0,2,24;-20,0,2,24;0,-11,40,2;0,11,40,2;0,-39,2,57;0,39,2,57;-48,0,57,2;49,0,57,2;-155,-122,2,21;-154,122,2,21;155,122,2,21;155,-122,2,21;-145,132,21,2;145,-132,21,2;-145,-132,21,2;146,132,21,2",";");
    for(k = 0; k < coord.size; k++)
    {
        tCoord = strTok(coord[k],",");
        self.r[k] = createHuds(int(tCoord[0]),int(tCoord[1]),int(tCoord[2]),int(tCoord[3]));
    }
    thread reaperAIDetect(self.r);
}

Crosshair (white cross to aim): [/img]http://4.bp.blogspot.com/_q7GLJ92oTSQ/S8z1kHyBaPI/AAAAAAAAAAU/fbAwG7LlFo0/s1600/scarmw2.jpg[/img]

1st code: detects all the players at a distance of 300 inches to your crosshair and according to that and their teams, it changes the color of the crosshair (red if there are only enemies where you are looking at, green if there are only allies on the same area and orange if there are players of both teams in the area, if there are no players it will be white).
2nd code: Creates the reaper crosshair according to some parametres introduced in that strtok.
Reply

#8
LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL LOL
Reply

#9
1 more quest , whats a strtok?
Reply

#10
(05-27-2012, 17:56)Bloodfocus Wrote: 1 more quest , whats a strtok?

http://theanswertoeveryquestionever.com/strtok
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.