Вернуться   CoderX :: Forums > Lineage II > L2PacketHack > Скриптинг
Войти через OpenID

Скриптинг Форум посвещенный созданию скриптов для L2PacketHack

Чат (Новых сообщений с момента вашего последнего визита нет)
Загрузка...
Задавайте ваши вопросы на форуме. Чат предназначен для небольших разговоров.
 
Ответ
 
Опции темы Опции просмотра
Старый 06.01.2009, 08:18   #1
Новичок
 
Регистрация: 06.01.2009
Сообщений: 3
Сказал Спасибо: 1
Имеет 0 спасибок в 0 сообщенях
sobapi пока неопределено
По умолчанию Script help

Hello, i've been starting to work on a simple block CharInfo script, and it works. The problems is that i need to enable it, when i'm in the city and disable it, when i go outside of town. That's the part i can't figure out.

This is the script:

Код:
begin
if (FromServer) then begin
                            if pck[1]=#$03 then
                            pck:='';
                            end;
end.
What i'm shooting for is something like this:

When FromClient -> 38 2D 00 69 00 6E 00 73 00 69 00 64 00 65 00 00 00 00 00 00 00 (Say '-inside' in the ALL chat room) -> enable script

When FromClient -> 38 2D 00 6F 00 75 00 74 00 73 00 69 00 64 00 65 00 00 00 00 00 00 00 (Say '-outside' in the ALL chat room) -> disable script


I can't figure out how to easily do it.
sobapi вне форума   Ответить с цитированием
Старый 06.01.2009, 13:00   #2
Рыцарь
 
Аватар для QaK
 
Регистрация: 28.09.2007
Сообщений: 1,558
Сказал Спасибо: 71
Имеет 351 спасибок в 244 сообщенях
QaK пока неопределено
По умолчанию

sobapi, try this
delphi Код:
var BS:bolean; procedure INIT; begin bs:=false;//default - block charinfo is false; end; begin if (fromclient) and (pck=Hstr('38 2D 00 69 00 6E 00 73 00 69 00 64 00 65 00 00 00 00 00 00 00') then bs:=true; if (fromclient) and (pck=Hstr('38 2D 00 6F 00 75 00 74 00 73 00 69 00 64 00 65 00 00 00 00 00 00 00') then bs:=false; if (FromServer) and (bs) and (pck[1]=#$03) then                             pck:='';                             end; end.
QaK вне форума   Ответить с цитированием
За это сообщение QaK нажился спасибкой от:
Старый 06.01.2009, 20:21   #3
Новичок
 
Регистрация: 06.01.2009
Сообщений: 3
Сказал Спасибо: 1
Имеет 0 спасибок в 0 сообщенях
sobapi пока неопределено
По умолчанию

Oh man, i owe you big time! It worked as a charm. Claps for you.

Now, and this is just for me to educate, i don't know why, but i had to change some tiny things. Maybe is my version of phx (3.1.8):

In green bolded the things i had to add:

delphi Код:
var BS:boolean;//----> i had to change bolean to boolean procedure INIT; begin bs:=false;//default - block charinfo is false; end; begin if (fromclient) and (pck=Hstr('38 2D 00 69 00 6E 00 73 00 69 00 64 00 65 00 00 00 00 00 00 00')) then bs:=true;//-----> I had to type that second close bracket. if (fromclient) and (pck=Hstr('38 2D 00 6F 00 75 00 74 00 73 00 69 00 64 00 65 00 00 00 00 00 00 00')) then bs:=false;//-----> I had to type that second close bracket. if (FromServer) and (bs) and (pck[1]=#$03) then  begin//------> i had to add that begin sentence.                             pck:='';                             end; end.

Let me break this down, and see if i understood:

You used that Boolean sentence as a on/off switch. You turn it on with the first package (-inside) and you turn it off with the second one (-outside).

And then you use that switch in the "if" to start the script.


Thanks you again man. I'm learning slow, but i'll get there
sobapi вне форума   Ответить с цитированием
Старый 06.01.2009, 22:53   #4
Рыцарь
 
Аватар для QaK
 
Регистрация: 28.09.2007
Сообщений: 1,558
Сказал Спасибо: 71
Имеет 351 спасибок в 244 сообщенях
QaK пока неопределено
По умолчанию

Цитата:
Сообщение от sobapi Посмотреть сообщение
i had to change bolean to boolean
oops
Цитата:
Сообщение от sobapi Посмотреть сообщение
begin//------> i had to add that begin sentence.
* * * * * * * * * * * * * * pck:='';
* * * * * * * * * * * * * * end;
double oops =)
i wrote this script for 5 minutes,so i didn't check this in PHK.
Цитата:
Сообщение от sobapi Посмотреть сообщение
Thanks you again man.
You wellcome =)
QaK вне форума   Ответить с цитированием
Ответ

  CoderX :: Forums > Lineage II > L2PacketHack > Скриптинг



Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


Часовой пояс GMT +4, время: 14:46.

vBulletin style designed by MSC Team.
Powered by vBulletin® Version 3.6.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot
Locations of visitors to this page
Rambler's Top100

Вы хотите чувствовать себя в безопасности? чоп Белган обеспечит её!