SphereCommunity
Function f_onser - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Function f_onser (/Thread-Function-f-onser)



Function f_onser - Elmortis - 08-05-2012 12:09 AM

Hi all, i have one problem. I wont when player create char and using in client race buton betwen i need change body player for guard system, but all create char have one race, not importend player use button or not

sorry my bad english
Code:
[FUNCTION f_onchar_create]
IF StrMatch("*'*","<SRC.NAME>") || StrMatch("*`*","<SRC.NAME>")
   SERV.LOG @[Account: <ARGS>] Char: <SRC.NAME> - Character name is forbidden.
   SRC.TAG.Delete=1
   SENDPACKET 053 B02
   SENDPACKET 026 B01
ELIF (<SERV.SQL_AccountCharacterExists 1,<SRC.NAME>>)
   SERV.LOG @[Account: <ARGS>] Char: <SRC.NAME> - Character name already exists.
   SRC.TAG.Delete=1
   SENDPACKET 053 B02
   SENDPACKET 026 B01
ELIF (<SERV.SQL_AccountCharacterCreate 1,<ARGS>,<SRC.NAME>,<SRC.UID>,<SERV.ACCOUNT.<ARGS>.LASTIP>>,<SERV.RTIME>>)
   SERV.LOG @[Account: <ARGS>] Char: <SRC.NAME> - Character successfull created to SQL.

   // 3010,3370,15 - Serpents Hold (Vampire)
   // 1496,1629,10 - Britain (Humans)
   SRC.HOME = <QVAL (<ARGN3>)?3010,3370,15,0:1496,1629,10,0>
   SRC.P = <SRC.HOME> // Установка где будет появляться персонаж
   // Цвет кожи вампиров всегда 0 (серый)
   SRC.OSKIN = <QVAL (<ARGN3>)?0:<SRC.OSKIN>>
   SRC.COLOR = <QVAL (<ARGN3>)?0:<SRC.COLOR>>
   SERV.LOG @> Character Name: <SRC.NAME>
   SERV.LOG @> Flags: <ARGN1>
   SERV.LOG @> Class: <ARGN3>
   SERV.LOG @> Profession: <ARGN2>
   SERV.LOG @> Home at: <SRC.HOME>
   SERV.LOG @> Start at: <SRC.P> [<SRC.REGION.NAME>]
   IF StrMatch("*_woman","<SRC.OBODY>")
      SERV.NEWITEM=i_shirt_plain,1,<SRC.UID>
      NEW.ATTR=attr_newbie
      NEW.COLOR=colors_all
      SERV.NEWITEM=random_skirt,1,<SRC.UID>
      NEW.ATTR=attr_newbie
      NEW.COLOR=colors_neutral
      SERV.NEWITEM=random_shoes,1,<SRC.UID>
      NEW.ATTR=attr_newbie
      NEW.COLOR=colors_neutral
   ELSE
      SERV.NEWITEM=i_shirt_plain,1,<SRC.UID>
      NEW.ATTR=attr_newbie
      NEW.COLOR=colors_all
      SERV.NEWITEM=random_pants,1,<SRC.UID>
      NEW.ATTR=attr_newbie
      NEW.COLOR=colors_neutral
      SERV.NEWITEM=random_shoes,1,<SRC.UID>
      NEW.ATTR=attr_newbie
      NEW.COLOR=colors_neutral
   ENDIF
   SERV.NEWITEM=i_spellbook,1,<SRC.FINDLAYER.21.UID>
   NEW.ATTR=attr_newbie
   SERV.NEWITEM=i_coin_silver,1000,<SRC.FINDLAYER.21.UID>
   SERV.NEWITEM={i_cutlass 1 i_kryss 1 i_maul 1},1,<SRC.FINDLAYER.21.UID>
   NEW.ATTR=attr_newbie
ELSE
   SERV.LOG @ERROR: [Account: <ARGS>] Char: <SRC.NAME> - Fail to create record into SQL.
   SRC.TAG.Delete=2
   SENDPACKET 053 B02
   SENDPACKET 026 B01
ENDIF
// This function is called after client have created a new char.
// SRC --> char being created
// ARGN1 --> flags
// ARGN2 --> profession chosen
// ARGN3 --> elf
// ARGS  --> account name

IF(<ARGN3> == 2) || StrMatch("c_elf_man","<SRC.OBODY>")
SRC.OBODY = cv_man
ELIF StrMatch("c_elf_woman","<SRC.OBODY>")
SRC.OBODY = cv_woman
ENDIF



RE: Function f_onser - Elmortis - 08-05-2012 10:58 PM

I fixx this problem