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;
}
}
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. |
if(HouseInfo[h][hOwned] == 1)
{
HouseInfo[h][hIcon] = CreatePickup(1239, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
Delete3DTextLabel(Text3D:housesale);
pickups++;
}
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;
}
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;
}
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;
}
if(strcmp(cmd, "/gmx", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid,0xFF0000FF,"[ ERRO ]{FFFFFF} Vocк Precisa Ser Nнvel 5 Para Usar Este Comando!");
SendClientMessageToAll(VERDECLARO, "O servidor foi Reiniciado. Aguarde carregando!");
SendRconCommand("gmx");
return 1;
}
public OnGameModeInit()
{//Abrir a public..
//Aqui й inserido os codigos e tudo o que se deve e quer(que se posa) nesta public
return 1;//Fecha a public.. 1=true 0=false
}//Fechar a public...
VINI: e vem ca quando vc estб morrendo e nгo da tempo de vc digitar nada como que vc digita /timestamp para fazer uma denuncia? Pq por min atй eu digita ja estou morto...
|
if (GetPlayerState(i) == 2)
{
SendClientMessage(playerid, colorX, "Bla bla");
}
else
{
SetPlayerHealth(playerid, 100);
}
if (GetPlayerState(i) == 2)
{
}//desnecesario
else//desnecesario
{//desnecesario
}
//Simplesmente ficaria
if (GetPlayerState(i) == 2)
{
}