Добро пожаловать на Pro Pawn - Портал о PAWN-скриптинге.
Показано с 1 по 6 из 6
  1. #1
    Аватар для Витёк
    Пользователь

    Статус
    Оффлайн
    Регистрация
    26.09.2015
    Сообщений
    215
    Репутация:
    1 ±

    Курсор мыши

    Возможно ли в самп определить где именно находится курсор мыши?
    Если да то какой функцией если не секрет
    Разработка •  • Ч Е Р Н О Б Ы Л Ь •  • Выживание в припяти •

  2. #2
    Аватар для Seregamil
    Проверенный

    Статус
    Оффлайн
    Регистрация
    21.11.2013
    Сообщений
    551
    Репутация:
    274 ±
    никакой.

  3. #3
    Аватар для Seviel
    Пользователь

    Статус
    Оффлайн
    Регистрация
    23.12.2016
    Адрес
    Казахстан
    Сообщений
    148
    Репутация:
    26 ±
    В iPleoMax как-то определяют, но в эти дебри я лесть не собираюсь, так что сам разбирайся
    PHP код:
    forward OnCursorPositionChange(NewXNewY);
    public 
    OnCursorPositionChange(NewXNewY)
    {
        if(
    EditEnabled)
        {
            switch(
    EditMode)
            {
                case 
    EDITMODE_POSITION:
                {
                    if(
    Project[EditIndex][iUsebox] && Project[EditIndex][iLetterX] == 0.0)
                    {
                        
    Project[EditIndex][iPositionX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed;
                        
    Project[EditIndex][iTextX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed;
                        
    Project[EditIndex][iPositionY] -= floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0 EditSpeed;
                        
    ShowValues(Project[EditIndex][iPositionY], Project[EditIndex][iTextX], Project[EditIndex][iPositionY]);
                    } else {
                        
    Project[EditIndex][iPositionX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed;
                        
    Project[EditIndex][iPositionY] -= floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0 EditSpeed;
                        
    ShowValues(Project[EditIndex][iPositionY], Project[EditIndex][iPositionX], Project[EditIndex][iPositionY]);
                    }
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_USEBOX:
                {
                    
    Project[EditIndex][iPositionX] = (floatdiv(NewXScreenWidth) * 640.0) + 2.0;
                    
    Project[EditIndex][iLetterY] = ((floatdiv(NewYScreenHeight) * 448.0) - Project[EditIndex][iPositionY])/9.0;
                    
    Project[EditIndex][iLetterY] -= 0.15;
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_TEXTUREBOX:
                {
                    
    Project[EditIndex][iTextX] = (floatdiv((NewX == ScreenWidth 1) ? ScreenWidth NewXScreenWidth) * 640.0) - Project[EditIndex][iPositionX];
                    
    Project[EditIndex][iTextY] = (floatdiv((NewY == ScreenHeight 1) ? ScreenHeight NewYScreenHeight) * 448.0) - Project[EditIndex][iPositionY];
                    
    ShowValues(Project[EditIndex][iPositionY], Project[EditIndex][iTextX], Project[EditIndex][iTextY]);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_SIZE:
                {
                    if(
    Project[EditIndex][iUsebox] && Project[EditIndex][iLetterX] == 0.0)
                    {
                        
    Project[EditIndex][iLetterY] -= (floatdiv(floatsub(CursorOYNewY), ScreenWidth) * 640.0)/10.0 EditSpeed;
                        
    Project[EditIndex][iPositionX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed;
                    } else {
                        
    Project[EditIndex][iTextX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed;
                        
    Project[EditIndex][iTextY] -= floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0 EditSpeed;
                        
    ShowValues(Project[EditIndex][iPositionY], Project[EditIndex][iTextX], Project[EditIndex][iTextY]);
                    }
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_LETTERSIZE:
                {
                    
    Project[EditIndex][iLetterX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed 0.001;
                    
    Project[EditIndex][iLetterY] -= floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0 EditSpeed 0.01;
                    
    ShowValues(Project[EditIndex][iPositionY], Project[EditIndex][iLetterX], Project[EditIndex][iLetterY]);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_OUTLINE:
                {
                    
    Project[EditIndex][iOutline] -= floatround(floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0);
                    
    Project[EditIndex][iOutline] -= floatround(floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_SHADOW:
                {
                    
    Project[EditIndex][iShadow] -= floatround(floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0);
                    
    Project[EditIndex][iShadow] -= floatround(floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_COLOR:
                {
                    
    HexToRGBA(Project[EditIndex][iColor], Colors[0], Colors[1], Colors[2], Colors[3]);
                    switch(
    ColorMode)
                    {
                        case 
    COLORMODE_REDColors[0] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0  );
                        case 
    COLORMODE_GREENColors[1] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                        case 
    COLORMODE_BLUEColors[2] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0 );
                        case 
    COLORMODE_ALPHAColors[3] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                    }
                    
    format(String_Normalsizeof String_Normal"~n~~r~R%i~n~~g~G%i~n~~b~B%i~n~~w~A%i"Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    GameTextForPlayer(ProjectEditorString_Normal10003);
                    
    Project[EditIndex][iColor] = RGBAToHex(Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_BGCOLOR:
                {
                    
    HexToRGBA(Project[EditIndex][iBackgroundcolor], Colors[0], Colors[1], Colors[2], Colors[3]);
                    switch(
    ColorMode)
                    {
                        case 
    COLORMODE_REDColors[0] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0  );
                        case 
    COLORMODE_GREENColors[1] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                        case 
    COLORMODE_BLUEColors[2] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0 );
                        case 
    COLORMODE_ALPHAColors[3] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                    }
                    
    format(String_Normalsizeof String_Normal"~n~~r~R%i~n~~g~G%i~n~~b~B%i~n~~w~A%i"Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    GameTextForPlayer(ProjectEditorString_Normal10003);
                    
    Project[EditIndex][iBackgroundcolor] = RGBAToHex(Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_BOXCOLOR:
                {
                    
    HexToRGBA(Project[EditIndex][iBoxcolor], Colors[0], Colors[1], Colors[2], Colors[3]);
                    switch(
    ColorMode)
                    {
                        case 
    COLORMODE_REDColors[0] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0  );
                        case 
    COLORMODE_GREENColors[1] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                        case 
    COLORMODE_BLUEColors[2] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0 );
                        case 
    COLORMODE_ALPHAColors[3] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                    }
                    
    format(String_Normalsizeof String_Normal"~n~~r~R%i~n~~g~G%i~n~~b~B%i~n~~w~A%i"Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    GameTextForPlayer(ProjectEditorString_Normal10003);
                    
    Project[EditIndex][iBoxcolor] = RGBAToHex(Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    UpdateTextDraw(EditIndex);
                }
            }
        }
        return 
    true;


  4. #4
    Аватар для Seregamil
    Проверенный

    Статус
    Оффлайн
    Регистрация
    21.11.2013
    Сообщений
    551
    Репутация:
    274 ±
    Цитата Сообщение от Seviel Посмотреть сообщение
    В iPleoMax как-то определяют, но в эти дебри я лесть не собираюсь, так что сам разбирайся
    PHP код:
    forward OnCursorPositionChange(NewXNewY);
    public 
    OnCursorPositionChange(NewXNewY)
    {
        if(
    EditEnabled)
        {
            switch(
    EditMode)
            {
                case 
    EDITMODE_POSITION:
                {
                    if(
    Project[EditIndex][iUsebox] && Project[EditIndex][iLetterX] == 0.0)
                    {
                        
    Project[EditIndex][iPositionX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed;
                        
    Project[EditIndex][iTextX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed;
                        
    Project[EditIndex][iPositionY] -= floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0 EditSpeed;
                        
    ShowValues(Project[EditIndex][iPositionY], Project[EditIndex][iTextX], Project[EditIndex][iPositionY]);
                    } else {
                        
    Project[EditIndex][iPositionX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed;
                        
    Project[EditIndex][iPositionY] -= floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0 EditSpeed;
                        
    ShowValues(Project[EditIndex][iPositionY], Project[EditIndex][iPositionX], Project[EditIndex][iPositionY]);
                    }
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_USEBOX:
                {
                    
    Project[EditIndex][iPositionX] = (floatdiv(NewXScreenWidth) * 640.0) + 2.0;
                    
    Project[EditIndex][iLetterY] = ((floatdiv(NewYScreenHeight) * 448.0) - Project[EditIndex][iPositionY])/9.0;
                    
    Project[EditIndex][iLetterY] -= 0.15;
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_TEXTUREBOX:
                {
                    
    Project[EditIndex][iTextX] = (floatdiv((NewX == ScreenWidth 1) ? ScreenWidth NewXScreenWidth) * 640.0) - Project[EditIndex][iPositionX];
                    
    Project[EditIndex][iTextY] = (floatdiv((NewY == ScreenHeight 1) ? ScreenHeight NewYScreenHeight) * 448.0) - Project[EditIndex][iPositionY];
                    
    ShowValues(Project[EditIndex][iPositionY], Project[EditIndex][iTextX], Project[EditIndex][iTextY]);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_SIZE:
                {
                    if(
    Project[EditIndex][iUsebox] && Project[EditIndex][iLetterX] == 0.0)
                    {
                        
    Project[EditIndex][iLetterY] -= (floatdiv(floatsub(CursorOYNewY), ScreenWidth) * 640.0)/10.0 EditSpeed;
                        
    Project[EditIndex][iPositionX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed;
                    } else {
                        
    Project[EditIndex][iTextX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed;
                        
    Project[EditIndex][iTextY] -= floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0 EditSpeed;
                        
    ShowValues(Project[EditIndex][iPositionY], Project[EditIndex][iTextX], Project[EditIndex][iTextY]);
                    }
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_LETTERSIZE:
                {
                    
    Project[EditIndex][iLetterX] -= floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0 EditSpeed 0.001;
                    
    Project[EditIndex][iLetterY] -= floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0 EditSpeed 0.01;
                    
    ShowValues(Project[EditIndex][iPositionY], Project[EditIndex][iLetterX], Project[EditIndex][iLetterY]);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_OUTLINE:
                {
                    
    Project[EditIndex][iOutline] -= floatround(floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0);
                    
    Project[EditIndex][iOutline] -= floatround(floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_SHADOW:
                {
                    
    Project[EditIndex][iShadow] -= floatround(floatdiv(floatsub(CursorOXNewX), ScreenWidth) * 640.0);
                    
    Project[EditIndex][iShadow] -= floatround(floatdiv(floatsub(CursorOYNewY), ScreenHeight) * 448.0);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_COLOR:
                {
                    
    HexToRGBA(Project[EditIndex][iColor], Colors[0], Colors[1], Colors[2], Colors[3]);
                    switch(
    ColorMode)
                    {
                        case 
    COLORMODE_REDColors[0] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0  );
                        case 
    COLORMODE_GREENColors[1] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                        case 
    COLORMODE_BLUEColors[2] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0 );
                        case 
    COLORMODE_ALPHAColors[3] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                    }
                    
    format(String_Normalsizeof String_Normal"~n~~r~R%i~n~~g~G%i~n~~b~B%i~n~~w~A%i"Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    GameTextForPlayer(ProjectEditorString_Normal10003);
                    
    Project[EditIndex][iColor] = RGBAToHex(Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_BGCOLOR:
                {
                    
    HexToRGBA(Project[EditIndex][iBackgroundcolor], Colors[0], Colors[1], Colors[2], Colors[3]);
                    switch(
    ColorMode)
                    {
                        case 
    COLORMODE_REDColors[0] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0  );
                        case 
    COLORMODE_GREENColors[1] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                        case 
    COLORMODE_BLUEColors[2] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0 );
                        case 
    COLORMODE_ALPHAColors[3] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                    }
                    
    format(String_Normalsizeof String_Normal"~n~~r~R%i~n~~g~G%i~n~~b~B%i~n~~w~A%i"Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    GameTextForPlayer(ProjectEditorString_Normal10003);
                    
    Project[EditIndex][iBackgroundcolor] = RGBAToHex(Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    UpdateTextDraw(EditIndex);
                }
                case 
    EDITMODE_BOXCOLOR:
                {
                    
    HexToRGBA(Project[EditIndex][iBoxcolor], Colors[0], Colors[1], Colors[2], Colors[3]);
                    switch(
    ColorMode)
                    {
                        case 
    COLORMODE_REDColors[0] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0  );
                        case 
    COLORMODE_GREENColors[1] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                        case 
    COLORMODE_BLUEColors[2] = floatround(  floatdiv((NewY 1), (ScreenHeight 2)) * 255.0 );
                        case 
    COLORMODE_ALPHAColors[3] = floatround(  floatdiv((NewX 1), (ScreenWidth 2)) * 255.0  );
                    }
                    
    format(String_Normalsizeof String_Normal"~n~~r~R%i~n~~g~G%i~n~~b~B%i~n~~w~A%i"Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    GameTextForPlayer(ProjectEditorString_Normal10003);
                    
    Project[EditIndex][iBoxcolor] = RGBAToHex(Colors[0], Colors[1], Colors[2], Colors[3]);
                    
    UpdateTextDraw(EditIndex);
                }
            }
        }
        return 
    true;

    Там используется win-only плагин, работающий только, если не ошибаюсь, для хоста.

  5. #5
    Аватар для Seviel
    Пользователь

    Статус
    Оффлайн
    Регистрация
    23.12.2016
    Адрес
    Казахстан
    Сообщений
    148
    Репутация:
    26 ±
    Цитата Сообщение от Seregamil Посмотреть сообщение
    Там используется win-only плагин, работающий только, если не ошибаюсь, для хоста.
    Скорее всего вы ошибаетесь, ведь я им(iPleoMax-ом) пользуюсь только на локалке.

  6. #6
    Аватар для Alpano
    Пользователь

    Статус
    Оффлайн
    Регистрация
    06.02.2017
    Сообщений
    123
    Репутация:
    16 ±
    Цитата Сообщение от Seviel Посмотреть сообщение
    Скорее всего вы ошибаетесь, ведь я им(iPleoMax-ом) пользуюсь только на локалке.
    под словом "хост" имелся в виду именно локалхост.
    MyProject:
    DriftEmpire©

    Ленивые всё делают быстро, чтобы поскорее избавиться от работы.
    И делают качественно, чтобы потом не переделывать.

 

 

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Ваши права

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