Пенсионная система для законников
В public OnGameModeInit:
Code: Select all
Create3DTextLabel("{F7FF00}ПОЛУЧЕНИЯ ПЕНСИИ\n\n{00D900}Нажмите: "ALT"\n{FFFFFF}или\n{6495ED}Введите: /pensiya",0xFFFFFFFF,2317.1506,-7.3224,27.8161,15.0,0,0);
В enum pInfo:
Code: Select all
pPensiya,
В public PayDay:
Code: Select all
if(PlayerInfo[i][pMember] != 0 && PlayerInfo[i][pLevel] >= 10) { SendClientMessage(i, 0xFF8C37AA, "Вам начислена пенсия. Получить ее можно в банке"); PlayerInfo[i]
В public OnPlayerCommandText:
Code: Select all
if(strcmp(cmdtext, "/pensiya", true) == 0)
{
if(!PlayerToPoint(2.0,playerid,2316.6023,-7.2965,26.7422)) return true;
if(PlayerInfo[playerid][pPensiya] == 0) return ShowPlayerDialog(playerid,6703,DIALOG_STYLE_MSGBOX,"{15FF00}БАНК","{FF0000}На вашем пенсионном счете нет пенсии!","ОК","");
ApplyAnimation(playerid,"CRIB","CRIB_Use_Switch",4.0,0,0,0,0,0);
PlayerInfo[playerid][pCash] += PlayerInfo[playerid][pPensiya]*350;
format(string, sizeof(string), "Вы получили пенсию: {F7FF00}%d вирт", PlayerInfo[playerid][pPensiya]*350);
ShowPlayerDialog(playerid,6703,DIALOG_STYLE_MSGBOX,"{15FF00}БАНК",string,"ОК","");
PlayerInfo[playerid][pPensiya] = 0;
}
В public OnPlayerLogin:
Code: Select all
ini_getInteger(File,"Pensiya",PlayerInfo[playerid][pPensiya]);
В public OnPlayerUpdateRL:
Code: Select all
ini_setInteger(File,"Pensiya",PlayerInfo[playerid][pPensiya]);
В public OnPlayerKeyStateChange:
Code: Select all
if(newkeys == 1024) OnPlayerCommandText(playerid, "/pensiya");
В public OnPlayerRegister:
Code: Select all
ini_setInteger(File,"Pensiya",PlayerInfo[playerid][pPensiya]);