22.04.2012, 01:32
Quote:
E qual sistema de casas tem nessa base? nгo pera vou ver aki na bola de cristal
|
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 de no minimo nivel %d para comprar essa casa!", HouseInfo[h][hLevel]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return 1;
}
if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк jб possui uma casa, use /vendercasa se vocк quiser comprar essa!");
return 1;
}
if(GetPlayerMoneyEx(playerid) > HouseInfo[h][hValue])
{
PlayerInfo[playerid][pPhousekey] = h;
HouseInfo[h][hOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoneyEx(playerid,-HouseInfo[h][hValue]);
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,HouseInfo[h][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[h][hWorld]);
SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
GameTextForPlayer(playerid, "~w~Bem Vindo em casa~n~Voce pode sair a qualquer momento, movendo-se para a porta e digitando /sair", 5000, 3);
PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
PlayerInfo[playerid][pLocal] = h;
SendClientMessage(playerid, COLOR_WHITE, "Parabйns, pela sua nova compra!");
SendClientMessage(playerid, COLOR_WHITE, "Use /ajudacasa Para ver os comandos da casa!");
DateProp(playerid);
OnPropUpdate();
OnPlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк nгo possui essa grana!");
return 1;
}
}
}
}
return 1;
}
if(strcmp(cmd, "/alugarquarto", 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] == 1 && HouseInfo[h][hRentabil] == 1)
{
if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, " Vocк jб possui uma casa, use /vendercasa se vocк quiser alugar essa.");
return 1;
}
if(GetPlayerMoneyEx(playerid) > HouseInfo[h][hRent])
{
PlayerInfo[playerid][pPhousekey] = h;
GivePlayerMoneyEx(playerid,-HouseInfo[h][hRent]);
HouseInfo[h][hTakings] = HouseInfo[h][hTakings]+HouseInfo[h][hRent];
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,HouseInfo[h][hInt]);
SetPlayerVirtualWorld(playerid,HouseInfo[h][hWorld]);
SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
GameTextForPlayer(playerid, "~w~Bem Vindo em casa~n~Voce pode sair a qualquer momento, movendo-se para a porta e digitando /sair", 5000, 3);
PlayerInfo[playerid][pInt] = HouseInfo[h][hInt];
PlayerInfo[playerid][pLocal] = h;
SendClientMessage(playerid, COLOR_WHITE, "Parabйns, vocк pode entrar e sair a qualquer momento.");
SendClientMessage(playerid, COLOR_WHITE, "Use /ajudaaluguel Para ver os comandos de aluguel.");
OnPlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Vocк nгo possui essa grana");
return 1;
}
}
}
}
return 1;
}