case 1: { format(hfile, sizeof(hfile), "/Houses/%d.ini", GetEntID(playerid)); new nigname[MAX_PLAYER_NAME]; nigname = pName(playerid); new hprice; hprice = dini_Int(hfile, "Price"); new howner[256]; howner = dini_Get(hfile, "Owner"); new hname[256]; hname = dini_Get(hfile, "Name"); if(GetPlayerMoney(playerid) < hprice) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You do not have enough money to purchase\nthis house!", "Ok", ""); if(strfind(howner, nigname, true) != -1) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You already own this house!", "Ok", ""); dini_Set(hfile, "Owner", pName(playerid)); GivePlayerMoney(playerid, -hprice); PlayerPlaySound(playerid, 1058, 0, 0, 0); PlayerPlaySound(playerid, 1149, 0, 0, 0); ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You have successfully purchased this house!", "", "Exit"); #if HMESSAGES == 1 new str[128]; format(str, sizeof(str), "%s purchased the House '%s' [ID:%d] for $%d!", pName(playerid), hname, GetEntID(playerid), hprice); SendClientMessageToAll(COLOR_BLUE, str); #endif |
new bool: CasaComprada[MAX_CASAS];
CMD:comprarcasa(playerid, params[])
{
//blablabla do codigo
CasaComprada[casaid] = true;
return 1;
}
CMD:vendercasa(playerid)
{
//blablabla do codigo
CasaComprada[casaid] = false;
return 1;
}
CMD:comprarcasa(playerid)
{
//blablabla do codigo
if(CasaComprada[casaid] == true) return SendClientMessage(playerid, -1, "Vocк nгo pode comprar uma casa jб comprada!");
return 1;
}
new casaid; format(hfile, sizeof(hfile), "/Houses/%d.ini", GetEntID(playerid)); new nigname[MAX_PLAYER_NAME]; nigname = pName(playerid); new hprice; hprice = dini_Int(hfile, "Price"); new howner[256]; howner = dini_Get(hfile, "Owner"); new hname[256]; hname = dini_Get(hfile, "Name"); if(GetPlayerMoney(playerid) < hprice) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You do not have enough money to purchase\nthis house!", "Ok", ""); if(strfind(howner, nigname, true) != -1) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You already own this house!", "Ok", ""); dini_Set(hfile, "Owner", pName(playerid)); GivePlayerMoney(playerid, -hprice); PlayerPlaySound(playerid, 1058, 0, 0, 0); PlayerPlaySound(playerid, 1149, 0, 0, 0); ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You have successfully purchased this house!", "", "Exit"); #if HMESSAGES == 1 new str[128]; format(str, sizeof(str), "%s purchased the House '%s' [ID:%d] for $%d!", pName(playerid), hname, GetEntID(playerid), hprice); CasaComprada[casaid] = true; SendClientMessageToAll(COLOR_BLUE, str); if(CasaComprada[casaid] == true) return SendClientMessage(playerid, -1, "Vocк nгo pode comprar uma casa jб comprada!"); #endif |
new casaid; format(hfile, sizeof(hfile), "/Houses/%d.ini", GetEntID(playerid)); new howner[256]; howner = dini_Get(hfile, "Owner"); new nigname[MAX_PLAYER_NAME]; nigname = pName(playerid); if(strfind(howner, nigname, true) == -1) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Options", "You are not the owner of this house!", "Ok", ""); if(strfind(inputtext,"Yes",true) == 0) { new hprice; hprice = dini_Int(hfile, "Price"); new hname[256]; hname = dini_Get(hfile, "Name"); dini_Set(hfile, "Owner", "None"); GivePlayerMoney(playerid, hprice); #if HMESSAGES == 1 new str[128]; format(str, sizeof(str), "%s sold the House '%s' [ID:%d] [Price: %d]!", pName(playerid), hname, GetEntID(playerid), hprice); SendClientMessageToAll(COLOR_BLUE, str); CasaComprada[casaid] = false; return 1; #endif } else if(strfind(inputtext,"No",true) == 0) { SendClientMessage(playerid, COLOR_RED, "You decided not to sell your house..."); } } return 1; } |
if(GetPlayerMoney(playerid) < hprice) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You do not have enough money to purchase\nthis house!", "Ok", ""); if(strfind(howner, nigname, true) != -1) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You already own this house!", "Ok", ""); dini_Set(hfile, "Owner", pName(playerid)); GivePlayerMoney(playerid, -hprice); PlayerPlaySound(playerid, 1058, 0, 0, 0); PlayerPlaySound(playerid, 1149, 0, 0, 0); ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You have successfully purchased this house!", "", "Exit"); #if HMESSAGES == 1 new str[128]; format(str, sizeof(str), "%s purchased the House '%s' [ID:%d] for $%d!", pName(playerid), hname, GetEntID(playerid), hprice); CasaComprada[casaid] = true; SendClientMessageToAll(COLOR_BLUE, str); if(CasaComprada[GetEntID(playerid)] == true) return SendClientMessage(playerid, -1, "Vocк nгo pode comprar uma casa jб comprada!"); #endif |
if(GetPlayerMoney(playerid) < hprice) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You do not have enough money to purchase\nthis house!", "Ok", "");
if(strfind(howner, nigname, true) != -1) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You already own this house!", "Ok", "");
if(CasaComprada[GetEntID(playerid)] == true) return SendClientMessage(playerid, -1, "Vocк nгo pode comprar uma casa jб comprada!");
dini_Set(hfile, "Owner", pName(playerid));
GivePlayerMoney(playerid, -hprice);
PlayerPlaySound(playerid, 1058, 0, 0, 0);
PlayerPlaySound(playerid, 1149, 0, 0, 0);
CasaComprada[GetEntID(playerid)] = true;
ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You have successfully purchased this house!", "", "Exit");
#if HMESSAGES == 1
new str[128];
format(str, sizeof(str), "%s purchased the House '%s' [ID:%d] for $%d!", pName(playerid), hname, GetEntID(playerid), hprice);
SendClientMessageToAll(COLOR_BLUE, str);
#endif
#define MAX_CASAS 10
new bool:CasaComprada[MAX_CASAS];
case 1:
{
format(hfile, sizeof(hfile), "/Houses/%d.ini", GetEntID(playerid));
new nigname[MAX_PLAYER_NAME]; nigname = pName(playerid);
new hprice; hprice = dini_Int(hfile, "Price");
new howner[256]; howner = dini_Get(hfile, "Owner");
new hname[256]; hname = dini_Get(hfile, "Name");
if(GetPlayerMoney(playerid) < hprice) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You do not have enough money to purchase\nthis house!", "Ok", "");
if(strcmp(howner, nigname, true) == 0) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You already own this house!", "Ok", "");
if(CasaComprada[GetEntID(playerid)] == true)
{
SendClientMessage(playerid, -1, "Vocк nгo pode comprar uma casa jб comprada!");
return true;
}
else
{
dini_Set(hfile, "Owner", pName(playerid));
CasaComprada[GetEntID(playerid)] = true;
GivePlayerMoney(playerid, -hprice);
PlayerPlaySound(playerid, 1058, 0, 0, 0);
PlayerPlaySound(playerid, 1149, 0, 0, 0);
ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Purchase", "You have successfully purchased this house!", "", "Exit");
if(HMESSAGES == 1){
new str[128];
format(str, sizeof(str), "%s purchased the House '%s' [ID:%d] for $%d!", pName(playerid), hname, GetEntID(playerid), hprice);
SendClientMessageToAll(COLOR_BLUE, str);
}
}
return true;
}
format(hfile, sizeof(hfile), "/Houses/%d.ini", GetEntID(playerid));
new howner[MAX_PLAYER_NAME]; howner = dini_Get(hfile, "Owner");
new nigname[MAX_PLAYER_NAME]; nigname = pName(playerid);
if(strcmp(howner, nigname, true) != 0) return ShowPlayerDialog(playerid, DABOX-1, DIALOG_STYLE_MSGBOX, "House - Options", "You are not the owner of this house!", "Ok", "");
if(strcmp(inputtext,"Yes", true) == 0)
{
new hprice; hprice = dini_Int(hfile, "Price");
new hname[256]; hname = dini_Get(hfile, "Name");
dini_Set(hfile, "Owner", "None");
GivePlayerMoney(playerid, hprice);
CasaComprada[GetEntID(playerid)] = false;
if(HMESSAGES == 1){
new str[128];
format(str, sizeof(str), "%s sold the House '%s' [ID:%d] [Price: %d]!", pName(playerid), hname, GetEntID(playerid), hprice);
SendClientMessageToAll(COLOR_BLUE, str);
}
return 1;
}
else if(strcmp(inputtext,"No", true) == 0)
{
SendClientMessage(playerid, COLOR_RED, "You decided not to sell your house...");
}
C:\Users\AL-K-WK\Documents\x\Samp\BDL\filterscripts\casas.pwn(61 6) : warning 217: loose indentation C:\Users\AL-K-WK\Documents\x\Samp\BDL\filterscripts\casas.pwn(63 5) : warning 206: redundant test: constant expression is non-zero C:\Users\AL-K-WK\Documents\x\Samp\BDL\filterscripts\casas.pwn(80 6) : warning 217: loose indentation C:\Users\AL-K-WK\Documents\x\Samp\BDL\filterscripts\casas.pwn(80 6) : error 047: array sizes do not match, or destination array is too small C:\Users\AL-K-WK\Documents\x\Samp\BDL\filterscripts\casas.pwn(81 6) : warning 206: redundant test: constant expression is non-zero Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
new howner[MAX_PLAYER_NAME]; howner = dini_Get(hfile, "Owner"); |
new howner[MAX_PLAYER_NAME];
new howner[256];