27.07.2011, 11:52
Bom estou com 2 probleminhas que de vez nгo consigo mesmo resolver o 1° й da Empresa, Viniborn me disse para colocar a public CustomPickups em OnGameModeInit, sу que atualmente ele da Erros, ele me disse que o codigo estб sem problemas, antes quando estava em Gametextforplayer mostrava normalmente depois que mudei para a Label estб com esses probleminhas....
Quando vendi a empresa e dei GMX bugou tudo como vocк pode ver o PRINT acima nгo mostra mais informaзхes e nada, agora atualmente quando tirei os Veiculos HouseCarSpawns parece que nгo estб mais mostrando o Login Box, e quando vocк clica em spawn BUGA.
GMX
pawn Код:
public CustomPickups()
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, oldposx, oldposy, oldposz);
new tmpcar = GetPlayerVehicleID(i);
if(oldposx!=0.0 && oldposy!=0.0 && oldposz!=0.0)
{
for(new h = 0; h < sizeof(SBizzInfo); h++)
{
if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]))
{
format(string, sizeof(string), "~w~%s~n~~r~Produtos Requeridos:~w~%d~n~w~Preco por Produto: ~r~R$%d~n~~g~Fundos: ~w~R$%d",SBizzInfo[h][sbMessage],(SBizzInfo[h][sbMaxProducts]-SBizzInfo[h][sbProducts]),SBizzInfo[h][sbPriceProd],SBizzInfo[h][sbTill]);
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
if(SBizzInfo[h][sbOwned] == 1)
{
format(string, sizeof(string), "%s\nProprietбrio: %s\nSуcio/Extorзгo: %s\nTaxa de Entrada:R$%d\nLevel: %d\nEntrada /entrar",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost],SBizzInfo[h][sbLevelNeeded]);
Create3DTextLabel(string, COLOR_LIGHTGREEN, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ],60,0,1);
}
if(SBizzInfo[h][sbOwned] == 0)
{
format(string, sizeof(string), "%s\nPreзo: R$%d\nLevel: %d \nComprar /comprarempresa",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]);
Create3DTextLabel(string, COLOR_LIGHTGREEN, SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ],60,0,1);
}
}
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 1)
{
if(HouseInfo[h][hRentabil] == 0)
{
format(string, sizeof(string), "Proprietбrio da Casa: %s\nLevel: %d",HouseInfo[h] [hOwner],HouseInfo[h][hLevel]);
Create3DTextLabel(string,COLOR_WHITE,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,40,0,1);
//Create3DTextLabel(texto[],cor,coord: X,coord:Y,coord,Z,distancia mбxima que pode vizualizar o texto,virtual world,se podemos ver o texto atraves de objetos);
//mais detalhes sobre esta funзгo procura na sa-mp wiki
}
else if(HouseInfo[h][hRentabil] == 1)
{
format(string, sizeof(string), "Proprietбrio da Casa: %s\nAluguel: R$%d - Level: %d\nPara /alugarquarto",HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
Create3DTextLabel(string,COLOR_WHITE,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,40,0,1);
}
}
else if(HouseInfo[h][hOwned] == 0)
{
format(string, sizeof(string), "%s\nPreзo: R$%d - Level : %d\nPara /comprarcasa",HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
Create3DTextLabel(string,COLOR_WHITE,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.75,40,0,1);
}
}
for(new h = 0; h < sizeof(BizzInfo); h++)
{
if(IsATruck(tmpcar) && PlayerToPoint(10.0, i, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]))
{
format(string, sizeof(string), "~w~%s~n~~r~Produtos Requeridos:~w~%d~n~w~Preco por Produto: ~r~R$%d~n~~g~Fundos: ~w~R$%d",BizzInfo[h][bMessage],(BizzInfo[h][bMaxProducts]-BizzInfo[h][bProducts]),BizzInfo[h][bPriceProd],BizzInfo[h][bTill]);
GameTextForPlayer(i, string, 5000, 3);
return 1;
}
if(BizzInfo[h][bOwned] == 1)
{
format(string, sizeof(string), "%s\nProprietбrio: %s\nSуcio: %s\nTaxa de Entrada:R$%d - Level: %d\nPara /entrar",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bEntranceCost],BizzInfo[h][bLevelNeeded]);
Create3DTextLabel(string, COLOR_LIGHTGREEN, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], 15,0);
}
if(BizzInfo[h][bOwned] == 0)
{
format(string, sizeof(string), "%s\nPreзo: R$%d - Level: %d \nPara /comprarempresa",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]);
Create3DTextLabel(string, COLOR_LIGHTGREEN, BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ], 15,0);
}
return 1;
}
}
Quote:
De acordo com isso, suas propriedades que nгo estгo а venda, nгo tem нcones. Vб em uma empresa bugada venda-a, reinicie o servidor , e veja se o нcone apareceu. |
pawn Код:
if(HouseInfo[h][hOwned] == 1)
{
HouseInfo[h][hIcon] = CreatePickup(1239, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
Delete3DTextLabel(Text3D:housesale);
pickups++;
}
pawn Код:
forward OnPropUpdate();
if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
//DP portinha
new sendername[MAX_PLAYER_NAME];
new string[256];
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;
}
else
{
GameTextForPlayer(playerid, "~r~trancado", 5000, 1);
}
}
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
if(!IsACop(playerid) && i == 3)
{
SendClientMessage(playerid, COLOR_GREY, " Somente policiais !");
return 1;
}
if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerGP(playerid) >= BizzInfo[i][bEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(BizzInfo[i][bLocked] == 1)
{
GameTextForPlayer(playerid, "~r~fechado", 5000, 1);
return 1;
}
if(BizzInfo[i][bProducts] == 0)
{
GameTextForPlayer(playerid, "~r~fim de estoque", 5000, 1);
return 1;
}
GivePlayerGP(playerid,-BizzInfo[i][bEntranceCost]);
format(string, sizeof(string), "~r~R$ %d~n~~w~digite /sair~n~para sair", BizzInfo[i][bEntranceCost]);
BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
BizzInfo[i][bProducts]--;
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);
//PlayerInfo[playerid][pLocal] = i;
}
else
{
GameTextForPlayer(playerid, "~r~dinheiro insuficiente", 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 || GetPlayerGP(playerid) >= SBizzInfo[i][sbEntranceCost])
{
if(PlayerInfo[playerid][pPbiskey] != i)
{
if(SBizzInfo[i][sbLocked] == 1)
{
GameTextForPlayer(playerid, "~r~trancado", 5000, 1);
return 1;
}
if(SBizzInfo[i][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~fim de estoque", 5000, 1);
return 1;
}
if(i == 10)
{
PaintballPlayers ++;
PlayerPaintballing[playerid] = 1;
new rand = random(sizeof(PaintballSpawns));
SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
TogglePlayerControllable(playerid, 0);
}
else if(i == 11)
{
PlayerKarting[playerid] = 1;
SendClientMessage(playerid, TEAM_GROVE_COLOR, "Vocк pode participar agora da corrida de Kart.");
}
else
{
return 1;
}
GivePlayerGP(playerid,-SBizzInfo[i][sbEntranceCost]);
gSpentCash[playerid] = GetPlayerGP(playerid);
SBizzInfo[i][sbProducts]--;
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 pagou R$ %d para entrar na sbiz %d", dood, SBizzInfo[i][sbEntranceCost], i);
printf("%s", string);
PayLog(string);
OnPropUpdate();
}
}
else
{
GameTextForPlayer(playerid, "~r~dinheiro insuficiente", 5000, 1);
}
}
}
pawn Code:
public DateProp(playerid)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
new curdate = getdate();
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if (strcmp(playername, HouseInfo[h][hOwner], true) == 0)
{
HouseInfo[h][hDate] = curdate;
OnPropUpdate();
}
}
return 1;
}
pawn Код:
public OnPropUpdate()
{
new idx;
new File: file2;
while (idx < sizeof(HouseInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%f,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
HouseInfo[idx][hEntrancex],
HouseInfo[idx][hEntrancey],
HouseInfo[idx][hEntrancez],
HouseInfo[idx][hExitx],
HouseInfo[idx][hExity],
HouseInfo[idx][hExitz],
HouseInfo[idx][hHealthx],
HouseInfo[idx][hHealthy],
HouseInfo[idx][hHealthz],
HouseInfo[idx][hArmourx],
HouseInfo[idx][hArmoury],
HouseInfo[idx][hArmourz],
HouseInfo[idx][hOwner],
HouseInfo[idx][hDiscription],
HouseInfo[idx][hValue],
HouseInfo[idx][hHel],
HouseInfo[idx][hArm],
HouseInfo[idx][hInt],
HouseInfo[idx][hLock],
HouseInfo[idx][hOwned],
HouseInfo[idx][hRooms],
HouseInfo[idx][hRent],
HouseInfo[idx][hRentabil],
HouseInfo[idx][hTakings],
HouseInfo[idx][hVec],
HouseInfo[idx][hVcol1],
HouseInfo[idx][hVcol2],
HouseInfo[idx][hDate],
HouseInfo[idx][hLevel],
HouseInfo[idx][hWorld]);
if(idx == 0)
{
file2 = fopen("Cfg/property.cfg", io_write);
}
else
{
file2 = fopen("Cfg/property.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
idx = 0;
while (idx < sizeof(BizzInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d|%s|%s|%s|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
BizzInfo[idx][bOwned],
BizzInfo[idx][bOwner],
BizzInfo[idx][bMessage],
BizzInfo[idx][bExtortion],
BizzInfo[idx][bEntranceX],
BizzInfo[idx][bEntranceY],
BizzInfo[idx][bEntranceZ],
BizzInfo[idx][bExitX],
BizzInfo[idx][bExitY],
BizzInfo[idx][bExitZ],
BizzInfo[idx][bLevelNeeded],
BizzInfo[idx][bBuyPrice],
BizzInfo[idx][bEntranceCost],
BizzInfo[idx][bTill],
BizzInfo[idx][bLocked],
BizzInfo[idx][bInterior],
BizzInfo[idx][bProducts],
BizzInfo[idx][bMaxProducts],
BizzInfo[idx][bPriceProd]);
if(idx == 0)
{
file2 = fopen("Cfg/bizz.cfg", io_write);
}
else
{
file2 = fopen("Cfg/bizz.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
idx = 0;
while (idx < sizeof(SBizzInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d|%s|%s|%s|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
SBizzInfo[idx][sbOwned],
SBizzInfo[idx][sbOwner],
SBizzInfo[idx][sbMessage],
SBizzInfo[idx][sbExtortion],
SBizzInfo[idx][sbEntranceX],
SBizzInfo[idx][sbEntranceY],
SBizzInfo[idx][sbEntranceZ],
SBizzInfo[idx][sbLevelNeeded],
SBizzInfo[idx][sbBuyPrice],
SBizzInfo[idx][sbEntranceCost],
SBizzInfo[idx][sbTill],
SBizzInfo[idx][sbLocked],
SBizzInfo[idx][sbInterior],
SBizzInfo[idx][sbProducts],
SBizzInfo[idx][sbMaxProducts],
SBizzInfo[idx][sbPriceProd]);
if(idx == 0)
{
file2 = fopen("Cfg/sbizz.cfg", io_write);
}
else
{
file2 = fopen("Cfg/sbizz.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/gmx", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 4000)
{
SendClientMessageToAll(VERDECLARO, "O servidor foi Reiniciado. Aguarde carregando!");
GameModeExit();
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem permissгo para usar este comando!");
}
}
return 1;
}