25.11.2011, 19:06
Boa tarde galera, aqui esta eu denovo com outro problema que eu nгo faзo nem ideia de como resolver. As casas e empresas da minha GM nгo estгo trocando os TextDraw depois de comprar ou vender e tbm nгo esta dando para entrar em nenhuma, seja comprada ou a venda.
As do /comprarcasa, /vendercasa, comprarempresa e /venderempresa sao essas: (O problema dessas й que os textdraw nгo estao atualizando).
Esses sao os codigos para entrar na casa/empresa e sair:
Fico muito agradecido desde jб!!!
Quem me ajudar ganha Reputation!!
As do /comprarcasa, /vendercasa, comprarempresa e /venderempresa sao essas: (O problema dessas й que os textdraw nгo estao atualizando).
pawn Код:
if(strcmp(cmd, "/comprarcasa", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(PlayerToPoint(2.0, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel])
{
format(string, sizeof(string), " Vocк precisa ter nivel %d Para comprar! !", HouseInfo[h][hLevel]);
MSGPLAYER(playerid, COLOR_GRAD5, string);
return 1;
}
if(PlayerInfo[playerid][pPHousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPHousekey]][hOwner], true) == 0)
{
MSGPLAYER(playerid, COLOR_WHITE, " Vocк tem uma casa para vender digite /vendercasa, vocк receberб o mesmo valor que foi pago!");
return 1;
}
if(GetPlayerMoney(playerid) > HouseInfo[h][hValue])
{
PlayerInfo[playerid][pPHousekey] = h;
PlayerInfo[playerid][pPHouseCarkey] = PlayerInfo[playerid][pPHousekey]+totalveiculosh;
HouseInfo[h][hOwned] = 1;
HouseInfo[h][hExitx] = 234.0843;
HouseInfo[h][hExity] = 1064.6896;
HouseInfo[h][hExitz] = 1084.2108;
HouseInfo[h][hInt] = 6;
HouseInfo[h][hRentabil] = 1;
HouseInfo[h][hRent] = 200;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoney(playerid,-HouseInfo[h][hValue]);
PlayerPlayMusic(playerid);
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~w~Parabens pela compra ~n~~b~Para entrar digite /entrar", 5000, 3);
MSGPLAYER(playerid, COLOR_WHITE, "Parabйns pela sua nova casa!");
MSGPLAYER(playerid, COLOR_WHITE, "Digite /ajudacasa Em caso de duvidas!");
PlayerInfo[playerid][pSpawn] = 1;
DateProp(playerid);
Atualizar3Dtexts();
OnPropUpdate();
return 1;
}
else
{
MSGPLAYER(playerid, COLOR_WHITE, " Vocк nгo tem dinheiro o suficiente. !");
return 1;
}
}
}
}
return 1;
}
if(strcmp(cmd, "/vendercasa", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pPHousekey] == 255)
{
MSGPLAYER(playerid, COLOR_WHITE, "Vocк nгo tem casa.");
return 1;
}
if(PlayerInfo[playerid][pMarried] > 0)
{
MSGPLAYER(playerid, COLOR_GREY, " Vocк й casado ( a ) nгo pode vender a casa !");
return 1;
}
if(PlayerInfo[playerid][pPHousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPHousekey]][hOwner], true) == 0)
{
new House = PlayerInfo[playerid][pPHousekey];
HouseInfo[House][hHel] = 0;
HouseInfo[House][hArm] = 0;
HouseInfo[House][hHealthx] = 0;
HouseInfo[House][hHealthy] = 0;
HouseInfo[House][hHealthz] = 0;
HouseInfo[House][hArmorrx] = 0;
HouseInfo[House][hArmorry] = 0;
HouseInfo[House][hArmorrz] = 0;
HouseInfo[House][hLock] = 1;
HouseInfo[House][hOwned] = 0;
HouseInfo[House][hVec] = 475;
HouseInfo[House][hVcol1] = -1;
HouseInfo[House][hVcol2] = -1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(HouseInfo[House][hOwner], "O estado", 0, strlen("O estado"), 255);
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,HouseInfo[House][hValue]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Parabens~n~ Voce vendeu a casa por ~n~~g~R$%d", HouseInfo[House][hValue]);
GameTextForPlayer(playerid, string, 10000, 3);
PlayerInfo[playerid][pPHousekey] = 255;
if(PlayerInfo[playerid][pLocal] == House)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,HouseInfo[House][hEntrancex],HouseInfo[House][hEntrancey],HouseInfo[House][hEntrancez]);
PlayerInfo[playerid][pInt] = 0;
}
Atualizar3Dtexts();
OnPropUpdate();
return 1;
}
else
{
MSGPLAYER(playerid, COLOR_GREY, "Vocк nгo tem casa.");
}
}
return 1;
}
if(strcmp(cmd, "/compraremp", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
if(PlayerInfo[playerid][pPbiskey] != 255)
{
MSGPLAYER(playerid, COLOR_GREY, " Vocк ja tem uma empresa, Digite /venderemp para comprar outra.");
return 1;
}
if(PlayerInfo[playerid][pVIP] < 1)
{
MSGPLAYER(playerid, COLOR_GREY, " Vocк nгo й VIP!");
return 1;
}
for(new b = 0; b < sizeof(SBizzInfo); b++)
{
if(PlayerToPoint(2.0, playerid, SBizzInfo[b][sbEntranceX], SBizzInfo[b][sbEntranceY], SBizzInfo[b][sbEntranceZ]) && SBizzInfo[b][sbOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < SBizzInfo[b][sbLevelNeeded])
{
format(string, sizeof(string), "Vocк precisa ser nнvel %d para comprar essa empresa",SBizzInfo[b][sbLevelNeeded]);
MSGPLAYER(playerid, COLOR_GRAD5, string);
return 1;
}
if(GetPlayerMoney(playerid) > SBizzInfo[b][sbBuyPrice])
{
PlayerInfo[playerid][pPbiskey] = b+100;
SBizzInfo[b][sbOwned] = 1;
SBizzInfo[b][sbLocked] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBizzInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoney(playerid,-SBizzInfo[b][sbBuyPrice]);
PlayerPlayMusic(playerid);
MSGPLAYER(playerid, COLOR_WHITE, "Parabens, Vocк comprou uma empresa.");
MSGPLAYER(playerid, COLOR_WHITE, "Digite /ajudaemp para ver os comandos de sua empresa.");
Atualizar3Dtexts();
OnPropUpdate();
return 1;
}
else
{
MSGPLAYER(playerid, COLOR_GREY, "Vocк nгo tem grana suficiente");
return 1;
}
}
}
for(new b = 0; b < sizeof(BizzInfo); b++)
{
if(PlayerToPoint(2.0, playerid, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bOwned] == 0)
{
if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevelNeeded])
{
format(string, sizeof(string), "Vocк precisa ser nнvel %d para comprar essa empresa",BizzInfo[b][bLevelNeeded]);
MSGPLAYER(playerid, COLOR_GRAD5, string);
return 1;
}
if(GetPlayerMoney(playerid) > BizzInfo[b][bBuyPrice])
{
PlayerInfo[playerid][pPbiskey] = b;
BizzInfo[b][bOwned] = 1;
BizzInfo[b][bLocked] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoney(playerid,-BizzInfo[b][bBuyPrice]);
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
SetPlayerPos(playerid,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]);
GameTextForPlayer(playerid, "~w~Bem Vindo~n~Voce pode sair da sua empresa digitando /sair", 5000, 3);
PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
PlayerInfo[playerid][pLocal] = b ;
MSGPLAYER(playerid, COLOR_WHITE, "Parabens, Vocк comprou esta empresa.");
MSGPLAYER(playerid, COLOR_WHITE, "Digite /ajudaemp para ver os comandos de sua empresa.");
Atualizar3Dtexts();
OnPropUpdate();
return 1;
}
else
{
MSGPLAYER(playerid, COLOR_GREY, "Vocк nao tem grana o suficiente");
return 1;
}
}
}
}
return 1;
}
if(strcmp(cmd, "/venderemp", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pPbiskey] == 255)
{
MSGPLAYER(playerid, COLOR_GREY, "Vocк nгo possui uma empresa.");
return 1;
}
if(PlayerInfo[playerid][pMarried] > 0)
{
MSGPLAYER(playerid, COLOR_GREY, " Vocк й casado(a), nгo pode vender a empresa!");
return 1;
}
if(PlayerInfo[playerid][pPbiskey] >= 100 && strcmp(playername, SBizzInfo[PlayerInfo[playerid][pPbiskey]-100][sbOwner], true) == 0)
{
new borse = PlayerInfo[playerid][pPbiskey]-100;
GivePlayerMoney(playerid,SBizzInfo[borse][sbTill]);
SBizzInfo[borse][sbLocked] = 0;
SBizzInfo[borse][sbOwned] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBizzInfo[borse][sbOwner], "The State", 0, strlen("The State"), 255);
strmid(SBizzInfo[borse][sbExtortion], "Nenhum", 0, strlen("Nenhum"), 255);
ConsumingMoney[playerid] = 1;
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Parabens~n~ Voce vendeu imoveis para ~n~~g~R$%d", SBizzInfo[borse][sbTill]);
GameTextForPlayer(playerid, string, 10000, 3);
SBizzInfo[borse][sbTill] = 0;
PlayerInfo[playerid][pPbiskey] = 255;
Atualizar3Dtexts();
OnPropUpdate();
return 1;
}
if(strcmp(playername, BizzInfo[PlayerInfo[playerid][pPbiskey]][bOwner], true) == 0)
{
new borse = PlayerInfo[playerid][pPbiskey];
BizzInfo[borse][bLocked] = 0;
BizzInfo[borse][bOwned] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizzInfo[borse][bOwner], "The State", 0, strlen("The State"), 255);
strmid(BizzInfo[borse][bExtortion], "Nenhum", 0, strlen("Nenhum"), 255);
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,BizzInfo[borse][bTill]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Parabens~n~ Voce vendeu imoveis para ~n~~g~R$%d", BizzInfo[borse][bTill]);
GameTextForPlayer(playerid, string, 10000, 3);
BizzInfo[borse][bTill] = 0;
PlayerInfo[playerid][pPbiskey] = 255;
Atualizar3Dtexts();
OnPropUpdate();
return 1;
}
if(PlayerInfo[playerid][pPbiskey] != 255)
{
new borse = PlayerInfo[playerid][pPbiskey];
format(string, sizeof(string), "~w~Parabens~n~ Voce vendeu imoveis para ~n~~g~R$%d", BizzInfo[borse][bTill]);
GameTextForPlayer(playerid, string, 10000, 3);
ConsumingMoney[playerid] = 1;
PlayerInfo[playerid][pPbiskey] = 255;
return 1;
}
else
{
MSGPLAYER(playerid, COLOR_WHITE, "Vocк nгo tem uma Empresa.");
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/entrar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
if(PlayerInfo[playerid][pPHousekey] == i || HouseInfo[i][hLock] == 0)
{
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
GameTextForPlayer(playerid, "~w~Bem vindo em casa", 5000, 1);
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
HouseEntered[playerid] = i;
}
else
{
GameTextForPlayer(playerid, "~r~Fechado", 5000, 1);
}
}
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(BizzInfo[i][bLocked] == 1)
{
GameTextForPlayer(playerid, "~r~Fechado", 5000, 1);
return 1;
}
GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
format(string, sizeof(string), "~r~-R$%d~n~~w~Digite /sair~n~Para poder sair!", BizzInfo[i][bEntranceCost]);
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
OnPropUpdate();
GameTextForPlayer(playerid, string, 5000, 3);
}
SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
PlayerInfo[playerid][pLocal] = i+99;
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
format(string, sizeof(string), "%s pagou R$%d para entrar na empresa %d", dood, BizzInfo[i][bEntranceCost], i);
printf("%s", string);
//PayLog(string);
}
else
{
GameTextForPlayer(playerid, "~r~Voce nao tem dinheiro suficiente", 5000, 1);
}
}
}
for(new i = 0; i < sizeof(SBizzInfo); i++)
{
if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
{
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(SBizzInfo[i][sbLocked] == 1)
{
GameTextForPlayer(playerid, "~r~Fechado", 5000, 1);
return 1;
}
if(i == 10)
{
PaintballPlayers ++;
PlayerPaintballing[playerid] = 1;
SetPlayerInterior(playerid,10);
new rand = random(sizeof(PaintballSpawns));
SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
Controle(playerid, 0);
}
else if(i == 11)
{
PlayerKarting[playerid] = 1;
MSGPLAYER(playerid, COLOR_GREY, "Agora vocк pode participar da corrida de kart, pegue um kart.");
}
else
{
return 1;
}
GivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]);
gSpentCash[playerid] = GetPlayerMoney(playerid);
SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost];
ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]);
new dood[MAX_PLAYER_NAME];
GetPlayerName(playerid, dood, sizeof(dood));
format(string, sizeof(string), "%s payed R$%d to enter sbiz %d", dood, SBizzInfo[i][sbEntranceCost], i);
printf("%s", string);
//PayLog(string);
OnPropUpdate();
}
}
else
{
GameTextForPlayer(playerid, "~r~Voce nao tem dinheiro suficiente", 5000, 1);
}
}
}
if(strcmp(cmd, "/sair", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
{
if(HouseEntered[playerid] == i)
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pLocal] = 255;
HouseEntered[playerid] = 255;
return 1;
}
}
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
{
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]);
PlayerInfo[playerid][pLocal] = 255;
return 1;
}
}
Quem me ajudar ganha Reputation!!