<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK-скрипт для SA:MP]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=11617&amp;type=atom" />
	<updated>2016-07-16T17:04:18Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=11617</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=106116#p106116" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#SingleInstance force
#NoEnv
#include SAMPMAXnew.ahk
#IfWinActive GTA:SA:MP
ListLines Off
SetBatchLines -1
SetKeyDelay 0
Chat := A_MyDocuments &quot;\GTA San Andreas User Files\SAMP\chatlog.txt&quot;
#Persistent
global TazerTo:= -1
global TazerIn := 0
global TazerOut:=0
Loop
{
TempWeapon := getPlayerWeaponId()
if (TempWeapon = 23) or(TempWeapon = 3)
	if not TazerIn
	{
		TazerIn := 1
		if TazerSleep
			SetTimer TakeGun, 100
		else
		SetTimer TakeGun, %SleepOn%
	}
	if (TempWeapon = 24) or (TempWeapon = 25) or (TempWeapon = 29) or (TempWeapon = 31) or (TempWeapon = 17) or (TempWeapon = 1) or (TempWeapon = 5) or (TempWeapon = 14) or (TempWeapon = 30) or (TempWeapon = 33) or (TempWeapon = 34) or (TempWeapon = 43) or (TempWeapon = 46) or (TempWeapon = 15) or (TempWeapon = 36) or (TempWeapon = 2)  {
		if not TazerIn
		{
			TazerIn := 1
			SetTimer TakeGun, %SleepOn%
		}
	}
	if (TempWeapon = 0)
	{
		if (TazerOut &gt; 1) and (TazerTo)
		{
			TazerTo := 0
			SetTimer UnloadGun, %SleepOff%
		}
	}
	Sleep 100
}
TakeGun:
TempWeapon := getPlayerWeaponId()
if (TempWeapon = 24) and (TazerOut != 2) {
     SendChat(&quot;/do Пистолет в кобуре.&quot;)
     SendChat(&quot;/me быстрым движением правой руки открыл&quot; Female &quot; кобуру и вытащил&quot; Female &quot; пистолет.&quot;)
     SendChat(&quot;/me снял&quot; Female &quot; пистолет с предохранителя.&quot;)
	TazerOut:=2
}
if (TempWeapon = 3) and (TazerOut != 3) {
        SendChat(&quot;/do Дубинка висит на поясе.&quot;)
	SendChat(&quot;/me резким движение снял&quot; Female &quot; дубинку с поясного держателя.&quot;)
	TazerOut:=3
}
if (TempWeapon = 23) and (TazerOut != 4) {
	SendChat(&quot;/me снял&quot; Female &quot; электрошокер с пояса&quot;)
	TazerOut:=4
}
if (TempWeapon = 25) and (TazerOut != 5) {
	SendChat(&quot;/me вытащил &quot; Female &quot; дробовик из-за спины&quot;)
        SendChat(&quot;/me снял&quot; Female &quot; дробовик с предохранителя&quot;)
	TazerOut:=5
}
if (TempWeapon = 29) and (TazerOut != 6) {
	SendChat(&quot;/me взял&quot; Female &quot; MP-5 в руки.&quot;)
	TazerOut:=6
}
if (TempWeapon = 31) and (TazerOut != 7) {
	SendChat(&quot;/me достал&quot; Female &quot; карабин M4 из-за плеча&quot;)
        SendChat(&quot;/me снял&quot; Female &quot; M4 с предохранителя&quot;)
	TazerOut:=7
}
if (TempWeapon = 17) and (TazerOut != 8) {
	SendChat(&quot;/me надел&quot; Female &quot; противогаз.&quot;)
	Sleep 2000
	SendChat(&quot;/me достал&quot; Female &quot; светошумовую гранату.&quot;)
	TazerOut:=8
}
if (TempWeapon = 1) and (TazerOut != 9) {
	SendChat(&quot;/me надел&quot; Female &quot; кастет на руку.&quot;)
	TazerOut:=9
}
if (TempWeapon = 5) and (TazerOut != 10) {
	SendChat(&quot;/me взял&quot; Female &quot; бейсбольную биту в руки.&quot;)
	TazerOut:=10
}
if (TempWeapon = 14) and (TazerOut != 11) {
	SendChat(&quot;/me развернул&quot; Female &quot; букет цветов.&quot;)
	TazerOut:=11
}
if (TempWeapon = 30) and (TazerOut != 12) {
	SendChat(&quot;/me взял&quot; Female &quot; автомат АК-47 в руки.&quot;)
	TazerOut:=12
}
if (TempWeapon = 33) and (TazerOut != 13) {
	SendChat(&quot;/me взял&quot; Female &quot; винтовку в руки.&quot;)
	TazerOut:=13
}
if (TempWeapon = 34) and (TazerOut != 14) {
	SendChat(&quot;/me достал&quot; Female &quot; снайперскую винтовку из-за плеча&quot;)
        SendChat(&quot;/me снял&quot; Female &quot; снайперскую винтовку с предохранителя&quot;)
	TazerOut:=14
}
if (TempWeapon = 43) and (TazerOut != 15) {
	SendChat(&quot;/me достал&quot; Female &quot; фотоаппарат.&quot;)
	TazerOut:=15
}
if (TempWeapon = 46) and (TazerOut != 16) {
	SendChat(&quot;/me одел&quot; Female &quot; парашют на плечи.&quot;)
	TazerOut:=16
}
if (TempWeapon = 15) and (TazerOut != 17) {
	SendChat(&quot;/me достал&quot; Female &quot; элегантную трость.&quot;)
	TazerOut:=17
}
if (TempWeapon = 36) and (TazerOut != 18) {
	SendChat(&quot;/me взял&quot; Female &quot; Stinger в руки.&quot;)
	TazerOut:=18
}
if (TempWeapon = 2) and (TazerOut != 19) {
	SendChat(&quot;/me взял&quot; Female &quot; клюшку в руки.&quot;)
	TazerOut:=19
}
TazerIn := 0
TazerTo := 1
SetTimer TakeGun, Off
return

