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, 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
IvanVanko, I have a problem with the script. I'm doing a script for the game GTA San Andreas Multiplayer. In order for me to use the function is more serious (such as a dialog box in the SAMP, which can not be done using QuickBinder program), I downloaded the SAMP-UDF script. This script takes my script new commands (eg ShowDialog). This UDF is a line:
[color = # 00BF40]; # - IsPlayerDriver () check if player is driver # [/color]
. Scrolling text lower down, I found this:
; 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 there is on this feature. I want to make a condition in my script, so that it is activated when the player is the driver. I know that this is possible, I do not know how to register. I tried to register:
if (isPlayerDriver (1))
- generate an error. Had tried
isPlayerDriver ()
if (1)
- is still a mistake.
The only thing that happened is when:
if (isPlayerDriver: = 1)
script breakdowns, but it works all the time, regardless of whether the player in the car or not. And if instead of ": =" put "=" is an error.
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
IvanVanko, I have a problem with the script. I'm doing a script for the game GTA San Andreas Multiplayer. In order for me to use the function is more serious (such as a dialog box in the SAMP, which can not be done using QuickBinder program), I downloaded the SAMP-UDF script. This script takes my script new commands (eg ShowDialog). This UDF is a line:
[color = # 00BF40]; # - IsPlayerDriver () check if player is driver # [/color]
. Scrolling text lower down, I found this:
; 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 there is on this feature. I want to make a condition in my script, so that it is activated when the player is the driver. I know that this is possible, I do not know how to register. I tried to register:
if (isPlayerDriver (1))
- generate an error. Had tried
isPlayerDriver ()
if (1)
- is still a mistake.
The only thing that happened is when:
if (isPlayerDriver: = 1)
script breakdowns, but it works all the time, regardless of whether the player in the car or not. And if instead of ": =" put "=" is an error.
Это работает! Сначала работало, будто игрок всегда водитель (вне зависимости от этого), но когда я добавил проверку через IfPlayerInAnyVehicle и вставил ИфПлаерИсДривер в условие, то все заработало. Отлично, спасибо большое!
English:
Spoiler
Wow! It's Work!First work, if the player is always the driver (regardless of this), but when I added scan in IfPlayerInAnyVehicle IfPlaerIsDriver and put in a condition that it worked. Great! Thank you very much!