Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. case 65:
  2. {
  3. if( response )
  4. {
  5. for(new i = 0; i < sizeof(BizInfo); i++)
  6. {
  7. if(IsPlayerInRangeOfPoint( playerid, 1.0, BizInfo[ i ][EnterBiz][0], BizInfo[ i ][EnterBiz][1], BizInfo[ i ][EnterBiz][2] ) )
  8. {
  9. if(!strcmp( BizInfo[ i ][ bOwner ], "None", true ) && BizInfo[i][bTypeBiz] != 9)
  10. {
  11. if(PlayerInfo[playerid][bAdmin] && PlayerInfo[playerid][bAdmin] < 14) return SCM(playerid, -1, ""#net"Администрации запрещено иметь бизнес");
  12. if(PlayerInfo[playerid][pBusiness] != -1 || PlayerInfo[playerid][pFilling] != -1) return SCM(playerid,COLOR_GREY,"{d83927}Ошибка "WHITE"|{e3e3e3} У тебя уже есть бизнес");
  13. if(PlayerInfo[playerid][pCash] < BizInfo[ i ][ bPrice ]) return SCM( playerid, -1, ""#net"У Вас нет денег для покупки данного бизнеса!" );
  14. strmid(BizInfo[i][bOwner], PlayerInfo[playerid][pNames], 0, strlen(PlayerInfo[playerid][pNames]), 255);
  15. PlayerInfo[playerid][pBusiness] = BizInfo[i][bID];
  16. Hook_GivePlayerMoney(playerid, -BizInfo[i][bPrice]);
  17. BizInfo[i][bNalog] = 1000;
  18. mysql_format(connects, string, 256, "UPDATE `business` SET `bOwner` = '%s', `bNalog` = '1000',`h_online` = '%i' WHERE `bID` = '%d'", PlayerInfo[playerid][pNames], getdate(), BizInfo[i][bID]);
  19. mysql_empty(connects, string);
  20. //PlayerInfo[playerid][pBusiness] = i;
  21. UpdatePlayerData(playerid, "pPbiskey", PlayerInfo[playerid][pBusiness]);
  22. if(BizInfo[i][bTypeBiz] == 5 || BizInfo[i][bTypeBiz] == 7) FreezePlayer(playerid, (GetPlayerPing(playerid) > 100 ? (3500) : (2000)));
  23. SCMF(playerid,-1,""#good"Вы приобрели бизнес: {FFFF00}№%i"WHITE". По цене: {FFFF00}%i$",PlayerInfo[playerid][pBusiness],BizInfo[i][bPrice]);
  24. SCM(playerid, -1,""#information"Внимание! Если Вы не будете играть три дня, бизнес будет продан государству!");
  25. SetPlayerPosEx( playerid, BizInfo[ i ][ExitBiz][0], BizInfo[ i ][ExitBiz][1], BizInfo[ i ][ExitBiz][2] ), SetPlayerInterior( playerid, BizInfo[ i ][ bInt ] ), SetPlayerVirtualWorld( playerid, BizInfo[ i ][ bVW ] ), BizEnter{playerid}= PlayerInfo[playerid][pBusiness];
  26. SCM(playerid,-1,""#information"Чтобы выйти с бизнеса введите /exit либо нажмите клавишу ''ALT''");
  27. UpdateBizInfo ( PlayerInfo[playerid][pBusiness] );
  28. //SaveBusiness(PlayerInfo[playerid][pBusiness]);
  29. SaveBusiness(BizInfo[PlayerInfo[playerid][pBusiness] ][bID]);
  30. return 1;
  31. }
  32. else if(BizInfo[i][bTypeBiz] != 9 && strcmp( BizInfo[ i ][ bOwner ], "None", true ))
  33. {
  34. if(BizInfo[i][bLock] && PlayerInfo[playerid][pBusiness] != i) return GameTextForPlayer(playerid, "~r~Closed", 5000, 6);
  35. if(BizInfo[i][bVhod])
  36. {
  37. if(PlayerInfo[playerid][pCash]-BizInfo[i][bVhod] >= 0)
  38. {
  39. Hook_GivePlayerMoney(playerid, -BizInfo[i][bVhod]);
  40. BizInfo[i][bPribil] += BizInfo[i][bVhod];
  41. BizInfo[i][bBank] += BizInfo[i][bVhod];
  42. if(BizInfo[i][bBank] > 10000000) BizInfo[i][bBank] = 10000000;
  43. UpdateBusinessData(i, "bPribil",BizInfo[i][bPribil]);
  44. UpdateBusinessData(i, "bBank",BizInfo[i][bBank]);
  45. }
  46. else return SCM(playerid,COLOR_GREY,"{d83927}Ошибка "WHITE"|{e3e3e3} Извините, но у Вас не хватает денег на вход");
  47. }
  48. if(BizInfo[i][bTypeBiz] == 5 || BizInfo[i][bTypeBiz] == 7) FreezePlayer(playerid, (GetPlayerPing(playerid) > 100 ? (3500) : (2000)));
  49. SCM(playerid,COLOR_GREY,"Помощь: Чтобы выйти с бизнеса введите /exit или нажмите ALT у выхода");
  50. BizEnter{playerid} = i, SetPlayerPosEx( playerid, BizInfo[ i ][ExitBiz][0], BizInfo[ i ][ExitBiz][1], BizInfo[ i ][ExitBiz][2] ), SetPlayerInterior( playerid, BizInfo[ i ][ bInt ] ), SetPlayerVirtualWorld( playerid, BizInfo[ i ][ bVW ]);
  51. }
  52. else if(BizInfo[i][bTypeBiz] == 9) BizEnter{playerid} = i, SetPlayerPosEx( playerid, BizInfo[ i ][ExitBiz][0], BizInfo[ i ][ExitBiz][1], BizInfo[ i ][ExitBiz][2] ), SetPlayerInterior( playerid, BizInfo[ i ][ bInt ] ), SetPlayerVirtualWorld( playerid, BizInfo[ i ][ bVW ]);
  53. }
  54. }
  55. }
  56. return 1;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement