28.11.2017, 17:21
queria uma ajuda aqui , tenho um gm aqui que quando der /mudarcasa ele muda o interior , e fica sу que quando der gmx o interior que o dono colocou nao salva , ele volta para o que veio na compra
if(strcmp(cmd,"/mudarcasa", true) == 0)
{
new House = PlayerDados[playerid][pPHousekey],
idcasa = strval(tmp);
GetPlayerName(playerid, playername, sizeof(playername));
if (House != 9999 && strcmp(playername, HouseInfo[PlayerDados[playerid][pPHousekey]][hOwner], true) == 0)
{
tmp = strtok(cmdtext, idx);
if(HouseEntered[playerid] != 9999) {
return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode usar esse comando dentro de uma casa");
}
if(GetPlayerMoneyEx(playerid) < 1000) {
return SendClientMessage(playerid, COLOR_GRAD5, "Vocк nгo tem dinheiro suficiente R$1000");
}
if(!strlen(tmp)) {
return SendClientMessage(playerid, COLOR_GREY, "USE: /mudarcasa [1 a 15]");
}
switch (idcasa) {
case 1: {
HouseInfo[House][hExitx] = 2467.4951;
HouseInfo[House][hExity] = -1698.4037;
HouseInfo[House][hExitz] = 1013.5078;
HouseInfo[House][hInt] = 2;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 1.");
}
case 2: {
HouseInfo[House][hExitx] = 318.5972;
HouseInfo[House][hExity] = 1114.4792;
HouseInfo[House][hExitz] = 1083.8828;
HouseInfo[House][hInt] = 5;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 2.");
}
case 3: {
HouseInfo[House][hExitx] = 2324.419921;
HouseInfo[House][hExity] = -1145.568359;
HouseInfo[House][hExitz] = 1050.710083;
HouseInfo[House][hInt] = 12;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 3.");
}
case 4: {
HouseInfo[House][hExitx] = 235.508994;
HouseInfo[House][hExity] = 1189.169897;
HouseInfo[House][hExitz] = 1080.339966;
HouseInfo[House][hInt] = 3;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 4.");
}
case 5: {
HouseInfo[House][hExitx] = 225.756989;
HouseInfo[House][hExity] = 1240.000000;
HouseInfo[House][hExitz] = 1082.149902;
HouseInfo[House][hInt] = 2;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 5.");
}
case 6: {
HouseInfo[House][hExitx] = 223.043991;
HouseInfo[House][hExity] = 1289.259888;
HouseInfo[House][hExitz] = 1082.199951;
HouseInfo[House][hInt] = 1;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 6.");
}
case 7: {
if(PlayerDados[playerid][pVip] < 1) {
SendClientMessage(playerid, COR_VAGOS, "Vocк nгo й um VIP !");
return 1;
}
HouseInfo[House][hExitx] = 225.630997;
HouseInfo[House][hExity] = 1022.479980;
HouseInfo[House][hExitz] = 1084.069946;
HouseInfo[House][hInt] = 7;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 7.");
}
case 8: {
if(PlayerDados[playerid][pVip] < 2) {
return SendClientMessage(playerid, COR_VAGOS, "Vocк nгo й um Sуcio Bronze!");
}
HouseInfo[House][hExitx] = 328.493988;
HouseInfo[House][hExity] = 1480.589966;
HouseInfo[House][hExitz] = 1084.449951;
HouseInfo[House][hInt] = 15;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 8.");
}
case 9: {
if(PlayerDados[playerid][pVip] < 2) {
return SendClientMessage(playerid, COR_VAGOS, "Vocк nгo й um Sуcio Bronze!");
}
HouseInfo[House][hExitx] = 234.0843;
HouseInfo[House][hExity] = 1064.6896;
HouseInfo[House][hExitz] = 1084.2108;
HouseInfo[House][hInt] = 6;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 9.");
}
case 10: {
if(PlayerDados[playerid][pVip] < 2) {
return SendClientMessage(playerid, COR_VAGOS, "Vocк nгo й um Sуcio Bronze!");
}
HouseInfo[House][hExitx] = 260.4075;
HouseInfo[House][hExity] = 1238.6646;
HouseInfo[House][hExitz] = 1084.2578;
HouseInfo[House][hInt] = 9;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 10.");
}
case 11: {
if(PlayerDados[playerid][pVip] < 2) {
return SendClientMessage(playerid, COR_VAGOS, "Vocк nгo й um Sуcio Broze !");
}
HouseInfo[House][hExitx] = 88.5938;
HouseInfo[House][hExity] = 1702.7601;
HouseInfo[House][hExitz] = 100001.2734;
HouseInfo[House][hInt] = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 11.");
}
case 12: {
if(PlayerDados[playerid][pVip] < 3) {
return SendClientMessage(playerid, COR_VAGOS, "Vocк nгo й um Sуcio Prata !");
}
HouseInfo[House][hExitx] = 243.7127;
HouseInfo[House][hExity] = -1851.3945;
HouseInfo[House][hExitz] = 3333.9329;
HouseInfo[House][hInt] = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 12.");
}
case 13: {
if(PlayerDados[playerid][pVip] < 3) {
return SendClientMessage(playerid, COR_VAGOS, "Vocк nгo й um Sуcio Prata !");
}
HouseInfo[House][hExitx] = 132.0281;
HouseInfo[House][hExity] = 1689.6173;
HouseInfo[House][hExitz] = 10012.0879;
HouseInfo[House][hInt] = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 13.");
SalvarCasa(House);
}
case 14: {
if(PlayerDados[playerid][pVip] < 4) {
return SendClientMessage(playerid, COR_VAGOS, "Vocк nгo й um Sуcio Ouro!");
}
HouseInfo[House][hExitx] = 324.4288;
HouseInfo[House][hExity] = -1579.0096;
HouseInfo[House][hExitz] = 10.1469;
HouseInfo[House][hInt] = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 14.");
SalvarCasa(House);
}
case 15: {
if(PlayerDados[playerid][pVip] < 4) {
return SendClientMessage(playerid, COR_VAGOS, "Vocк nгo й um Sуcio Ouro !");
}
HouseInfo[House][hExitx] = 851.6885;
HouseInfo[House][hExity] = 1997.9625;
HouseInfo[House][hExitz] = 1011.0809;
HouseInfo[House][hInt] = 0;
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Interior setado para id 15.");
SalvarCasa(House);
}
}
GivePlayerMoney(playerid, -1000);
SBizzInfo[10][sbTill] += 200;
ExtortionSBiz(10, 200);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
GastarProdutos(2, 10, 7);
SalvarCasa(House);
return true;
}
else
{
return SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem uma casa");
}
}
stock SalvarCasa(houseid)
{
new files[75];
format(files, sizeof files, "/NacionalPlayer/Casas/Casa%d.ini", houseid);
if(DOF2_FileExists(files))
{
DOF2_SetString(files, "Dono",HouseInfo[houseid][hOwner]);
DOF2_SetInt(files, "Level", HouseInfo[houseid][hLevel]);
DOF2_SetFloat(files, "EntradaX", HouseInfo[houseid][hEntrancex]);
DOF2_SetFloat(files, "EntradaY", HouseInfo[houseid][hEntrancey]);
DOF2_SetFloat(files, "EntradaZ", HouseInfo[houseid][hEntrancez]);
DOF2_SetFloat(files, "SaidaX", HouseInfo[houseid][hExitx]);
DOF2_SetFloat(files, "SaidaY", HouseInfo[houseid][hExity]);
DOF2_SetFloat(files, "SaidaZ", HouseInfo[houseid][hExitz]);
DOF2_SetString(files, "Descricao",HouseInfo[houseid][hDiscription]);
DOF2_SetInt(files, "Valor", HouseInfo[houseid][hValue]);
DOF2_SetInt(files, "Interior", HouseInfo[houseid][hInt]);
DOF2_SetInt(filess, "Interior", HouseInfo[idx][hInt]);
DOF2_SetInt(files, "Vida", HouseInfo[houseid][hHel]);
DOF2_SetInt(files, "Colete", HouseInfo[houseid][hArm]);
DOF2_SetInt(files, "Trancada", HouseInfo[houseid][hLock]);
DOF2_SetInt(files, "Comprada", HouseInfo[houseid][hOwned]);
DOF2_SetInt(files, "Aluguel", HouseInfo[houseid][hRent]);
DOF2_SetInt(files, "Alugavel", HouseInfo[houseid][hRentabil]);
DOF2_SetInt(files, "CofreR", HouseInfo[houseid][hTakings]);
DOF2_SetInt(files, "Carro", HouseInfo[houseid][hVec]);
DOF2_SetInt(files, "Cor1", HouseInfo[houseid][hVcol1]);
DOF2_SetInt(files, "Cor2", HouseInfo[houseid][hVcol2]);
DOF2_SetInt(files, "VW", HouseInfo[houseid][hWorld]);
DOF2_SetInt(files, "Data", HouseInfo[houseid][hDate]);
DOF2_SetFloat(files, "hSpawnX", HouseInfo[houseid][hSpawnX]);
DOF2_SetFloat(files, "hSpawnY", HouseInfo[houseid][hSpawnY]);
DOF2_SetFloat(files, "hSpawnZ", HouseInfo[houseid][hSpawnZ]);
DOF2_SetFloat(files, "hSpawnA", HouseInfo[houseid][hSpawnA]);
DOF2_SetInt(files, "Ativa", HouseInfo[houseid][hAtiva]);
DOF2_SetInt(files, "HImposto", HouseInfo[houseid][hImposto]);
DOF2_SaveFile();
}
}