Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
- switch(newkeys) {
- case KEY_SECONDARY_ATTACK: {
- if(inBusinessArea[playerid] > -1) {
- new bizzid = inBusinessArea[playerid];
- if(bizzInfo[bizzid][bStatic] == 0) {
- if(getPlayerMoney(playerid) < bizzInfo[bizzid][bFee]) return sendError(playerid, "Nu ai %s$ pentru a intra.", "You do not have %s$ to enter.", formatNumber(bizzInfo[bizzid][bFee]));
- if(bizzInfo[bizzid][bLocked] != 1) return sendError(playerid, "Acest business este incuiat.", "Business is locked.");
- if(gettime() < GetPVarInt(playerid, "enterBusiness")) return sendError(playerid, "Asteapta %d secunde.", "Please wait %d seconds.", GetPVarInt(playerid, "enterBusiness") - gettime());
- SetPlayerPos(playerid, bizzInfo[bizzid][bIntX], bizzInfo[bizzid][bIntY], bizzInfo[bizzid][bIntZ]);
- SetPlayerInterior(playerid, bizzInfo[bizzid][bInterior]);
- SetPlayerVirtualWorld(playerid, bizzid);
- inBusiness[playerid] = bizzid;
- bizzInfo[bizzid][bProduction] += bizzInfo[bizzid][bFee];
- SetPVarInt(playerid, "enterBusiness", gettime() + 10);
- switch(bizzInfo[bizzid][bType]) {
- case 1: SCM(playerid, -1, "Welcome! The commands of this business are as follows: /withdraw, /deposit, /transfer");
- case 2: SCM(playerid, -1, "Welcome! The commands of this business are as follows: /buy");
- case 3: SCM(playerid, -1, "Welcome! The commands of this business are as follows: /buygun");
- case 4: SCM(playerid, -1, "Welcome! The commands of this business are as follows: /buydrink");
- case 5: SCM(playerid, -1, "Welcome! The commands of this business are as follows: /buytoys");
- case 6: SCM(playerid, -1, "Welcome! The commands of this business are as follows: /dice");
- case 7: SCM(playerid, -1, "Welcome! The commands of this business are as follows: /eat");
- case 8: SCM(playerid, -1, "Welcome! The commands of this business are as follows: /buyfightstyle");
- case 9: SCM(playerid, -1, "Welcome! The commands of this business are as follows: /clothes");
- case 10: SCM(playerid, -1, "Welcome! The commands of this business are as follows: /eat");
- }
- va_GameTextForPlayer(playerid, "~R~-%s$", 2000, 1, formatNumber(bizzInfo[bizzid][bFee]));
- givePlayerMoney(playerid, -bizzInfo[bizzid][bFee]);
- gQuery[0] = (EOS);
- mysql_format(SQL, gQuery, 256, "UPDATE `server_business` SET `bizzProduction`='%d' WHERE `bizzID`='%d' LIMIT 1", bizzInfo[bizzid][bProduction], bizzid);
- mysql_pquery(SQL, gQuery, "", "");
- }
- }
- if(inBusiness[playerid] > -1 && IsPlayerInRangeOfPoint(playerid, 2.0, bizzInfo[inBusiness[playerid]][bIntX], bizzInfo[inBusiness[playerid]][bIntY], bizzInfo[inBusiness[playerid]][bIntZ])) {
- new bizzid = inBusiness[playerid];
- if(bizzid == GetPlayerVirtualWorld(playerid)) {
- SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, bizzInfo[bizzid][bX], bizzInfo[bizzid][bY], bizzInfo[bizzid][bZ]);
- inBusiness[playerid] = -1;
- }
- }
- /// Factions
- if(inFactionArea[playerid] > -1) {
- new factionid = inFactionArea[playerid];
- if(factionInfo[factionid][fHQStatus] == 1) {
- SetPlayerPos(playerid, factionInfo[factionid][fIntX], factionInfo[factionid][fIntY], factionInfo[factionid][fIntZ]);
- SetPlayerInterior(playerid, factionInfo[factionid][fInterior]);
- SetPlayerVirtualWorld(playerid, factionid);
- inFaction[playerid] = factionid;
- } else return sendError(playerid, "Aceasta factiune este incuiata.", "This faction is locked.");
- }
- if(inFaction[playerid] > -1 && IsPlayerInRangeOfPoint(playerid, 2.0, factionInfo[inFaction[playerid]][fIntX], factionInfo[inFaction[playerid]][fIntY], factionInfo[inFaction[playerid]][fIntZ])) {
- new factionid = inFaction[playerid];
- if(factionid == GetPlayerVirtualWorld(playerid)) {
- SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, factionInfo[factionid][facX], factionInfo[factionid][facY], factionInfo[factionid][facZ]);
- inFaction[playerid] = -1;
- }
- }
- }
- }
- return true; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement