Advertisement
Guest User

Script

a guest
Nov 5th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.67 KB | None | 0 0
  1.                 {
  2.                     tmpintrate = 1;
  3.                 }
  4.                 account[i] = PlayerInfo[i][pAccount];
  5.                 Tax += TaxValue;
  6.                 PlayerInfo[i][pAccount] -= TaxValue;
  7.                 new checks = PlayerInfo[i][pPayCheck];
  8.                 PlayerInfo[i][pAccount] += checks;
  9.                 interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
  10.                 new finalinterest;
  11.                 SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");
  12.                 SendClientMessage(i, COLOR_WHITE, "Your paycheck has arrived; please visit the bank to withdraw your money.");
  13.                 if(PlayerInfo[i][pRob] < 20)
  14.                 {
  15.                     PlayerInfo[i][pRob]++;
  16.                 }
  17.                 else
  18.                 {
  19.                     SendClientMessage(i, COLOR_WHITE, "Nu ai primit niciun rob/free point pentru ca ai deja 20 rob/free points.");
  20.                 }
  21.                 if(PlayerInfo[i][pPayDay] >= 1800)
  22.                 {
  23.                     PlayerInfo[i][pConnectTime] += 1;
  24.                     finalinterest = interest;
  25.                     PlayerInfo[i][pPayDay] = 0;
  26.                     if(PlayerInfo[i][pGiftTime] > 0)
  27.                     {
  28.                         PlayerInfo[i][pGiftTime] -= 1;
  29.                         Update(i, pGiftTimex);
  30.                     }
  31.                 }
  32.                 else
  33.                 {
  34.  
  35.                     finalinterest = interest / 2;
  36.                     new stringsu[256];
  37.                     format(stringsu,sizeof(stringsu),"Ai primit doar jumatate din dobanda de la banca pentru ca ai jucat doar %d minute din aceasta ora (31 necesare pentru dobanda intreaga.",PlayerInfo[i][pPayDay]/60+1);
  38.                     SendSplitMessage(i, COLOR_LIGHTBLUE, stringsu);
  39.                 }
  40.                 PlayerInfo[i][pExp] += 1;
  41.                 PlayerInfo[i][pAccount] += finalinterest;
  42.                 format(string, sizeof(string), "Paycheck: $%s | Bank balance: $%s | Bank interest: $%s | Tax: $%s (10 percent)", FormatNumber(checks), FormatNumber(PlayerInfo[i][pAccount]), FormatNumber(finalinterest), FormatNumber(TaxValue));
  43.                 SendClientMessage(i, COLOR_GREY, string);
  44.                 format(string3, sizeof(string3), "Rent: $%s | Total earnings: $%d", FormatNumber(rent[i]), checks-TaxValue);
  45.                 SendClientMessage(i, COLOR_GREY, string3);
  46.                 SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");
  47.                 format(string, sizeof(string), "~y~payday");
  48.                 GameTextForPlayer(i, string, 5000, 1);
  49.                 if(PlayerInfo[i][pCarLicT] > 0)
  50.                 {
  51.                     PlayerInfo[i][pCarLicT] -= 1;
  52.                 }
  53.                 if(PlayerInfo[i][pFlyLicT] > 0)
  54.                 {
  55.                     PlayerInfo[i][pFlyLicT] -= 1;
  56.                 }
  57.                 if(PlayerInfo[i][pBoatLicT] > 0)
  58.                 {
  59.                     PlayerInfo[i][pBoatLicT] -= 1;
  60.                 }
  61.                 if(PlayerInfo[i][pMotoLicT] > 0)
  62.                 {
  63.                     PlayerInfo[i][pMotoLicT] -= 1;
  64.                 }
  65.                 if(PlayerInfo[i][pTruckLicT] > 0)
  66.                 {
  67.                     PlayerInfo[i][pTruckLicT] -= 1;
  68.                 }
  69.                 if(PlayerInfo[i][pGunLicT] > 0)
  70.                 {
  71.                     PlayerInfo[i][pGunLicT] -= 1;
  72.                 }
  73.                 if(PlayerInfo[i][pFpunish] > 0)
  74.                 {
  75.                     PlayerInfo[i][pFpunish]--;
  76.                 }
  77.                 if(PlayerInfo[i][pFpunish] < 0)
  78.                 {
  79.                     PlayerInfo[i][pFpunish] = 0;
  80.                 }
  81.                 if(PlayerInfo[i][pCarLicSuspend] > 0)
  82.                 {
  83.                     PlayerInfo[i][pCarLicSuspend]--;
  84.                     Update(i, pCarLicSuspendx);
  85.                     if(PlayerInfo[i][pCarLicSuspend] == 0) SendClientMessage(i, COLOR_YELLOW, "* Licenta ta de condus a fost confiscata recent. Acum poti merge din nou la scoala de soferi pentru a lua licenta din nou.");
  86.                 }
  87.                 if(PlayerInfo[i][pGunLicSuspend] > 0)
  88.                 {
  89.                     PlayerInfo[i][pGunLicSuspend]--;
  90.                     Update(i, pGunLicSuspendx);
  91.                     if(PlayerInfo[i][pGunLicSuspend] == 0) SendClientMessage(i, COLOR_YELLOW, "* Licenta ta de arme a fost confiscata recent. Acum poti da din nou testul cu un instructor pentru a lua licenta din nou.");
  92.                 }
  93.                 if(IsACop(i))
  94.                 {
  95.                     PlayerInfo[i][pLawyer] += 1;
  96.                 }
  97.                 PlayerInfo[i][pPayCheck] = 0;
  98.                 if(PlayerInfo[i][pLevel] == 1 || PlayerInfo[i][pLevel] == 2 || PlayerInfo[i][pLevel] == 3 || PlayerInfo[i][pLevel] == 4)
  99.                 {
  100.                     expamount = PlayerInfo[i][pLevel]*2;
  101.                     if(PlayerInfo[i][pExp] >= expamount)
  102.                     {
  103.                         SCM(i,COLOR_LIGHTBLUE,"** You can use buylevel because you have necessary respect points.");
  104.                     }
  105.                 }
  106.                 else if(PlayerInfo[i][pLevel] >= 5)
  107.                 {
  108.                     expamount = PlayerInfo[i][pLevel]*3;
  109.                     if(PlayerInfo[i][pExp] >= expamount)
  110.                     {
  111.                         SCM(i,COLOR_LIGHTBLUE,"** You can use buylevel because you have necessary respect points.");
  112.                     }
  113.                 }
  114.             }
  115.         }
  116.     }
  117.     for(new x = 0; x < MAX_GROUPS; x++)
  118.     {
  119.         DynamicFactions[x][fBank] += DynamicFactions[x][fPaydayMoney];
  120.         mysql_format(SQL,str,sizeof(str),"UPDATE `factions` SET `Bank`='%d' WHERE `ID`='%d'",DynamicFactions[x][fBank],x);
  121.         mysql_tquery(SQL,str,"","");
  122.     }
  123.     return 1;
  124. }
  125.  
  126. stock GetWeaponSlot (weaponid)
  127. {
  128.     switch (weaponid)
  129.     {
  130.         case 0, 1:
  131.             return 0;
  132.  
  133.         case 2 .. 9:
  134.             return 1;
  135.         case 10 .. 15:
  136.             return 10;
  137.         case 16 .. 19, 39:
  138.             return 8;
  139.         case 22 .. 24:
  140.             return 2;
  141.         case 25 .. 27:
  142.             return 3;
  143.         case 28, 29, 32:
  144.             return 4;
  145.         case 30, 31:
  146.             return 5;
  147.         case 33, 34:
  148.             return 6;
  149.         case 35 .. 38:
  150.             return 7;
  151.         case 40:
  152.             return 12;
  153.         case 41 .. 43:
  154.             return 9;
  155.  
  156.         case 44 .. 46:
  157.             return 11;
  158.     }
  159.     return 0;
  160. }
  161.  
  162. stock GivePlayerWeaponEx(playerid,weapon,ammo)
  163. {
  164.     WeaponData[playerid][GetWeaponSlot(weapon)] = true;
  165.     return GivePlayerWeapon(playerid,weapon,ammo);
  166. }
  167.  
  168. stock ResetPlayerWeaponsEx(playerid)
  169. {
  170.     WeaponData[playerid][0] = false; WeaponData[playerid][1] = false; WeaponData[playerid][2] = false; WeaponData[playerid][3] = false;
  171.     WeaponData[playerid][4] = false; WeaponData[playerid][5] = false; WeaponData[playerid][6] = false; WeaponData[playerid][7] = false;
  172.     WeaponData[playerid][8] = false; WeaponData[playerid][9] = false; WeaponData[playerid][10] = false; WeaponData[playerid][11] = false;
  173.     WeaponData[playerid][12] = false;
  174.     return ResetPlayerWeapons(playerid);
  175. }
  176.  
  177. stock GetWeaponNameEx(id, name[], len) return format(name,len, "%s", GunNames[id]);
  178.  
  179. stock RemovePlayerWeapon(playerid, weaponid);
  180. public RemovePlayerWeapon(playerid, weaponid)
  181. {
  182.     new plyWeapons[12] = 0,
  183.         plyAmmo[12] = 0;
  184.     for(new sslot = 0; sslot != 12; sslot++)
  185.     {
  186.         new wep, ammo;
  187.         GetPlayerWeaponData(playerid, sslot, wep, ammo);
  188.         if(wep != weaponid && ammo != 0) GetPlayerWeaponData(playerid, sslot, plyWeapons[sslot], plyAmmo[sslot]);
  189.     }
  190.     ResetPlayerWeaponsEx(playerid);
  191.     ResetPlayerWeapons(playerid);
  192.     for(new sslot = 0; sslot != 12; sslot++)
  193.     {
  194.         if(plyAmmo[sslot] != 0) GivePlayerWeaponEx(playerid, plyWeapons[sslot], plyAmmo[sslot]);
  195.     }
  196.     return 1;
  197. }
  198.  
  199. public split(const strsrc[], strdest[][], delimiter)
  200. {
  201.     new i,
  202.         li,
  203.         aNum,
  204.         len;
  205.     while(i <= strlen(strsrc)){
  206.         if(strsrc[i]==delimiter || i==strlen(strsrc)){
  207.             len = strmid(strdest[aNum], strsrc, li, i, 128);
  208.             strdest[aNum][len] = 0;
  209.             li = i+1;
  210.             aNum++;
  211.         }
  212.         i++;
  213.     }
  214.     return 1;
  215. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement