Syncope.T-*
Published 2011. 12. 8. 20:29
[4] Corelib의 활용 Steam/Event Script
728x90

Corelib 라는건 Es 플러그인 일반적이거나 Est 커맨드 중 들어있지않는 새로운 겁니다 그렇다고 따로 별도의 설치는 필요없습니다 Es에 내장되어있지만 우리는 항상 불러와서 쓰지를 않거든요 지금부터 말할 커맨드는 모두 Corelib 꺼니깐 es_load corelib를 autoexec 나 server.cfg 에다가 꼭 넣어주셔야 합니다. &&

Corelib 커맨드에는 이런것들이 있습니다

A

C

D

E

F

G

G cont.

I

K

L

N

P

P cont.

Q

R

S

T

U

V

W

X

Average - 평균 구하기

Cheatexec - 치트 커맨드 exec.
Clientcmd - regcmd 와 비슷한 커맨드 그러나 다름.

Damage - 데미지 주기
Downloadable - 다운로드 추가


Escinject - sql 관련

Forcecase - 여기서부터 Foreach 란건 각각 이란 뜻으로 해석 해 주시면 됩니다.
Foreach
Foreach entity
Foreach part
Foreach player - 예를들어 Foreach Player 라면 #human 이라는 게 들어가면 휴먼 전체의 이런거.
Foreach token
Foreach weapon

Getbotname
Getplayercount

Getplayerinfo
Getrandplayer


Inrange
Isnull
Isnumerical

Keyfilter
Keygrouprand
Keygroupremove
Keygroupsort
Keymath

Linkedlist

Nearcoord

Playerget
Playerset
Playervar
Profile

Profilecmd

Queue

Refcount
Repeat

Sqlx
Stack
Statlog

Texthandler

Uniqueid
Usermsg

Vecmath
Vote (Old)

While

Xalias

은근히 Get Set이 더 쉽고 sql 이나 vote 쪽 client 쪽이 더 어렵습니다. 이해하기도 어렵고 쓰기도 어렵죠 C++ 에 나오는 개념들을 익히고 넘어가야 할 겁니다. 설명하는건 저로서도 무리일지도 모르겠지만 정보를 공유하는 저는 꼭 해야하지도 않지만 그런 자신은 있기에 무턱대고 덤벼봅니다 ^^

가장 많이 쓰이는게

GetplayerInfo 와 Foreach 쪽 , NearCoord(근처 거리 까지 라는 공식) , Sql, 과 Usermsg(모든 기능을 여기서 하는거 같죠. )

마지막으로 Repeat.. 이 Repeat는 보스좀비 만들때도 씁니다 . 뭐. 굉장히 많이 사용되는것들중 하나죠.

NearCoord 도 많이 쓰이긴합니다 잘 쓰는사람들을 활용을 꽤나 잘하구요 못하는사람들은 끄적이다가 때려 치우기도하지요. 우린 함께 다 배워보도록 합시다. 차근차근 파트별로 나눌겁니다. 꼭필요한건만요. ^^

우선 오늘을 쉽게 나가야하니 Playerget/set 과 GetplayerInfo 에 대해서 알아보고 마치도록 하죠.

우선 GetplayerInfo 에 들어가보면 이렇게 나와 있습니다.

es getplayerinfo <variable> <userid> <infotype>

역 ) es getplayerinfo <변수> <유저아이디> <알아낼 정보 유형>

보기에도 아주 쉽게 느껴진다면 당신은 바로 이해하고 넘어가도 좋을겁니다 하지만 아직도 왜 변수에 저장되는지도 모르는 이라면 한번 집고 넘어 갈 필요가 있을겁니다.

알아낼 정보 유형에는 이런것들이 있습니다.

"name" - 이름

"steamid" - SteamID
"index" - 플레이어 엔티티 인덱스
"teamid" - Team IDs: 0 = 게임참가가 아닌 사람, 1 = 관전자, 2 = T, 3 = CT

"kills" - Kills
"deaths" - Deaths
"armor" - Armor
"model" - 플레이어 모델 이름
"isdead" - 1 = Dead, 0 = Alive
"isbot" - 1 = Bot, 0 = Client
"isobserver" - 1 = SourceTV Bot, 0 = Client/Bot
"health" - Health
"serialnumber" - 알려 진 바가 없음
"weapon" - weapon_xxxx 라는 무기명의 접두사를 알아냅니다, 예제. * weapon_scout
"handle" - 플레이어 핸들 값. ( ES 에서 핸들이란건 es_Fire에서 많이 쓰입니다.)
"ping" - Ping
"packetloss" - 잃어버린 패킷양
"timeconnected" - 플레이어의 접속 후 지난 시간
"address" - IP 주소
"x" - 크로스 헤어의 X 값
"y" - '' Y 값
"z" - '' Z 값

영어가 한글로 해석 되지 않는 부분들은 모두 다 아는 영어단어 이기에 그냥 생략했습니다.간단하니까요 만약 모른다고 하셔도 네이버에 검색해도 바로 나옵니다 그리고 이러실지도 모르죠 ' 아아 ~ 어디서 봤다 했다 ㅎ '

자 예제를 보면 바로 이해가 가실겁니다

event player_say

{

if (event_var(text) == "!정보") do

{

es_set myping 0

es getplayerinfo myping event_var(userid) ping

es_tell event_var(userid) 당신의 핑은 : server_var(myping) 입니다.

}

}

' 게임에서 만약 내 핑이 12 일때. 출력 메시지 : " 당신의 핑은 : 12 입니다. "

참 쉽죠? 맨 뒤에 타입만 바꿔주고 변수 이름만 알기쉽게 다른걸로 생성해주면서 계속 써 나가시면 바로 이해가 갈 지도 모르죠 이 정도는 뭐 쉬운거니 보시는 여러분들도 재밌어 하실겁니다. 다음으론 Playerget/set 에 알아보죠

playerget 과 playerset 이 있습니다 일반적으로 get은 얻는거고 set은 지정하는거다 라는 의미정돈 알아주시고 넘어가셔야합니다.

그렇습니다, get은 유저나 사물이 가지고있는 정보를 얻어오고 set은 유저나 유저들에게 어떤 값이나 부여할것을 set, 지정해 주죠.

구문 정리만하고 개념은 getplayerinfo 나 같기때문에 데이터 유형만을 설명하고 마치도록 하겠습니다

---------------------- Playerget ---------------------------

es playerget <command> [various parameters]

역 ) es playerget <명령어> [변수 파라미터]

어라? 명령어는 뭐 유형같은거겠고 변수 파라미턴는 뭐죠? 자 이건 아래글을 보시면 아실수가 있습니다

Parameters

  • command - Command you want to perform - one of the following
    • primary <var> <userid> [var_index] - Get the players Primary weapon
    • secondary <var> <userid> [var_index] - Get the players Secondary weapon
    • he <var> <userid> [var_index] - 1/0 if the player has an HE Grenade
    • sg <var> <userid> [var_index] - 1/0 if the player has a Smoke Grenade
    • fb <var> <userid> - 2/1/0 Get the player's number of Flashbangs
    • c4 <var> <userid> [var_index] - 1/0 if the player has a Bomb
    • weaponindex <var> <userid> <weapon_name> - Get the index of the player's weapon
    • viewangle <userid> <return pitch> <return yaw> <return roll> - Get the angle the player is looking
    • clip <var> <userid> <weapon / slot> - Get the amount of ammo in the player's clip
    • ammo <var> <userid> <weapon / slot> - Get the amount of ammo in the player's reserve
    • health <var> <userid> - Get the player's health
    • cash <var> <userid> - Get the player's cash
    • armor <var> <userid> - Get the player's armor
    • speed <var> <userid> - Get the player's speed
    • defuser <var> <userid> - 1/0 if the player has a defuser
    • viewvector <return vector> <userid> - Get the vector the player is looking in x, y, and z
    • distance <var> <player1> <player2> [plane] - Get the distance between 2 players in any plane(x,y,z,xy,xz,yz,xyz)
    • isdead <var> <userid> - 1/0 if the player dead or alive
  • Commands below were added after the first beta release of ES 1.5. See the Library section of the forum for updates of playergetset.
    • noclip <var> <userid> - 1/0 if the player has noclip active or not
    • jetpack <var> <userid> - 1/0 if the player has jetpack active or not
    • freeze <var> <userid> - 1/0 if the player has freeze active or not
    • location <userid> <x> <y> <z> - Location of the player
    • flashalpha <var> <userid> - Intensity of the flash hitting player(0-255)
    • flashduration <var> <userid> - Duration of the flash hitting player
    • viewcoord <userid> <x> <y> <z> - Location of the spot the player is looking at

자 이런겁니다. 만약 한 유저의 스피드를 알고싶다면 ? 이렇게 정리를 해 보죠

event player_say

{

if (event_var(text) == "나의스피드") do

{

es_set myspeed 0

es playerget speed myspeed event_var(userid)

es_tell event_var(userid) 나의 스피드 : server_var(myspeed)

}

}

자 이해가 가셧나요? speed란 커맨드 뒤에 따라나오는 저장할 변수와 유저아이디들이 파라미터 라는게 이해가 동시에 됐기를 빕니다.

Set 도 마찬가지입니다 아래에 커맨드만 써놓고 마치겠습니다

------------------------------------------------------------------------

---------------------------PlayerSet -----------------------------------

es playerset <command> [various parameters]

역 ) es playerset <명령어> [변수 파라미터]

Parameters

  • command - Command you want to perform - one of the following
    • clip <userid> <weapon / slot> <amount> - Set the amount of ammo in the player's clip
    • ammo <userid> <weapon / slot> <amount> - Set the amount of ammo in the player's reserve
    • health <userid> <amount> - Set the player's health
    • cash <userid> <amount> - Set the player's cash
    • armor <userid> <amount> - Set the player's armor
    • speed <userid> <amount> - Set the player's speed
    • defuser <userid> <1/0> - Set 1/0 to give/take a player's defuser
    • nightvision <userid> <1/0> - Set 1/0 to give/take a player's night vision
    • nightvisionon <userid> <1/0> - Set 1/0 to turn on/off a player's night vision
    • viewplayer <userid> <userid to view> - Force the player to look at another player(does not work on bots)
    • viewcoord <userid> <x> <y> <z> - Set the player to look at a coordinate
    • push <userid> <horiz> <vert> <0 - multiply vert/1 - use value for vert> - Give the player a push in the horizontal and vertical direction
    • model <userid> <model> - Set the player's model
    • color <userid> <red> <green> <blue> - Set the player's color
  • Commands below were added after the release of ES 1.5. See the Library section of the forum for updates to playergetset.
    • color <userid> <red> <green> <blue> [alpha] - Set the player's color and alpha
    • noclip <userid> <1/0> - Turn on or off noclip
    • jetpack <userid> <1/0> - Turn on or off jetpack
    • freeze <userid> <1/0> - Turn on or off player freeze
    • location <userid> <x> <y> <z> - Set the player's location
    • moveto <userid to move> <userid to move to> - Set the player close to another player (like teleport)
    • flash <userid> <alpha(0-255)> <duration> - Set the players view as if hit with a flashbang
    • cashadd <userid> <value to add/subtract> - Adds cash if value is positive or subtracts if value is negative
    • healthadd <userid> <value to add/subtract> - Adds health if value is positive or subtracts if value is negative
    • armoradd <userid> <value to add/subtract> - Adds armor if value is positive or subtracts if value is negative
    • speedadd <userid> <value to add/subtract> - Adds speed if value is positive or subtracts if value is negative

질문은 무조건적으로 받겠습니다. 쉬운 질문이라고 헛되게 답변을 해 드린다는것도 아닙니다 아주 자세하게 설명을 해 드릴겁니다 이해하실때까지요. 부탁드립니다. 잘못된거나 모르시는부분이있다면 바로 질문을 댓글로 달아주시면 하루 안으로 달아드리겠습니다

profile

Syncope.T-*

@Syncope

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

profile on loading

Loading...