06.05.2012, 12:13
Quote:
pawn Код:
|
pawn Код:
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)return SendClientMessage(playerid, COLOR_GREY, " Vocк ja tem uma empresa, Digite /venderemp para comprar outra.");
if(PlayerInfo[playerid][Vip] == 0)return SendClientMessage(playerid,-1,"Voce Nao e Vip"); //faltou aqui o "
if(PlayerInfo[playerid][Vip] >= 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]);
SendClientMessage(playerid, COLOR_GRAD5, string);
return true;
}
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);
SendClientMessage(playerid, COLOR_WHITE, "Parabens, Vocк comprou uma empresa.");
SendClientMessage(playerid, COLOR_WHITE, "Digite /ajudaemp para ver os comandos de sua empresa.");
Atualizar3Dtexts();
OnPropUpdate();
return true;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem grana suficiente");
return true;
}
}
}
}
}
return 1;
}