iBox.inc

Описание: Инклуды
Модератор: SJplayer

Sprite M
Автор темы, Ст. сержант
Ст. сержант
Аватара
Sprite M
Автор темы, Ст. сержант
Ст. сержант
Сообщения: 83
Зарегистрирован: 5 июня 2013
С нами: 10 лет 9 месяцев

#1 Sprite » 28 сентября 2014, 17:11

Автор: amirab
Изображение

Изображение


Вы можете использовать его для OnPlayerSpawn или OnPlayerRequestClass чтобы показать информацию о том, что вам нравится.

Вы должны поставить LoadInfoBox () В OnGameModeInit или OnFilterScriptInit
в остальном не работает.


Код: Выделить всё

#include <a_samp>

new InInfoBoxMode[MAX_PLAYERS];
new 
Text:BaseBox[MAX_PLAYERS];
new 
Text:TitleName[MAX_PLAYERS];
new 
Text:Informations[MAX_PLAYERS];
new 
Text:ClosingText;

stock LoadInfoBox()
{

for(new 
playerid=0playerid!=MAX_PLAYERSplayerid++)
{

BaseBox[playerid] = TextDrawCreate(239.600006124.700004"usebox");
TextDrawLetterSize(BaseBox[playerid], 0.00000021.253700);
TextDrawTextSize(BaseBox[playerid], 32.4000010.000000);
TextDrawAlignment(BaseBox[playerid], 1);
TextDrawColor(BaseBox[playerid], 51);
TextDrawUseBox(BaseBox[playerid], true);
TextDrawBoxColor(BaseBox[playerid], 102);
TextDrawSetShadow(BaseBox[playerid], 0);
TextDrawSetOutline(BaseBox[playerid], 0);
TextDrawFont(BaseBox[playerid], 0);

TitleName[playerid] = TextDrawCreate(37.600002125.440002"Los Santos Police Department And Me");
TextDrawLetterSize(TitleName[playerid], 0.2747991.771733);
TextDrawTextSize(TitleName[playerid], 234.399978, -45.546684);
TextDrawAlignment(TitleName[playerid], 1);
TextDrawColor(TitleName[playerid], -1);
TextDrawUseBox(TitleName[playerid], true);
TextDrawBoxColor(TitleName[playerid], 5228678);
TextDrawSetShadow(TitleName[playerid], 0);
TextDrawSetOutline(TitleName[playerid], 1);
TextDrawBackgroundColor(TitleName[playerid], 51);
TextDrawFont(TitleName[playerid], 2);
TextDrawSetProportional(TitleName[playerid], 1);

Informations[playerid] = TextDrawCreate(39.999996174.493331"blah blah blah blah blah blahb laasdawrfaaw awrfaf taqwe fasr yuh awe a");
TextDrawLetterSize(Informations[playerid], 0.3387991.204266);
TextDrawTextSize(Informations[playerid], 234.4000854.480000);
TextDrawAlignment(Informations[playerid], 1);
TextDrawColor(Informations[playerid], -1);
TextDrawUseBox(Informations[playerid], true);
TextDrawBoxColor(Informations[playerid], 0);
TextDrawSetShadow(Informations[playerid], 0);
TextDrawSetOutline(Informations[playerid], 1);
TextDrawBackgroundColor(Informations[playerid], 51);
TextDrawFont(Informations[playerid], 1);
TextDrawSetProportional(Informations[playerid], 1);

ClosingText TextDrawCreate(82.400001299.413360"~y~Press ~w~(~r~LMB~w~) ~y~To Close");
TextDrawLetterSize(ClosingText0.2819991.525333);
TextDrawAlignment(ClosingText1);
TextDrawColor(ClosingText, -1);
TextDrawSetShadow(ClosingText0);
TextDrawSetOutline(ClosingText1);
TextDrawBackgroundColor(ClosingText51);
TextDrawFont(ClosingText1);
TextDrawSetProportional(ClosingText1);
}

return 
1;
}


stock ShowPlayerInfoBox(playerid title[] , informations[] , TitleBoxColor BaseBoxColor 0)
{
    
TextDrawSetString(TitleName[playerid] , title);
    
TextDrawSetString(Informations[playerid] , informations);
    if(
TitleBoxColor != 0){TextDrawBoxColor(TitleName[playerid] , TitleBoxColor);} else { TextDrawBoxColor(TitleName[playerid], 5228678); }
    if(
BaseBoxColor != 0){TextDrawBoxColor(BaseBox[playerid] , BaseBoxColor);} else { TextDrawBoxColor(BaseBox[playerid], 102); }
    
InInfoBoxMode[playerid] = 1;
    
TextDrawShowForPlayer(playerid TitleName[playerid]);
    
TextDrawShowForPlayer(playerid Informations[playerid]);
    
TextDrawShowForPlayer(playerid BaseBox[playerid]);
    
TextDrawShowForPlayer(playerid ClosingText);
    return 
1;
}


public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
newkeys KEY_FIRE )
    {
      if(
InInfoBoxMode[playerid] != 0)
      {
          
InInfoBoxMode[playerid] = 0;
          
TextDrawHideForPlayer(playerid TitleName[playerid]);
          
TextDrawHideForPlayer(playerid Informations[playerid]);
          
TextDrawHideForPlayer(playerid BaseBox[playerid]);
          
TextDrawHideForPlayer(playerid ClosingText);
      }
      return 
1;
    }
    
#if defined KP_OnPlayerKeyStateChange
        
KP_OnPlayerKeyStateChange(playeridnewkeysoldkeys);
    
#endif
    
return 0;
}

#if defined _ALS_OnPlayerKeyStateChange
    #undef OnPlayerKeyStateChange
#else
    #define _ALS_OnPlayerKeyStateChange
#endif

#define OnPlayerKeyStateChange KP_OnPlayerKeyStateChange

#if defined KP_OnPlayerKeyStateChange
    
forward KP_OnPlayerKeyStateChange(playeridnewkeysoldkeys);
#endif 


Функции:

Код: Выделить всё

ShowPlayerInfoBox(playerid title[] , informations[] , TitleBoxColor BaseBoxColor 0)// использование 


Код: Выделить всё

LoadInfoBox() //загрузить inc 


Вернуться в «Include»

Кто сейчас на форуме (по активности за 5 минут)

Сейчас этот раздел просматривают: 4 гостя