28.07.2011, 11:12
Bom estou com alguns problemas em algumas relaзхes, queria arrumar o contrato dos Hitmans que estб um pouco Bugado e a empresa e o GMX, acho que isso seria uma grande ajuda, sempre eu reavalio os codigos, e aprendo mais, se puder me ajudar agradeзo..
APROVEITANDO O TУPICO QUERO PEDIR AJUDA PARA COLOCAR TEXTO ACIMA DA CABEЗA DO ADMINISTRADOR QUANDO ELE ESTБ TRABALHANDO E SAI DEPOIS QUE ELE SAI DO TRABALHO, E PARA VIPS, ENCIMA DA CEBAЗA DELES ESCRITO, VIP %s, Se puder me ajudar nisso tambem agradeзo..
Acho que atualmente o BUG no GMX й por causa desse seguinte codigo.
NГO RESPONDA PRA GANHAR POSTS MAIS SIM PARA AJUDAR.. '-'
APROVEITANDO O TУPICO QUERO PEDIR AJUDA PARA COLOCAR TEXTO ACIMA DA CABEЗA DO ADMINISTRADOR QUANDO ELE ESTБ TRABALHANDO E SAI DEPOIS QUE ELE SAI DO TRABALHO, E PARA VIPS, ENCIMA DA CEBAЗA DELES ESCRITO, VIP %s, Se puder me ajudar nisso tambem agradeзo..
pawn Код:
if(strcmp(cmd,"/laptop",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
{
if(ConnectedToPC[playerid] == 255)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк desligou seu Laptop, e desconectou da Agкncia.");
ConnectedToPC[playerid] = 0;
return 1;
}
new mtext[20];
new year, month,day;
getdate(year, month, day);
if(month == 1) { mtext = "Janeiro"; }
else if(month == 2) { mtext = "Fevereiro"; }
else if(month == 3) { mtext = "Marзo"; }
else if(month == 4) { mtext = "Abril"; }
else if(month == 5) { mtext = "Maio"; }
else if(month == 6) { mtext = "Junho"; }
else if(month == 7) { mtext = "Julho"; }
else if(month == 8) { mtext = "Agosto"; }
else if(month == 9) { mtext = "Setembro"; }
else if(month == 10) { mtext = "Outubro"; }
else if(month == 11) { mtext = "Novembro"; }
else if(month == 12) { mtext = "Dezembro"; }
new hour,minuite,second;
gettime(hour,minuite,second);
FixHour(hour);
hour = shifthour;
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк abriu seu Laptop, e conectou а Agкncia.");
SendClientMessage(playerid, COLOR_WHITE, "|-Agкncia Assassino-|");
SendClientMessage(playerid, COLOR_WHITE, "Noticias: ");
SendClientMessage(playerid, COLOR_WHITE, "Contratos:");
SendClientMessage(playerid, COLOR_WHITE, "Atribuir:");
SendClientMessage(playerid, COLOR_WHITE, "Cargos:");
SendClientMessage(playerid, COLOR_WHITE, "Logout:");
format(string, sizeof(string), "Mкs: %s | Dia: %d | Hora: %d:%d |", mtext, day, hour+1, minuite);
SendClientMessage(playerid, COLOR_WHITE, string);
ConnectedToPC[playerid] = 255;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um Hitman!");
return 1;
}
}
return 1;
}
Quote:
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.... |
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:
ViniBorn: 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. |
Quote:
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. |
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;
}
Quote:
if (GetPlayerState(i) == 2) { } else { } |
Quote:
SetVehiclePos(tmpcar, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]); SetVehicleZAngle(tmpcar, HouseCarSpawns[tmpcar-1][3]); |
pawn Код:
if(PlayerInfo[i][pLocal] != 255 && PlayerInfo[i][pInt] != 0)
{
new house = PlayerInfo[i][pLocal];
GetPlayerPos(i, oldposx, oldposy, oldposz);
if(oldposz != 0.0)
{
if(oldposz < 600.0)
{
if(house > 10000)
{
new tmpcar = GetPlayerVehicleID(i);
if (!PlayerToPoint(6, i,1040.6,-1021.0,31.7) && house == 10001 ||!PlayerToPoint(6, i,-2720.5,217.5,4.1) && house == 10002 ||!PlayerToPoint(6, i,2644.6,-2044.9,13.3) && house == 10003)
{
if (GetPlayerState(i) == 2)
{
SetVehiclePos(tmpcar, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]);
SetVehicleZAngle(tmpcar, HouseCarSpawns[tmpcar-1][3]);
}
else
{
SetPlayerPos(i, HouseCarSpawns[tmpcar-1][0], HouseCarSpawns[tmpcar-1][1], HouseCarSpawns[tmpcar-1][2]);
}
new oldcash = gSpentCash[i];
new Total = GetPlayerGP(i) - oldcash;
printf("Total %d = GetPlayerGP(playerid) %d - oldcash %d",Total,GetPlayerGP(i),oldcash);
new name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(string,128,"<< %s saiu do HomeModShop com R$ %d >>",name,Total);
PayLog(string);
gSpentCash[i] = 0;
TelePos[i][0] = 0.0;
TelePos[i][1] = 0.0;
PlayerInfo[i][pLocal] = 255;
SetPlayerInterior(i,0);
PlayerInfo[i][pInt] = 0;
Spectate[i] = 255;
}
}