UnloadGun:
TempWeapon := getPlayerWeaponId()
if not (TempWeapon = 24) and (TazerOut = 2)
{
            SendChat(&quot;/me поставил&quot; Female &quot; пистолет на предохранитель.&quot;)
            SendChat(&quot;/me быстрым движением руки засунул&quot; Female &quot; пистолет в кобуру и застегнул&quot; Female &quot; ее.&quot;)
}
if not (TempWeapon = 3) and (TazerOut = 3)
{
            SendChat(&quot;/me повесил&quot; Female &quot; дубинку на пояс.&quot;)
            SendChat(&quot;/do Дубинка на поясе.&quot;)
}
if not (TempWeapon = 23) and (TazerOut = 4)
{
SendChat(&quot;/me повесил&quot; Female &quot; электрошокер на пояс.&quot;)
}
if not (TempWeapon = 3) and (TazerOut = 5)
{
            SendChat(&quot;/me поставил&quot; Female &quot; дробовик на предохранитель&quot;)
            SendChat(&quot;/me повесил&quot; Female &quot; дробовик на плечо&quot;)
}
if not (TempWeapon = 3) and (TazerOut = 6)
{
SendChat(&quot;/me повесил&quot; Female &quot; MP-5 на плечо.&quot;)
}
if not (TempWeapon = 31) and (TazerOut = 7)
{
            SendChat(&quot;/me поставил&quot; Female &quot; М4 на предохранитель&quot;)
            SendChat(&quot;/me повесил&quot; Female &quot; M4 на плечо&quot;)
}
if not (TempWeapon = 1) and (TazerOut = 9)
{
SendChat(&quot;/me снял&quot; Female &quot; кастет.&quot;)
}
if not (TempWeapon = 5) and (TazerOut = 10)
{
SendChat(&quot;/me спрятал&quot; Female &quot; биту.&quot;)
}
if not (TempWeapon = 14) and (TazerOut = 11)
{
SendChat(&quot;/do Цветы не в руках.&quot;)
}
if not (TempWeapon = 30) and (TazerOut = 12)
{
SendChat(&quot;/me убрал&quot; Female &quot; АК-47 за спину.&quot;)
}
if not (TempWeapon = 33) and (TazerOut = 13)
{
SendChat(&quot;/me убрал&quot; Female &quot; винтовку.&quot;)
}
if not (TempWeapon = 34) and (TazerOut = 14)
{
            SendChat(&quot;/me поставил&quot; Female &quot; снайперскую винтовку на предохранитель&quot;)
            SendChat(&quot;/me повесил&quot; Female &quot; снайперскую винтовку на плечо&quot;)
}
if not (TempWeapon = 43) and (TazerOut = 15)
{
SendChat(&quot;/me закрыл&quot; Female &quot; крышечкой объектив фотоаппарата.&quot;)
}
if not (TempWeapon = 46) and (TazerOut = 16)
{
SendChat(&quot;/me снял&quot; Female &quot; парашют.&quot;)
}
TazerOut:=0
SetTimer UnloadGun, Off
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Pavlik111222]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34042</uri>
			</author>
			<updated>2016-07-16T17:04:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=106116#p106116</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104158#p104158" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>tawer31rus пишет:</cite><blockquote><p>Это все долго) Надо прямо чтобы я поменял оружия, и сразу же пошла отыгровка.<strong>Dworkin</strong></p></blockquote></div><p>ну вместо кнопки Z ставишь цикл и все.</p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2016-05-24T08:33:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104158#p104158</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104062#p104062" />
			<content type="html"><![CDATA[<p>Это все долго) Надо прямо чтобы я поменял оружия, и сразу же пошла отыгровка.<strong>Dworkin</strong></p>]]></content>
			<author>
				<name><![CDATA[tawer31rus]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33903</uri>
			</author>
			<updated>2016-05-22T19:07:46Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104062#p104062</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104061#p104061" />
			<content type="html"><![CDATA[<p>Тут надо работать с памятью игры(тоесть считывать адресс) либо использовать функцию из samp UDF, которая определяет ид оружия в руке(вроде в каком-то UDF видел). А далее в зависимости от ида в руке уже пишет то что тебе надо в чат. Что бы писало в чат тоже используй функции UDF.<br />Какой ид относится к оружию можешь найти в интернете.<br />Если будешь сам считывать память то вот тебе адрес. Считывать надо в 1 byte то есть в Char. Он показывает ид оружия в руке:<br /></p><div class="codebox"><pre><code>0xB6F5F0(основной адрес) + 0x740(оффсет)</code></pre></div><p>Я бы сделал код примерно в такой логике:<br />Выбрал оружие(пока ничего не происходит это делаешь руками). Далее вступает в действие скрипт.<br />Жмешь например Z. Скрипт считывает ид оружия. Далее в зависимости от условия пишет в чат.</p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2016-05-22T18:48:26Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104061#p104061</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104055#p104055" />
			<content type="html"><![CDATA[<p><strong>SeaVodikendu</strong></p>]]></content>
			<author>
				<name><![CDATA[tawer31rus]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33903</uri>
			</author>
			<updated>2016-05-22T16:34:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104055#p104055</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104054#p104054" />
			<content type="html"><![CDATA[<p><strong>SeaVodikendu</strong> Вот этот AHK. Где есть эта смена оружия. Взломать у меня не получилось)</p>]]></content>
			<author>
				<name><![CDATA[tawer31rus]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33903</uri>
			</author>
			<updated>2016-05-22T16:33:07Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104054#p104054</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104053#p104053" />
			<content type="html"><![CDATA[<p>Я не знаю, записывает ли игра логи в файл, о том какое оружие в руках. Тогда можно было бы сделать как ты хочешь. Но это навряд ли.<br />Еще такой вариант:<br />При нажатии хоткея будет всплывать окно с выбором оружия (какое имеется в арсенале). И тогда при прокрутки колеса мыши, оно будет меняться и соответствующая отыгровка к нему.</p>]]></content>
			<author>
				<name><![CDATA[SeaVodikendu]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33752</uri>
			</author>
			<updated>2016-05-22T16:09:45Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104053#p104053</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104052#p104052" />
			<content type="html"><![CDATA[<p>Нет. Я щелкаю колесиком мыши. И это не зависит, а если будет 2 оружия, как тогда?<strong>SeaVodikendu</strong></p>]]></content>
			<author>
				<name><![CDATA[tawer31rus]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33903</uri>
			</author>
			<updated>2016-05-22T15:31:07Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104052#p104052</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104048#p104048" />
			<content type="html"><![CDATA[<p><strong>tawer31rus</strong><br />Но ты ведь нажимаешь клавишу, когда меняешь оружие. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />На этом принципе и строится код.</p>]]></content>
			<author>
				<name><![CDATA[SeaVodikendu]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33752</uri>
			</author>
			<updated>2016-05-22T11:06:29Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104048#p104048</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104047#p104047" />
			<content type="html"><![CDATA[<p>Нет. Это не то..<br />Надо что бы я не нажимал клавиши... а он автомотически это делал, когда я менял оружия.<strong>SeaVodikendu</strong></p>]]></content>
			<author>
				<name><![CDATA[tawer31rus]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33903</uri>
			</author>
			<updated>2016-05-22T10:01:02Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104047#p104047</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104046#p104046" />
			<content type="html"><![CDATA[<p>Благодарю. Держи +<strong>SeaVodikendu</strong></p>]]></content>
			<author>
				<name><![CDATA[tawer31rus]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33903</uri>
			</author>
			<updated>2016-05-22T09:52:44Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104046#p104046</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104045#p104045" />
			<content type="html"><![CDATA[<p>К примеру:<br /></p><div class="codebox"><pre><code>
2::
sendinput, {vk32}
sleep 500
sendinput, {f6}/me Достал из кобуры Deagle{enter}
return</code></pre></div><p>&quot;2&quot; - горячая клавиша для смены &quot;с кулака на Deagle&quot;.</p>]]></content>
			<author>
				<name><![CDATA[SeaVodikendu]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33752</uri>
			</author>
			<updated>2016-05-22T09:37:28Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104045#p104045</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104044#p104044" />
			<content type="html"><![CDATA[<p><strong>SeaVodikendu</strong> Сам код я незнаю. А под себя я сам смогу сделать)</p>]]></content>
			<author>
				<name><![CDATA[tawer31rus]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33903</uri>
			</author>
			<updated>2016-05-22T08:21:33Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104044#p104044</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104043#p104043" />
			<content type="html"><![CDATA[<p><strong>SeaVodikendu</strong> Хотя бы код с кулака на Deagle, и что бы была отыгровка.</p>]]></content>
			<author>
				<name><![CDATA[tawer31rus]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33903</uri>
			</author>
			<updated>2016-05-22T08:19:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104043#p104043</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK-скрипт для SA:MP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104041#p104041" />
			<content type="html"><![CDATA[<p>Вариантов много как сделать. На какие кнопки оружие меняешь?</p>]]></content>
			<author>
				<name><![CDATA[SeaVodikendu]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33752</uri>
			</author>
			<updated>2016-05-22T04:59:36Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104041#p104041</id>
		</entry>
</feed>
