Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:editbiz(playerid, params[])
- {
- new text[15],amount, string[128],name[32];
- if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "Eroare: Nu esti autorizat sa folosesti aceasta comanda.");
- if(sscanf(params,"s[15]", text))
- {
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz [items]");
- SendClientMessage(playerid, COLOR_WHITE, "Items: price, fee, lock, vault, name");
- return 1;
- }
- if(strcmp(text, "price", true, 5) == 0)
- {
- if(sscanf(params, "s[15]i",text,amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz price [amount]");
- if(amount < 0) return SendClientMessage(playerid, COLOR_WHITE, "Eroare: Valoare introdusa nu poate fi mai mica decat 0.");
- for(new b = 0; b < MAX_BUSINESSES; b++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, BizInfo[b][bExteriorPos][0], BizInfo[b][bExteriorPos][1], BizInfo[b][bExteriorPos][2]))
- {
- BizInfo[b][bPrice] = amount;
- UpdateBusiness(b);
- format(string, sizeof(string), "You have edited price to %d$ for business %d.",amount,b);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "AdmCmd: %s has edited the price to %d for business %d.",PlayerInfo[playerid][pUsername],amount,b);
- SendMessageToAdmins(4, COLOR_LIGHTRED, string);
- format(string, sizeof(string), "%s has edited the price to %d for business %d.",PlayerInfo[playerid][pUsername],amount,b);
- ABroadcast(string);
- break;
- }
- }
- }
- if(strcmp(text, "fee", true, 3) == 0)
- {
- if(sscanf(params, "s[15]i",text,amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz fee [amount]");
- if(amount < 1) return SendClientMessage(playerid, COLOR_WHITE, "Eroare: Valoare introdusa nu poate fi mai mica decat 1.");
- for(new b = 0; b < MAX_BUSINESSES; b++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, BizInfo[b][bExteriorPos][0], BizInfo[b][bExteriorPos][1], BizInfo[b][bExteriorPos][2]))
- {
- BizInfo[b][bFee] = amount;
- UpdateBusiness(b);
- format(string, sizeof(string), "You have edited fee to %d$ for business %d.",amount,b);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "AdmCmd: %s has edited the fee to %d for business %d.",PlayerInfo[playerid][pUsername],amount,b);
- SendMessageToAdmins(4, COLOR_LIGHTRED, string);
- format(string, sizeof(string), "%s has edited the fee to %d for business %d.",PlayerInfo[playerid][pUsername],amount,b);
- ABroadcast(string);
- break;
- }
- }
- }
- if(strcmp(text, "lock", true, 4) == 0)
- {
- if(sscanf(params, "s[15]i",text,amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz lock [0/1]");
- if(amount < 0 || amount > 1) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz lock [0/1]");
- for(new b = 0; b < MAX_BUSINESSES; b++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, BizInfo[b][bExteriorPos][0], BizInfo[b][bExteriorPos][1], BizInfo[b][bExteriorPos][2]))
- {
- BizInfo[b][bLocked] = amount;
- UpdateBusiness(b);
- format(string, sizeof(string), "You have edited lock to %d for business %d.",amount,b);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "AdmCmd: %s has edited the lock to %d for business %d.",PlayerInfo[playerid][pUsername],amount,b);
- SendMessageToAdmins(4, COLOR_LIGHTRED, string);
- format(string, sizeof(string), "%s has edited the lock to %d for business %d.",PlayerInfo[playerid][pUsername],amount,b);
- ABroadcast(string);
- break;
- }
- }
- }
- if(strcmp(text, "vault", true, 5) == 0)
- {
- if(sscanf(params, "s[15]i",text,amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz vault [amount]");
- if(amount < 0) return SendClientMessage(playerid, COLOR_WHITE, "Eroare: Valoare introdusa nu poate fi mai mica decat 0.");
- for(new b = 0; b < MAX_BUSINESSES; b++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, BizInfo[b][bExteriorPos][0], BizInfo[b][bExteriorPos][1], BizInfo[b][bExteriorPos][2]))
- {
- BizInfo[b][bVault] = amount;
- UpdateBusiness(b);
- format(string, sizeof(string), "You have edited vault to %d$ for business %d.",amount,b);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "AdmCmd: %s has edited the vault to %d for business %d.",PlayerInfo[playerid][pUsername],amount,b);
- SendMessageToAdmins(4, COLOR_LIGHTRED, string);
- format(string, sizeof(string), "%s has edited the vault to %d for business %d.",PlayerInfo[playerid][pUsername],amount,b);
- ABroadcast(string);
- break;
- }
- }
- }
- if(strcmp(text, "name", true, 4) == 0)
- {
- if(sscanf(params, "s[15]s[32]",text,name)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz name [new name]");
- if(strlen(name) < 1) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz name [new name]");
- for(new b = 0; b < MAX_BUSINESSES; b++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, BizInfo[b][bExteriorPos][0], BizInfo[b][bExteriorPos][1], BizInfo[b][bExteriorPos][2]))
- {
- format(BizInfo[b][bName], 32, name);
- UpdateBusiness(b);
- format(string, sizeof(string), "You have edited name for business %d.",amount,b);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "AdmCmd: %s has edited the name to %s for business %d.",PlayerInfo[playerid][pUsername],name,b);
- SendMessageToAdmins(4, COLOR_LIGHTRED, string);
- format(string, sizeof(string), "%s has edited the name to %s for business %d.",PlayerInfo[playerid][pUsername],name,b);
- ABroadcast(string);
- break;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement