09.01.2011, 10:08
(
Last edited by cacauagiar; 10/01/2011 at 01:36 PM.
Reason: found how to do it but i need to fix somethings
)
ok this is a code to change the house interior when i enter the house it goes to the right interior but when i exit i go to another houses entrance, can anyone help me fix it?
here is the code (srry i dont know yet how to put on pwn code)
================================================== ================================
if (strcmp(cmd, "/changehouseint", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new House2 = PlayerInfo[playerid][pPHousekey];
GetPlayerName(playerid, playername, sizeof(playername));
if (House2 != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPHousekey]][hOwner], true) == 0)
{
new gunid[16];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "USE: /changehouseint [1-12]");
SendClientMessage(playerid, COLOR_GREEN,"_____________________________________ __");
SendClientMessage(playerid, COLOR_WHITE,"*** PRECO DAS CASAS R$100000 ***");
SendClientMessage(playerid, COLOR_GRAD2,string);
if(PlayerInfo[playerid][pLevel] >= 3)
{
SendClientMessage(playerid, COLOR_GRAD3, "_______________________________");
}
SendClientMessage(playerid, COLOR_GREEN,"_____________________________________ __");
return 1;
}
new gunid2;
gunid2 = strval(tmp);
if(gunid2 < 1 || gunid2 > 12)
{
SendClientMessage(playerid, COLOR_GREY, " Numeros de 1-12!");
return 1;
}
strmid(gunid, tmp, 0, strlen(cmdtext), 255);
if (GetPlayerMoneyEx(playerid) > 100000)
{
if(strcmp(gunid, "1", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
}*/
HouseInfo[House2][hExitx] = 225.630997;
HouseInfo[House2][hExity] = 1022.479980;
HouseInfo[House2][hExitz] = 1084.069946;
HouseInfo[House2][hInt] = 7;
}
else if(strcmp(gunid, "2", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 489.700012;
HouseInfo[House2][hExity] = 1402.500000;
HouseInfo[House2][hExitz] = 1080.199951;
HouseInfo[House2][hInt] = 2;
}
else if(strcmp(gunid, "3", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 2324.399902;
HouseInfo[House2][hExity] = -1147.500000;
HouseInfo[House2][hExitz] = 1050.699951;
HouseInfo[House2][hInt] = 12;
}
else if(strcmp(gunid, "4", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 2260.76;
HouseInfo[House2][hExity] = -1210.45;
HouseInfo[House2][hExitz] = 1049.02;
HouseInfo[House2][hInt] = 10;
}
else if(strcmp(gunid, "5", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 2496.65;
HouseInfo[House2][hExity] = -1696.55;
HouseInfo[House2][hExitz] = 1014.74;
HouseInfo[House2][hInt] = 3;
}
else if(strcmp(gunid, "6", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 1527.229980;
HouseInfo[House2][hExity] = -11.574499;
HouseInfo[House2][hExitz] = 1002.097106;
HouseInfo[House2][hInt] = 3;
}
else if(strcmp(gunid, "7", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 1523.509887;
HouseInfo[House2][hExity] = -47.821197;
HouseInfo[House2][hExitz] = 1002.130981;
HouseInfo[House2][hInt] = 2;
}
else if(strcmp(gunid, "8", true, strlen(gunid)) == 0)
{
if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Casa Apenas Para Vips !");
return 1;
}
HouseInfo[House2][hExitx] = 1267.663208;
HouseInfo[House2][hExity] = -781.323242;
HouseInfo[House2][hExitz] = 1091.906250 ;
HouseInfo[House2][hInt] = 5;
}
SendClientMessage(playerid, COLOR_GRAD6, "you changed you house interior");
GivePlayerMoneyEx(playerid,-100000);
SBizzInfo[6][sbTill] += 100000;
ExtortionSBiz(6, 100000);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " you dont have (R$100000)");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have a house");
return 1;
}
}
return 1;
}
here is the code (srry i dont know yet how to put on pwn code)
================================================== ================================
if (strcmp(cmd, "/changehouseint", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new House2 = PlayerInfo[playerid][pPHousekey];
GetPlayerName(playerid, playername, sizeof(playername));
if (House2 != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPHousekey]][hOwner], true) == 0)
{
new gunid[16];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), "USE: /changehouseint [1-12]");
SendClientMessage(playerid, COLOR_GREEN,"_____________________________________ __");
SendClientMessage(playerid, COLOR_WHITE,"*** PRECO DAS CASAS R$100000 ***");
SendClientMessage(playerid, COLOR_GRAD2,string);
if(PlayerInfo[playerid][pLevel] >= 3)
{
SendClientMessage(playerid, COLOR_GRAD3, "_______________________________");
}
SendClientMessage(playerid, COLOR_GREEN,"_____________________________________ __");
return 1;
}
new gunid2;
gunid2 = strval(tmp);
if(gunid2 < 1 || gunid2 > 12)
{
SendClientMessage(playerid, COLOR_GREY, " Numeros de 1-12!");
return 1;
}
strmid(gunid, tmp, 0, strlen(cmdtext), 255);
if (GetPlayerMoneyEx(playerid) > 100000)
{
if(strcmp(gunid, "1", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
}*/
HouseInfo[House2][hExitx] = 225.630997;
HouseInfo[House2][hExity] = 1022.479980;
HouseInfo[House2][hExitz] = 1084.069946;
HouseInfo[House2][hInt] = 7;
}
else if(strcmp(gunid, "2", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 489.700012;
HouseInfo[House2][hExity] = 1402.500000;
HouseInfo[House2][hExitz] = 1080.199951;
HouseInfo[House2][hInt] = 2;
}
else if(strcmp(gunid, "3", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 2324.399902;
HouseInfo[House2][hExity] = -1147.500000;
HouseInfo[House2][hExitz] = 1050.699951;
HouseInfo[House2][hInt] = 12;
}
else if(strcmp(gunid, "4", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 2260.76;
HouseInfo[House2][hExity] = -1210.45;
HouseInfo[House2][hExitz] = 1049.02;
HouseInfo[House2][hInt] = 10;
}
else if(strcmp(gunid, "5", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 2496.65;
HouseInfo[House2][hExity] = -1696.55;
HouseInfo[House2][hExitz] = 1014.74;
HouseInfo[House2][hInt] = 3;
}
else if(strcmp(gunid, "6", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 1527.229980;
HouseInfo[House2][hExity] = -11.574499;
HouseInfo[House2][hExitz] = 1002.097106;
HouseInfo[House2][hInt] = 3;
}
else if(strcmp(gunid, "7", true, strlen(gunid)) == 0)
{
/* if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й membro vip !");
return 1;
}*/
HouseInfo[House2][hExitx] = 1523.509887;
HouseInfo[House2][hExity] = -47.821197;
HouseInfo[House2][hExitz] = 1002.130981;
HouseInfo[House2][hInt] = 2;
}
else if(strcmp(gunid, "8", true, strlen(gunid)) == 0)
{
if(PlayerInfo[playerid][pVIP] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Casa Apenas Para Vips !");
return 1;
}
HouseInfo[House2][hExitx] = 1267.663208;
HouseInfo[House2][hExity] = -781.323242;
HouseInfo[House2][hExitz] = 1091.906250 ;
HouseInfo[House2][hInt] = 5;
}
SendClientMessage(playerid, COLOR_GRAD6, "you changed you house interior");
GivePlayerMoneyEx(playerid,-100000);
SBizzInfo[6][sbTill] += 100000;
ExtortionSBiz(6, 100000);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " you dont have (R$100000)");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have a house");
return 1;
}
}
return 1;
}