CMD:houseprice(playerid, params[])
{
new string[210], cash;
new i = GetClosetHouseID(playerid);
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not authorized to use this command.");
if(AdminDuty[playerid] < 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not on duty as an Administrator [/aduty].");
if(House[i][On_Sell] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: This house price cannot be edited because it isn't for sale.");
if(i < 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not close to a house.");
if(sscanf(params, "i", cash)) return SendClientMessage(playerid, COLOR_TWGRAY, "USAGE{FFFFFF}: /houseprice [House Price Amount]");
if(cash < 1 || cash > 2500000) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: The house price can only be between $1 and $2500000.");
House[i][Price] = cash;
CheckHouse(i);
format(string,sizeof(string),"Information{FFFFFF}: You have edited house %d %s price to $%d.", House[i][CheckHouseID], House[i][Address], cash);
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "Admin Notice: Administrator %s has changed house %d %s price to $%d.", GetName(playerid), House[i][CheckHouseID], House[i][Address], cash);
SendClientMessageToAdmins(COLOR_DARKRED, string, 1);
format(string,sizeof(string),"{29CC3F}Owner: "COL_WHITE"None\n{29CC3F}House Name: "COL_WHITE"%s\n{29CC3F}Price: "COL_WHITE"$%d\n{29CC3F}Address: "COL_WHITE"%d %s\n{29CC3F}Status: "COL_WHITE"Ownable",House[i][HouseName],House[i][Price],House[i][CheckHouseID],House[i][Address]);
UpdateDynamic3DTextLabelText(House[i][DLabel],-1,string);
return 1;
}
CMD:houseaddress(playerid, params[])
{
new string[210], say;
new i = GetClosetHouseID(playerid);
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not authorized to use this command.");
if(AdminDuty[playerid] < 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not on duty as an Administrator [/aduty].");
if(House[i][On_Sell] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: This house price cannot be edited because it isn't for sale.");
if(i < 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not close to a house.");
if(sscanf(params, "s", say)) return SendClientMessage(playerid, COLOR_TWGRAY, "USAGE{FFFFFF}: /houseaddress [Address (Example: Palomino Creek)]");
House[i][Address] = say;
CheckHouse(i);
format(string,sizeof(string),"Information{FFFFFF}: You have changed the address of house ID %d to %s.", House[i][CheckHouseID], say);
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "Admin Notice: Administrator %s has changed address of house ID %d to %s.", GetName(playerid), House[i][CheckHouseID], say);
SendClientMessageToAdmins(COLOR_DARKRED, string, 1);
format(string,sizeof(string),"{29CC3F}Owner: "COL_WHITE"None\n{29CC3F}House Name: "COL_WHITE"%s\n{29CC3F}Price: "COL_WHITE"$%d\n{29CC3F}Address: "COL_WHITE"%d %s\n{29CC3F}Status: "COL_WHITE"Ownable",House[i][HouseName],House[i][Price],House[i][CheckHouseID],House[i][Address]);
UpdateDynamic3DTextLabelText(House[i][DLabel],-1,string);
return 1;
}
new say[128];
I've tried
pawn Code:
|
new say;
new say[128];
if(sscanf(params, "s", say))
if(sscanf(params, "s[128]", say))
CMD:hedit(playerid, params[])
{
new string[210], cash, say[128];
new i = GetClosetHouseID(playerid);
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not authorized to use this command.");
if(AdminDuty[playerid] < 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not on duty as an Administrator [/aduty].");
if(i < 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not close to a house.");
if(House[i][On_Sell] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: This house cannot be edited because it isn't for sale.");
if(sscanf(params, "s[32]", params))
{
SendClientMessage(playerid, COLOR_TWGRAY, "Usage{FFFFFF}: /hedit [option]");
SendClientMessage(playerid, COLOR_GREEN, "Options{FFFFFF}: Price, Address.");
return 1;
}
if(!strcmp(params, "price", true, 5))
{
if(sscanf(params, "s[32]i", params, cash))
{
SendClientMessage(playerid, COLOR_TWGRAY, "Usage{FFFFFF}: /hedit price [amount]");
return 1;
}
if(cash < 1 || cash > 2000000) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: The house price can only be between $1 and $2000000.");
House[i][Price] = cash;
CheckHouse(i);
format(string,sizeof(string),"Information{FFFFFF}: You have edited house %s price to $%d.", House[i][Address], cash);
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "Admin Notice{FFFFFF}: Administrator %s has changed house %s price to $%d.", GetName(playerid), House[i][Address], cash);
SendClientMessageToAdmins(COLOR_DARKRED, string, 1);
format(string,sizeof(string),"{29CC3F}Owner: "COL_WHITE"None\n{29CC3F}House Name: "COL_WHITE"%s\n{29CC3F}Price: "COL_WHITE"$%d\n{29CC3F}Address: "COL_WHITE"%s\n{29CC3F}Status: "COL_WHITE"Ownable",House[i][HouseName],House[i][Price],House[i][Address]);
UpdateDynamic3DTextLabelText(House[i][DLabel],-1,string);
return 1;
}
if(!strcmp(params, "address", true, 7))
{
if(sscanf(params, "s[32]s[128]", params, say))
{
SendClientMessage(playerid, COLOR_TWGRAY, "Usage{FFFFFF}: /hedit address [text]");
return 1;
}
House[i][Address] = say; // This is the error line
CheckHouse(i);
format(string,sizeof(string),"Information{FFFFFF}: You have edited house ID %d address to %s.", House[i][CheckHouseID], House[i][Address]);
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "Admin Notice{FFFFFF}: Administrator %s has changed house ID %d address to %s.", GetName(playerid), House[i][CheckHouseID], House[i][Address]);
SendClientMessageToAdmins(COLOR_DARKRED, string, 1);
format(string,sizeof(string),"{29CC3F}Owner: "COL_WHITE"None\n{29CC3F}House Name: "COL_WHITE"%s\n{29CC3F}Price: "COL_WHITE"$%d\n{29CC3F}Address: "COL_WHITE"%s\n{29CC3F}Status: "COL_WHITE"Ownable",House[i][HouseName],House[i][Price],House[i][Address]);
UpdateDynamic3DTextLabelText(House[i][DLabel],-1,string);
return 1;
}
return 1;
}
C:\Documents and Settings\Aphex\Desktop\DRP\gamemodes\dominationrp.pwn(2643) : error 047: array sizes do not match, or destination array is too small
House[i][Address] = say;
CMD:hedit(playerid, params[])
{
new string[210], cash, say;
new i = GetClosetHouseID(playerid);
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not authorized to use this command.");
if(AdminDuty[playerid] < 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not on duty as an Administrator [/aduty].");
if(i < 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"Error{FFFFFF}: You are not close to a house.");
if(House[i][On_Sell] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: This house cannot be edited because it isn't for sale.");
if(sscanf(params, "s[32]", params))
{
SendClientMessage(playerid, COLOR_TWGRAY, "Usage{FFFFFF}: /hedit [option]");
SendClientMessage(playerid, COLOR_GREEN, "Options{FFFFFF}: Price, Address.");
return 1;
}
if(!strcmp(params, "price", true, 5))
{
if(sscanf(params, "s[32]i", params, cash))
{
SendClientMessage(playerid, COLOR_TWGRAY, "Usage{FFFFFF}: /hedit price [amount]");
return 1;
}
if(cash < 1 || cash > 2000000) return SendClientMessage(playerid, COLOR_LIGHTRED, "Error{FFFFFF}: The house price can only be between $1 and $2000000.");
House[i][Price] = cash;
CheckHouse(i);
format(string,sizeof(string),"Information{FFFFFF}: You have edited house %s price to $%d.", House[i][Address], cash);
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "Admin Notice{FFFFFF}: Administrator %s has changed house %s price to $%d.", GetName(playerid), House[i][Address], cash);
SendClientMessageToAdmins(COLOR_DARKRED, string, 1);
format(string,sizeof(string),"{29CC3F}Owner: "COL_WHITE"None\n{29CC3F}House Name: "COL_WHITE"%s\n{29CC3F}Price: "COL_WHITE"$%d\n{29CC3F}Address: "COL_WHITE"%s\n{29CC3F}Status: "COL_WHITE"Ownable",House[i][HouseName],House[i][Price],House[i][Address]);
UpdateDynamic3DTextLabelText(House[i][DLabel],-1,string);
return 1;
}
if(!strcmp(params, "address", true, 7))
{
if(sscanf(params, "s[32]s[128]", params, say))
{
SendClientMessage(playerid, COLOR_TWGRAY, "Usage{FFFFFF}: /hedit address [text]");
return 1;
}
House[i][Address] = say; // This is the error line
CheckHouse(i);
format(string,sizeof(string),"Information{FFFFFF}: You have edited house ID %d address to %s.", House[i][CheckHouseID], House[i][Address]);
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "Admin Notice{FFFFFF}: Administrator %s has changed house ID %d address to %s.", GetName(playerid), House[i][CheckHouseID], House[i][Address]);
SendClientMessageToAdmins(COLOR_DARKRED, string, 1);
format(string,sizeof(string),"{29CC3F}Owner: "COL_WHITE"None\n{29CC3F}House Name: "COL_WHITE"%s\n{29CC3F}Price: "COL_WHITE"$%d\n{29CC3F}Address: "COL_WHITE"%s\n{29CC3F}Status: "COL_WHITE"Ownable",House[i][HouseName],House[i][Price],House[i][Address]);
UpdateDynamic3DTextLabelText(House[i][DLabel],-1,string);
return 1;
}
return 1;
}
C:\Documents and Settings\Aphex\Desktop\DRP\gamemodes\dominationrp.pwn(2643) : error 001: expected token: "]", but found "-identifier-" C:\Documents and Settings\Aphex\Desktop\DRP\gamemodes\dominationrp.pwn(2643) : warning 215: expression has no effect C:\Documents and Settings\Aphex\Desktop\DRP\gamemodes\dominationrp.pwn(2643) : error 001: expected token: ";", but found "]" C:\Documents and Settings\Aphex\Desktop\DRP\gamemodes\dominationrp.pwn(2643) : error 029: invalid expression, assumed zero C:\Documents and Settings\Aphex\Desktop\DRP\gamemodes\dominationrp.pwn(2643) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
new House[MAX_HOUSE][house];
format(House[i][Address],32,"%s",say);