Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:makehouse(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdminLevel] < 5)return SendErrorMessage(playerid, "You are not the required admin level to use this command.");
- new section[10], extra[40];
- if(sscanf(params,"s[10]S('None')[40]", section, extra))return SendSyntaxMessage(playerid, "/makehouse [exterior/interior/name/price/complete]");
- {
- if(strmatch(section, "exterior")){
- GetPlayerPos(playerid, hCreateExt[0], hCreateExt[1], hCreateExt[2]);
- GetPlayerFacingAngle(playerid, hCreateExt[3]);
- SendInfoMessage(playerid, "Exterior position set successfully.");
- }
- else if(strmatch(section, "interior")){
- hCreateIntID = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, hCreateInt[0], hCreateInt[1], hCreateInt[2]);
- GetPlayerFacingAngle(playerid, hCreateInt[3]);
- SendInfoMessage(playerid, "Interior position set successfully.");
- }
- else if(strmatch(section, "name")){
- if(strmatch(extra, "None"))return SendErrorMessage(playerid, "/makehouse NAME [name to set]");
- if(strlen(extra) > 39 || strlen(extra) < 3)return SendErrorMessage(playerid, "Name length must be between 3 AND 39 characters long.");
- hCreateName = extra;
- SendInfoMessage(playerid, "Name set successfully: %s", extra);
- }
- else if(strmatch(section, "price")){
- if(strmatch(extra, "None"))return SendSyntaxMessage(playerid, "/makehouse PRICE [$ price to set]");
- if(strval(extra) < 1)return SendErrorMessage(playerid, "Price must be above $1.");
- hCreatePrice = strval(extra);
- SendInfoMessage(playerid, "Price set successfully: $%d.", strval(extra));
- }
- else if(strmatch(section, "complete")){
- if(hCreatePrice == 0)return true;
- if(strmatch(hCreateName, "None"))return true;
- SaveHouseToDatabase(playerid);
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement