Форум Pawn.Wiki - Воплоти мечту в реальность!: Лазер на оружие - Форум Pawn.Wiki - Воплоти мечту в реальность!

Перейти к содержимому

Страница 1 из 1
  • Вы не можете создать новую тему
  • Вы не можете ответить в тему

[ Scr ][ All ]
Лазер на оружие
Оценка: **--- 2 Голосов

#1
Пользователь офлайн   V1ncente 

  • Прохожий
  • Вставить ник
  • Раскрыть информацию
В Stock:
stock IsPlayerAiming(playerid) 
{ 
    new anim = GetPlayerAnimationIndex(playerid); 
    if((anim == 1167) || (anim == 1365) || (anim == 1643) || (anim == 1453) || (anim == 220)) return 1; 
    return 0; 
}


В public OnPlayerConnect(playerid):
SetPVarInt(playerid, "laser", 0); 
SetPVarInt(playerid, "color", 18643);


В public OnGameModeInit():
new p = GetMaxPlayers(); 
for(new i=0; i < p; i++) 
    { 
        SetPVarInt(i, "laser", 0); 
        SetPVarInt(i, "color", 18643); 
    }


Терь ко всем командам:
if(strcmp(cmd, "/laser", true) == 0) 
    { 
       if (PlayerInfo[playerid][pAdmin] >= 0)
        { 
            ShowPlayerDialog(playerid,132,DIALOG_STYLE_LIST,"Лазер","Включить\nВыключить\nЦвет","Enter"
,"Exit"); 
            return 1; 
        } 
    }


В public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[] пишем:
if(dialogid == 132) 
    { 
        if(response) 
        { 
            if(listitem == 0) 
            { 
                SetPVarInt(playerid, "laser", 1); 
                SetPVarInt(playerid, "color", GetPVarInt(playerid, "color")); 
            } 
            if(listitem == 1) 
            { 
                SetPVarInt(playerid, "laser", 0); 
                RemovePlayerAttachedObject(playerid, 0); 
            } 
            if(listitem == 2) 
            { 
                ShowPlayerDialog(playerid,133,DIALOG_STYLE_LIST,"Цвета","{FF3300}Красный\n{0033CC}Синий\n{33FF00}Зелёный\
n{FFFF00}Желтый\n{FEBFEF}Розовый\nОранжевый","Enter","Exit"); 
            } 
        } 
        return 1; 
    } 
    if(dialogid == 133) 
    { 
        if(response) 
        { 
            if(listitem == 0) 
            { 
                SetPVarInt(playerid, "color", 18643); 
            } 
            if(listitem == 1) 
            { 
                SetPVarInt(playerid, "color", 19080); 
            } 
            if(listitem == 2) 
            { 
                SetPVarInt(playerid, "color", 19083); 
            } 
            if(listitem == 3) 
            { 
                SetPVarInt(playerid, "color", 19084); 
            } 
            if(listitem == 4) 
            { 
                SetPVarInt(playerid, "color", 19081); 
            } 
            if(listitem == 5) 
            { 
                SetPVarInt(playerid, "color", 19082); 
            } 
        } 
        return 1; 
    }


В public OnPlayerUpdate(playerid):
if(GetPVarInt(playerid, "laser")) 
        { 
            RemovePlayerAttachedObject(playerid, 0); 
            if(IsPlayerInAnyVehicle(playerid)) return 1; 
            switch (GetPlayerWeapon(playerid)) 
            { 
            case 22: 
                { 
                    if(IsPlayerAiming(playerid)) 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240); 
                        } 
                    } 
                    else 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216); 
                        } 
                    } 
                } 
            case 23: 
                { 
                    if(IsPlayerAiming(playerid)) 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240); 
                        } 
                    } 
                    else 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216); 
                        } 
                    } 
                } 
            case 27: 
                { 
                    if(IsPlayerAiming(playerid)) 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.588246, -0.022766, 0.138052, -11.531745, 347.712585, 352.784271); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.588246, -0.022766, 0.138052, 1.468254, 350.712585, 352.784271); 
                        } 
                    } 
                    else 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216); 
                        } 
                    } 
                } 
            case 30: 
                { 
                    if(IsPlayerAiming(playerid)) 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.628249, -0.027766, 0.078052, -6.621746, 352.552642, 355.084289); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.628249, -0.027766, 0.078052, -1.621746, 356.202667, 355.084289); 
                        } 
                    } 
                    else 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216); 
                        } 
                    } 
                } 
            case 31: 
                { 
                    if(IsPlayerAiming(playerid)) 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289); 
                        } 
                    } 
                    else 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222); 
                        } 
                    } 
                } 
            case 34: 
                { 
                    if(IsPlayerAiming(playerid)) 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289); 
                        } 
                        return 1; 
                    } 
                    else 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259); 
                        } 
                    } 
                } 
            case 29: 
                { 
                    if(IsPlayerAiming(playerid)) 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.298249, -0.02776, 0.158052, -11.631746, 359.302673, 357.584259); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.298249, -0.02776, 0.158052, 8.368253, 358.302673, 352.584259); 
                        } 
                    } 
                    else 
                    { 
                        if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222); 
                        } 
                        else 
                        { 
                            SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, 0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222); 
                        } 
                    } 
                } 
            } 
        }


P.S. не знал куда написать в команды или в "готовые решения" и решил сюда. Если не туда написал, переместите тему. Мод, с какого взял систему не помню.
Изображение

Сообщение отредактировал V1ncente: 09 февраля 2012 - 18:44

5

#2
Пользователь офлайн   SwipoStyle 

  • Благодетель
  • Вставить ник
  • Раскрыть информацию
Да всё правильно с темой, вот только скринов не хватает...
0

#3
Пользователь офлайн   V1ncente 

  • Прохожий
  • Вставить ник
  • Раскрыть информацию
сейчас будут
0

#4
Пользователь офлайн   Vlad_Fasters 

  • Прохожий
  • Вставить ник
  • Раскрыть информацию
Спасибо ,очень пригодилось. :rolleyes:
0

#5
Пользователь офлайн   V1ncente 

  • Прохожий
  • Вставить ник
  • Раскрыть информацию
не за что)
0

#6
Пользователь офлайн   STekLyAToR 

  • Новичок
  • Вставить ник
  • Раскрыть информацию
Свистануто, всё равно 5 звёзд
-1

#7
Пользователь офлайн   Kilav_ok 

  • Прохожий
  • Вставить ник
  • Раскрыть информацию
Давно видел уже такое, и мутил себе, эх...ещё раз возьму для нового мода)) :biggrin:
0

#8
Пользователь офлайн   Vladoss10 

  • Прохожий
  • Вставить ник
  • Раскрыть информацию
Для 0.3z уже не идёт
0

#9
Пользователь офлайн   Romzes 

  • ( ^_^ )
  • Вставить ник
  • Раскрыть информацию

Просмотр сообщенияVladoss10 (25 июля 2014 - 21:11) писал:

Для 0.3z уже не идёт


Всё идет.
0

#10
Пользователь офлайн   vityavit 

  • Местный
  • Вставить ник
  • Раскрыть информацию
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(2985) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(2987) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(2989) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(2991) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(2993) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(2995) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(2997) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(2999) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3001) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3003) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3005) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3007) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3009) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3011) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3013) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3015) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3017) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3019) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3021) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3023) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3025) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3027) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3029) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(3032) : error 010: invalid function or declaration
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(4182) : error 017: undefined symbol "IsPlayerAiming"
C:\Users\ADMIN\Desktop\WRPS\gamemodes\wrps.pwn(4207) : error 017: undefined symbol "IsPlayerAiming"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.
чё я нетак зделал :unsure:

Поделиться темой:


Страница 1 из 1
  • Вы не можете создать новую тему
  • Вы не можете ответить в тему

1 человек читают эту тему
0 пользователей, 1 гостей, 0 скрытых пользователей


Яндекс.Метрика