1. 0B75: samp get_chat_string 1@ text_to 2@ prefix_to 3@ color_to 4@ prefix_color_to 5@1. как записать в переменную последнюю строчку чата?
2. вот, к примеру, есть серверный диалог с идом 5, как получить в переменную то что я туда ввел?
Почему обрезает сообщение?
Из 117 символов ( это с пробелами)
Пишет всего 94.
Через обычный биндер выводит всё сообщение .
Почему обрезает сообщение?
Из 117 символов ( это с пробелами)
Пишет всего 94.
Через обычный биндер выводит всё сообщение .
OpcodeResult WINAPI Script_InifileReadString(CScriptThread* thread)
/****************************************************************
Opcode Format
0AF4=4,%4d% = read_string_from_ini_file %1s% section %2s% key %3s%
****************************************************************/
{
char iniPath[MAX_PATH];
char path[100];
char sectionName[100];
char key[100];
char strValue[100];
char *strptr;
BOOL result;
CLEO_ReadStringOpcodeParam(thread, path, sizeof(path));
CLEO_ReadStringOpcodeParam(thread, sectionName, sizeof(sectionName));
CLEO_ReadStringOpcodeParam(thread, key, sizeof(key));
//if path is short, GetPrivateProfileString() searches for the file in the Windows directory
MakeFullPath(path, iniPath);
result = GetPrivateProfileString(sectionName, key, NULL, strValue, sizeof(strValue), iniPath);
if (result)
{
switch (CLEO_GetOperandType(thread))
{
case globalVarVString:
case localVarVString:
case globalVarSString:
case localVarSString:
CLEO_WriteStringOpcodeParam(thread, strValue);
break;
default:
strptr = (char *)CLEO_GetIntOpcodeParam(thread);
strcpy(strptr, strValue);
}
}
else
CLEO_SkipOpcodeParams(thread, 1);
CLEO_SetThreadCondResult(thread, result);
return OR_CONTINUE;
}
Хелп, нужен скрипт, каждые N секунд жмакает клавишу W, помогите, срочно(
{$CLEO}
const
N_SECOND = 5
end
0000:
0662: "by legend2360"
0662: "BlastHack - cheating is art"
while not SAMP.Available()
wait 400
end
var
0@ : int
33@ : int
end
0A90: 0@ = N_SECOND * 1000
33@ = 0
while true
wait 0
if 33@ >= 0@
then
0B56: set_game_key 1 state 0xffff
33@ = 0
end
end
Судя по куску из библиотеки CLEO: IniFiles.cleo:
Макс. кол-во символов = 100.Код:OpcodeResult WINAPI Script_InifileReadString(CScriptThread* thread) /**************************************************************** Opcode Format 0AF4=4,%4d% = read_string_from_ini_file %1s% section %2s% key %3s% ****************************************************************/ { char iniPath[MAX_PATH]; char path[100]; char sectionName[100]; char key[100]; char strValue[100]; char *strptr; BOOL result; CLEO_ReadStringOpcodeParam(thread, path, sizeof(path)); CLEO_ReadStringOpcodeParam(thread, sectionName, sizeof(sectionName)); CLEO_ReadStringOpcodeParam(thread, key, sizeof(key)); //if path is short, GetPrivateProfileString() searches for the file in the Windows directory MakeFullPath(path, iniPath); result = GetPrivateProfileString(sectionName, key, NULL, strValue, sizeof(strValue), iniPath); if (result) { switch (CLEO_GetOperandType(thread)) { case globalVarVString: case localVarVString: case globalVarSString: case localVarSString: CLEO_WriteStringOpcodeParam(thread, strValue); break; default: strptr = (char *)CLEO_GetIntOpcodeParam(thread); strcpy(strptr, strValue); } } else CLEO_SkipOpcodeParams(thread, 1); CLEO_SetThreadCondResult(thread, result); return OR_CONTINUE; }
Не знаю даже,попробуй так.Как определить, что игрок находится в определенном радиусе от тебя и как вставить это в условие
Actor.Storepos($PLAYER_ACTOR, 1@ 2@ 3@ )
0@ = random_actor_near_point 1@ 2@ 3@ in_radius 100.0 find_next 1 pass_deads 1
Не знаю даже,попробуй так.
PHP:Actor.Storepos($PLAYER_ACTOR, 1@ 2@ 3@ ) 0@ = random_actor_near_point 1@ 2@ 3@ in_radius 100.0 find_next 1 pass_deads 1
Это поиск актора и он не работает
1. 0B75: samp get_chat_string 1@ text_to 2@ prefix_to 3@ color_to 4@ prefix_color_to 5@
2. 0B3C: samp is_dialog_responded id 1@ button 2@ list_item 3@ input_text 4@
{$CLEO .cs}
//-------------MAIN---------------
0000: NOP
0662: printstring "by legend2360"
0662: printstring "BlastHack - cheating is art"
:Noname_10
wait 1000
0A8D: 0@ = read_memory 12234560 size 10 virtual_protect 0
:Noname_20
wait 0
0A8D: 1@ = read_memory 0@ size 1 virtual_protect 0
if
1@ == 0
else_jump @Noname_20
wait 0
0@ += 3
0A8D: 1@ = read_memory 0@ size 2 virtual_protect 0
0@ -= 3
0AC7: 2@ = var 1@ offset
0AD4: 5@ = scan_string 2@ format "%d" 6@ //IF and SET
call @redblack 1 id 6@ to 7@ // 6@ - число 0-36; 7@ - цвет числа
0AF8: samp add_message_to_chat "Выпало {ffa500}%d %s" color -1 6@ 7@
1@ = 0
:Noname_30
wait 0
1@ == 0
else_jump @Noname_20
0A8D: 1@ = read_memory 0@ size 1 virtual_protect 0
jump @Noname_30
:redblack
0AC6: 7@ = label @colors offset
6@ *= 6
005A: 7@ += 6@ // (int)
ret 1 7@
:colors
hex
"Green" 00 { 0 }
"Red" 00 00 00 { 1 }
"Black" 00 { 2 }
"Red" 00 00 00 { 3 }
"Black" 00 { 4 }
"Red" 00 00 00 { 5 }
"Black" 00 { 6 }
"Red" 00 00 00 { 7 }
"Black" 00 { 8 }
"Red" 00 00 00 { 9 }
"Black" 00 { 10 }
"Black" 00 { 11 }
"Red" 00 00 00 { 12 }
"Black" 00 { 13 }
"Red" 00 00 00 { 14 }
"Black" 00 { 15 }
"Red" 00 00 00 { 16 }
"Black" 00 { 17 }
"Red" 00 00 00 { 18 }
"Red" 00 00 00 { 19 }
"Black" 00 { 20 }
"Red" 00 00 00 { 21 }
"Black" 00 { 22 }
"Red" 00 00 00 { 23 }
"Black" 00 { 24 }
"Red" 00 00 00 { 25 }
"Black" 00 { 26 }
"Red" 00 00 00 { 27 }
"Black" 00 { 28 }
"Black" 00 { 29 }
"Red" 00 00 00 { 30 }
"Black" 00 { 31 }
"Red" 00 00 00 { 32 }
"Black" 00 { 33 }
"Red" 00 00 00 { 34 }
"Black" 00 { 35 }
"Red" 00 00 00 { 36 }
end
Потому что в функция все переменные начинаются с 0@.да, я пробовал с этими опкодами, и нифига не работало, щас еще раз попробовал, с чатом вроде разобрался.
и теперь вопрос
я решил добавить в скрипт эту функу http://blasthack.net/threads/call-scm-funcs.897/#post-9917
но чего не работает, и какое бы не выпало число из 36, всегда пишет 1 пункт - Green. например "21 Green". я хз почему не работает. в чем проблема?
Код:{$CLEO .cs} //-------------MAIN--------------- 0000: NOP 0662: printstring "by legend2360" 0662: printstring "BlastHack - cheating is art" :Noname_10 wait 1000 0A8D: 0@ = read_memory 12234560 size 10 virtual_protect 0 :Noname_20 wait 0 0A8D: 1@ = read_memory 0@ size 1 virtual_protect 0 if 1@ == 0 else_jump @Noname_20 wait 0 0@ += 3 0A8D: 1@ = read_memory 0@ size 2 virtual_protect 0 0@ -= 3 0AC7: 2@ = var 1@ offset 0AD4: 5@ = scan_string 2@ format "%d" 6@ //IF and SET call @redblack 1 id 6@ to 7@ // 6@ - число 0-36; 7@ - цвет числа 0AF8: samp add_message_to_chat "Выпало {ffa500}%d %s" color -1 6@ 7@ 1@ = 0 :Noname_30 wait 0 1@ == 0 else_jump @Noname_20 0A8D: 1@ = read_memory 0@ size 1 virtual_protect 0 jump @Noname_30 :redblack 0AC6: 7@ = label @colors offset 6@ *= 6 005A: 7@ += 6@ // (int) ret 1 7@ :colors hex "Green" 00 { 0 } "Red" 00 00 00 { 1 } "Black" 00 { 2 } "Red" 00 00 00 { 3 } "Black" 00 { 4 } "Red" 00 00 00 { 5 } "Black" 00 { 6 } "Red" 00 00 00 { 7 } "Black" 00 { 8 } "Red" 00 00 00 { 9 } "Black" 00 { 10 } "Black" 00 { 11 } "Red" 00 00 00 { 12 } "Black" 00 { 13 } "Red" 00 00 00 { 14 } "Black" 00 { 15 } "Red" 00 00 00 { 16 } "Black" 00 { 17 } "Red" 00 00 00 { 18 } "Red" 00 00 00 { 19 } "Black" 00 { 20 } "Red" 00 00 00 { 21 } "Black" 00 { 22 } "Red" 00 00 00 { 23 } "Black" 00 { 24 } "Red" 00 00 00 { 25 } "Black" 00 { 26 } "Red" 00 00 00 { 27 } "Black" 00 { 28 } "Black" 00 { 29 } "Red" 00 00 00 { 30 } "Black" 00 { 31 } "Red" 00 00 00 { 32 } "Black" 00 { 33 } "Red" 00 00 00 { 34 } "Black" 00 { 35 } "Red" 00 00 00 { 36 } end
:redblack
0AC6: 1@ = label @colors offset
0@ *= 6
005A: 1@ += 0@ // (int)
ret 1 1@
1. 0B75: samp get_chat_string 1@ text_to 2@ prefix_to 3@ color_to 4@ prefix_color_to 5@
2. 0B3C: samp is_dialog_responded id 1@ button 2@ list_item 3@ input_text 4@
{$CLEO .cs}
0000: NOP
:n_1
wait 1000
0B4E: samp 1@ = get_current_dialog_id
if
1@ == 87
jf @n_1
:n_3
wait 0
if
0B3C: samp is_dialog_responded id 1@ button 2@ list_item 3@ input_text 4@
jf @n_3
if and
1@ == 87 // диалог помоши
2@ == 2 // кнопка cancel
jf @n_3
0AF8: samp add_message_to_chat "dialog closed %d" 0xBA0FFF 1@
0A93: end_custom_thread
Ид диалога нужно указывать сразу в проверке. (0B3C: samp is_dialog_responded id 1488 button 2@ list_item 3@ input_text 4@)вот если с чатом все понятно, то с диалогом, как ни пытался, нихуя не работает
как закрываю диалог, в чат сообщение не пишется, вся игра замедляется и лагает, сдается мне что он только со своими диалогами работает, а для серверных другой способ, или нет?
Код:{$CLEO .cs} 0000: NOP :n_1 wait 1000 0B4E: samp 1@ = get_current_dialog_id if 1@ == 87 jf @n_1 :n_3 wait 0 if 0B3C: samp is_dialog_responded id 1@ button 2@ list_item 3@ input_text 4@ jf @n_3 if and 1@ == 87 // диалог помоши 2@ == 2 // кнопка cancel jf @n_3 0AF8: samp add_message_to_chat "dialog closed %d" 0xBA0FFF 1@ 0A93: end_custom_thread