How to make the condition? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Belo4ka_belka

How to make the condition?

13 Aug 2016, 12:31

Hello, I created a script for GTA games: SAMP. For this I downloaded a good UDF, which comes as an addition to the instructions for my script. The script has interestnaya function:
; # - IsPlayerDriver () check if player is driver #
(this is the name of the function in the description of the script)
Further:
; 1 = local player is driver
; 0 = local player is not driver
; -1 = Not inside a car or error
isPlayerDriver () {
if (! checkHandles ())
return -1
That's all I have for this function in the script. I want to make a condition that binds breakdowns when a player driver.

(This question is written via the Google translator, I myself am Russian, I'm sorry if there are some errors)
punchin
Posts: 439
Joined: 17 Jan 2014, 17:54

Re: How to make the condition?

14 Aug 2016, 11:23

First of all, there is a games subfield for game related questions. It might already have the answers your looking for.

Second, please better explain what you mean by "binds breakdowns".
User avatar
IvanVanko
Posts: 34
Joined: 14 Jul 2016, 11:40

Re: How to make the condition?

14 Aug 2016, 11:52

Could you please right on Russian? I don't understand a thing:)

Можете написать на русском? То что получилось на английском - абсолютно непонятно:)
Твой софт - говно!
punchin
Posts: 439
Joined: 17 Jan 2014, 17:54

Re: How to make the condition?

14 Aug 2016, 11:58

Прежде всего, есть игры подполе для игр , связанных с вопросами . Это , возможно, уже есть ответы ваш искать .

Во-вторых, пожалуйста, лучше объяснить, что вы имеете в виду под " связывает срывы " .
User avatar
IvanVanko
Posts: 34
Joined: 14 Jul 2016, 11:40

Re: How to make the condition?

14 Aug 2016, 12:01

punchin, I am sorry, that was addressed to OP :D
Твой софт - говно!
Belo4ka_belka

Re: How to make the condition?

14 Aug 2016, 12:51

Punchin, I do not think there is an answer regarding a particular script (I can not explain my problem as a generalized). Bind breakdowns = bind will activated when the player is the driver

IvanVanko, у меня есть проблема со скриптом. Я делаю скрипты для игры GTA San Andreas Multiplayer. Для того, чтобы я мог использовать функции посерьезнее (например вызывать диалоговые окна в SAMP, чего нельзя сделать с помощью программы QuickBinder), я скачал скрипт SAMP-UDF. Из этого скрипта мой скрипт берет новые команды (например ShowDialog). В этом UDF есть строчка:
; # - isPlayerDriver() check if player is driver #
. Прокрутив текст пониже, я нашел вот это:
; 1 = local player is driver
; 0 = local player is not driver
; -1 = not inside a car or error
isPlayerDriver() {
if(!checkHandles())
return -1
Это все, что есть об этой функции. Я хочу сделать условие в моем скрипте, чтобы он срабатывал, когда игрок является водителем. Я знаю, что это возможно, я не знаю, как это прописать. Пробовал прописать:
if (isPlayerDriver(1) )
- выдавало ошибку. Пытался
isPlayerDriver()
if (1)
- все равно ошибка.
Единственное что получилось это когда:
if (isPlayerDriver := 1)
скрипт срабатывал, но срабатывал постоянно, вне зависимости от того, в машине игрок или нет. А если вместо ":=" поставить "=" то выдает ошибку.

Вот как то так, надеюсь вы поможете мне.

English version (via Google Translate)
Spoiler
Belo4ka_belka
Posts: 2
Joined: 14 Aug 2016, 12:52

Re: How to make the condition?

14 Aug 2016, 12:54

Punchin, I do not think there is an answer regarding a particular script (I can not explain my problem as a generalized). Bind breakdowns = bind will activated when the player is the driver

IvanVanko, у меня есть проблема со скриптом. Я делаю скрипты для игры GTA San Andreas Multiplayer. Для того, чтобы я мог использовать функции посерьезнее (например вызывать диалоговые окна в SAMP, чего нельзя сделать с помощью программы QuickBinder), я скачал скрипт SAMP-UDF. Из этого скрипта мой скрипт берет новые команды (например ShowDialog). В этом UDF есть строчка:
; # - isPlayerDriver() check if player is driver #
. Прокрутив текст пониже, я нашел вот это:
; 1 = local player is driver
; 0 = local player is not driver
; -1 = not inside a car or error
isPlayerDriver() {
if(!checkHandles())
return -1
Это все, что есть об этой функции. Я хочу сделать условие в моем скрипте, чтобы он срабатывал, когда игрок является водителем. Я знаю, что это возможно, я не знаю, как это прописать. Пробовал прописать:
if (isPlayerDriver(1) )
- выдавало ошибку. Пытался
isPlayerDriver()
if (1)
- все равно ошибка.
Единственное что получилось это когда:
if (isPlayerDriver := 1)
скрипт срабатывал, но срабатывал постоянно, вне зависимости от того, в машине игрок или нет. А если вместо ":=" поставить "=" то выдает ошибку.

Вот как то так, надеюсь вы поможете мне.

English version (via Google Translate)
Spoiler
User avatar
IvanVanko
Posts: 34
Joined: 14 Jul 2016, 11:40

Re: How to make the condition?

15 Aug 2016, 16:31

Давайте попробуем так:

Let's try this one:

Code: Select all

Driving := isPlayerDriver()
If Driving 
	{
	msgbox, player is a driver! 
	return
	}
else 
	{
	msgbox, player is not a driver! 
	return
	}
Не уверен, но по идее должно получиться. И да, вам скорее всего нужно завернуть это дело в Loop, чтобы проверка была постоянной.

I am not sure, but this should work. And you should probably use Loop to make this check work constantly.
Твой софт - говно!
Belo4ka_belka
Posts: 2
Joined: 14 Aug 2016, 12:52

Re: How to make the condition?

16 Aug 2016, 01:46

Это работает! Сначала работало, будто игрок всегда водитель (вне зависимости от этого), но когда я добавил проверку через IfPlayerInAnyVehicle и вставил ИфПлаерИсДривер в условие, то все заработало. Отлично, спасибо большое!

English:
Spoiler
Code:
Spoiler
User avatar
joedf
Posts: 9000
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: How to make the condition?

16 Aug 2016, 08:21

It's funny, because we do have a Russian forum :0
Sure, not many users... Trying to build a user base :p
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: apeironn, fiaztv1, Google [Bot], Pianist and 194 guests