Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Zmiana wyglądu - brak działania
#9
Trzymaj,

Code:
local headmodel = ["Hum_Head_FatBald","Hum_Head_Fighter","Hum_Head_Pony","Hum_Head_Bald","Hum_Head_Thief","Hum_Head_Psionic","Hum_Head_Babe"];
local bodymodel = ["Hum_Body_Naked0","Hum_Body_Babe0"];


local texture0 = Texture(467,3656,1500,1500,"LOG_PAPER.TGA");
local draw0 = Draw(723,3800, "<- Zmien Plec ->");
local draw1 = Draw(704,4056, "<- Zmien Cialo ->");
local draw2 = Draw(691,4312, "<- Zmien Glowe ->");
local draw3 = Draw(691,4584, "<- Zmien Twarz ->");
local draw4 = Draw(1062,4896, "Wyjdz");

local glowa = 0;
local cialo = 0;
local plec = 0;
local twarz = 0;
local opcja = 0;

function show_Visual_Change()
{
texture0.visible = true;
draw0.visible = true;
draw0.setColor(255,0,0);
draw1.visible = true;
draw2.visible = true;
draw3.visible = true;
draw4.visible = true;
openGraphic("wyglad");
setCursorVisible(false);
opcja = 1;
playAni(heroId,"S_THRONE_S1");
}

function hide_Visual_Change()
{
texture0.visible = false;
draw0.visible = false;
draw1.visible = false;
draw2.visible = false;
draw3.visible = false;
draw4.visible = false;
local wyglad = getPlayerVisual(heroId);
callServerFunc("setPlayerVisual",heroId, wyglad.bodyModel, wyglad.bodyTxt, wyglad.headModel, wyglad.headTxt);
closeGraphic();
}

function changeOpcjaVis()
{
     if(opcja > 5){opcja = 1;}
     if(opcja < 1){opcja = 5;}
    
     draw0.setColor(255,255,255);
     draw1.setColor(255,255,255);
     draw2.setColor(255,255,255);
     draw3.setColor(255,255,255);
     draw4.setColor(255,255,255);
    
     if(opcja == 1){draw0.setColor(255,1,1);}
     else if(opcja == 2){draw1.setColor(255,1,1);}
     else if(opcja == 3){draw2.setColor(255,1,1);}
     else if(opcja == 4){draw3.setColor(255,1,1);}
     else if(opcja == 5){draw4.setColor(255,1,1);}
}

function changeSpecificMenuValue(val)
{
      if(opcja == 1)
      {
           plec = plec + val;
           
           if(plec > 1){plec = 0}
           else if(plec < 0){plec = 1}
      }else if(opcja == 2)
      {
           cialo = cialo + val;
           
           if(cialo > 15){cialo = 0}
           else if(cialo < 0){cialo = 15}
      }else if(opcja == 3)
      {
           glowa = glowa + val;
           
           if(glowa > 7){glowa = 0}
           else if(glowa < 0){glowa = 7}
      }else if(opcja == 4)
      {
           twarz = twarz + val;
           
           if(glowa > 144){glowa = 0}
           else if(glowa < 0){glowa = 144}
      }
      
      setPlayerVisual(heroId, bodymodel[plec], cialo, headmodel[glowa], twarz);
}


////////////////////////////////////////////////////////////////////////////

local function keyHandler(key)
{
     if(EnabledGraphic() == false)
     {
           if (key == KEY_F7)
           {
           show_Visual_Change();
           }
     }else{
           if(EnabledGraphic() == "wyglad")
           {
                if (key == KEY_F7)
                {
                hide_Visual_Change();
                }    
           }           
     }
    
     if(EnabledGraphic() == "wyglad")
     {
           if(key == KEY_DOWN) { opcja = opcja + 1; changeOpcjaVis();}
           else if(key == KEY_UP) { opcja = opcja - 1; changeOpcjaVis();}
           else if(key == KEY_LEFT) {changeSpecificMenuValue(-1);}
           else if(key == KEY_RIGHT) {changeSpecificMenuValue(1);}
           else if(key == KEY_RETURN)
           {
                if(opcja == 5)
                {
                hide_Visual_Change();
                }
           }
     }
}

addEventHandler("onKey", keyHandler);


function CMD_Wyglad(params)
{
    local args = sscanf("dddd", params);
    if (!args)
    {
        addMessage(255, 255, 255, "/wyglad <plec 0 -1> <cialo> <glowa 0 - 6> <twarz>");
        return;
    }
    
    setPlayerVisual(heroId, bodymodel[args[0]], args[1], headmodel[args[2]], args[3]);
    addMessage(255, 255, 255, "Ustawiono wyglad!");
    local wyglad = getPlayerVisual(heroId);
    callServerFunc("setPlayerVisual",heroId, wyglad.bodyModel, wyglad.bodyTxt, wyglad.headModel, wyglad.headTxt);    
}

addCommand("wyglad", CMD_Wyglad)
Reply


Messages In This Thread
RE: Zmiana wyglądu - brak działania - by Jenkins1131 - 22.11.2017, 22:35

Possibly Related Threads…
Thread Author Replies Views Last Post
  Brak listy serwerów Vaxu 6 6,185 06.05.2018, 22:28
Last Post: Wolfer
  Brak polskich znaków na komunikatach od servera nerdlv7 2 2,879 09.01.2018, 23:29
Last Post: nerdlv7
  Zmiana funkcji klawisza "enter" single player Jenkins1131 4 4,954 25.06.2017, 14:23
Last Post: Son Goku
  Zmiana czasu. Sirus 6 4,828 11.12.2016, 15:25
Last Post: Son Goku
  Instalacja gothic 2nk > brak folderów gry Sparrow22 11 9,993 01.10.2016, 16:25
Last Post: Sparrow22
  Brak ip hamachi Vanarius 3 3,540 10.07.2016, 16:58
Last Post: Krousainte
  Gotowy skrypt menu wyboru wyglądu Jaro 5 5,098 07.07.2016, 17:24
Last Post: Profesores
  Zmiana platformy na G2O, pomogę/zamierzam przepisać serwer. Propsin 1 2,531 26.02.2016, 19:52
Last Post: Ignisio
  Brak polskich znaków. Jaskier 18 14,994 05.02.2016, 21:02
Last Post: Son Goku
  Pobieranie czasu w onWorldChange, zmiana czasu w onWorldEnter Buras 0 1,583 06.01.2016, 14:00
Last Post: Buras

Forum Jump:


Users browsing this thread: 1 Guest(s)