- Регистрация
- 19 Апр 2011
- Сообщения
- 205
- Лучшие ответы
- 0
- Репутация
- 72
Когда в игре вы на что-то тратите деньги, скрипт покажет в углу экрана ту сумму, которые вы потратили. Почти как в GTA IV.Вам будет легче делать это в FS
В начало скрипта вставляем:
Создаём public
Вставляем туда:
Создаём public
И вставляем туда
Создаём public
И вставляем туда
Создаём public
Вставляем туда
Создаём public
И вставляем туда
И создём последний public
И вставляем туда
Автор: MaNb9K
Урок: Oleg_Timashyk
В начало скрипта вставляем:
PHP:
#include <a_samp>
new PMoney[MAX_PLAYERS];
new MoneyHide[MAX_PLAYERS];
new Text:MoneyText[MAX_PLAYERS];
forward HideMoneyText(playerid);
PHP:
public OnFilterScriptInit()
PHP:
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
OnPlayerConnect(i);
}
}
return 1;
}
PHP:
public OnFilterScriptExit()
PHP:
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
TextDrawDestroy(MoneyText[i]);
}
}
return 1;
}
PHP:
public OnPlayerConnect(playerid)
PHP:
{
MoneyText[playerid] = TextDrawCreate(502.000000,96.000000,"-00000000");
TextDrawAlignment(MoneyText[playerid],0);
TextDrawBackgroundColor(MoneyText[playerid],0x000000ff);
TextDrawFont(MoneyText[playerid],3);
TextDrawLetterSize(MoneyText[playerid],0.579999,2.200000);
TextDrawColor(MoneyText[playerid],0xff000099);
TextDrawSetOutline(MoneyText[playerid],1);
TextDrawSetProportional(MoneyText[playerid],1);
TextDrawSetShadow(MoneyText[playerid],1);
return 1;
}
PHP:
public OnPlayerDisconnect(playerid)
PHP:
{
TextDrawDestroy(MoneyText[playerid]);
return 1;
}
PHP:
public OnPlayerUpdate(playerid)
PHP:
{
new money = GetPlayerMoney(playerid);
if((money - PMoney[playerid]) < 0)
{
new MStringy[128];
valstr(MStringy,money - PMoney[playerid]);
if(strlen(MStringy)<=8)
{
new Stringy[128];
format(Stringy,sizeof(Stringy),"%08d",money - PMoney[playerid]);
TextDrawSetString(MoneyText[playerid],Stringy);
TextDrawShowForPlayer(playerid,MoneyText[playerid]);
KillTimer(MoneyHide[playerid]);
MoneyHide[playerid]=SetTimerEx("HideMoneyText",4000,0,"i",playerid);
}
}
PMoney[playerid] = money;
}
PHP:
public HideMoneyText(playerid)
PHP:
{
TextDrawHideForPlayer(playerid,MoneyText[playerid]);
return 1;
}
Урок: Oleg_Timashyk
Последнее редактирование: