Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <YSI\y_ini>
- #include <zcmd>
- #include <sscanf2>
- #define crvena "{FF0000}"
- #define plava "{0BE9F4}"
- #define orange "{FF9900}"
- #define bela "{FFFFFF}"
- //==========
- #define DIALOG_PORT 1
- //======================================================
- #define SCM SendClientMessage
- //======================================================
- enum pInfo
- {
- pAdmin,
- pBankmoney
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //=====================
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys & KEY_SECONDARY_ATTACK)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 1459.2065,-1010.0352,26.8438))
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,2315.952000,-1.610174,26.742107);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid,-1,"[Banka]: Dobrodosli !");
- }
- else if(IsPlayerInRangeOfPoint(playerid, 2.0, 2315.952000,-1.610174,26.742107))
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, 1459.2065,-1010.0352,26.8438);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid,-1,"[Banka]: Dovidjenja!");
- }
- }
- }
- //================================
- CMD:deposit(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,2.0,2309.1948,-8.5399,26.7422)) return SCM(playerid,-1,"{FF0000}#ERROR: {FFFFFF}Nisi na mestu!");
- {
- new money,string[128];
- if(sscanf(params,"d",money)) return SCM(playerid,-1,""crvena"{FF0000}#USAGE: {FFFFFF}/deposit [kolicina]");
- if(GetPlayerMoney(playerid) < money) return SCM(playerid,-1,""crvena"#ERROR: {FFFFFF}Nemas toliko novca!");
- if(money > 50000) return SendClientMessage(playerid,-1,""crvena"#ERROR:Maksimalno novca od jednom koliko mozete staviti je 50000$!");
- new money1 = money;
- PlayerInfo[playerid][pBankmoney] += money;
- format(string,sizeof(string),"{FF0000}#INFO: {FFFFFF}Ostavili ste $%d novca na vas racun!,Vase novo stanje je $%d",money1,PlayerInfo[playerid][pBankmoney]);
- SendClientMessage(playerid,-1,string);
- ApplyAnimation(playerid, "DEALER", "shop_pay", 2.5, 0, 0, 0, 0, 0);
- GivePlayerMoney(playerid,-money);
- }
- return 1;
- }
- //======================================================
- CMD:withdraw(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,2.0,2309.1948,-8.5399,26.7422)) return SCM(playerid,-1,"Nisi na mestu!");
- {
- new money,string[128];
- if(sscanf(params,"d",money)) return SCM(playerid,-1,""crvena"#KORISTI: {FFFFFF}/withdraw [kolicina]");
- if(PlayerInfo[playerid][pBankmoney] < money) return SCM(playerid,-1,""crvena"#ERROR: {FFFFFF}Nemas toliko novca!");
- new money1 = money;
- PlayerInfo[playerid][pBankmoney] -= money;
- format(string,sizeof(string),"{FF0000}#INFO: {FFFFFF}Uzeli ste $%d novca na vas racun!,Vase novo stanje je $%d",money1,PlayerInfo[playerid][pBankmoney]);
- SendClientMessage(playerid,-1,string);
- ApplyAnimation(playerid, "DEALER", "shop_pay", 2.5, 0, 0, 0, 0, 0);
- GivePlayerMoney(playerid,money);
- }
- return 1;
- }
- //======================================================
- CMD:bankbalance(playerid,params[])
- {
- if(!IsPlayerInRangeOfPoint(playerid,2.0,2309.1948,-8.5399,26.7422)) return SCM(playerid,-1,"{FF0000}#ERROR: {FFFFFF}Nisi na mestu!");
- {
- new string[128];
- format(string,sizeof(string),"{FF0000}#INFO: {FFFFFF}Vase stanje na racunu je $%d.",PlayerInfo[playerid][pBankmoney]);
- SendClientMessage(playerid,-1,string);
- }
- return 1;
- }
- //==========
- CMD:port(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,-1,"{FF0000}#ERROR: {FFFFFF}Niste ovlasceni!");
- ShowPlayerDialog(playerid,DIALOG_PORT,DIALOG_STYLE_LIST,"{FF0000}Port","1. Banka\n2. Opstina","Izaberi","Odustani");
- return 1;
- }
- //==
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_PORT)
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- SetPlayerPos(playerid,1461.3051,-1025.6864,23.8281);
- SendClientMessage(playerid,-1,""plava"Teleportovani ste do Banke!");
- }
- case 1:
- {
- SetPlayerPos(playerid,1479.8196,-1741.0970,13.5469);
- SendClientMessage(playerid,-1,""plava"Teleportovani ste do Opstine!");
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement