25.03.2019, 19:11
Quote:
PHP код:
MAX_PLANTACOES vocк informa o nъmero de plantaзхes que terб. static const Float:Plantacoes[3] vocк vai colocando a posiзгo X, Y e Z de cada plantaзгo. Sу ir no seu servidor, ir dando /save e colocar as posiзхes corretamente nessa variбvel. Os 3DText sгo carregados no OnGameModeInit, se vocк quiser mudar a cor do texto, colocar viadagens e etc. |
PHP код:
if(strcmp("/plantarmaconha", cmdtext, true, 10) == 0)
{
if(PlayerLeo[playerid][Profissao] != FAZENDEIRO) {
SendClientMessage(playerid, COR_ERRO, "| ERRO | Vocк nгo й um fazendeiro");
return 1;
}
if(PlayerLeo[playerid][Sementes] <= 2) {
SendClientMessage(playerid, COR_ERRO, "| ERRO | Vocк nгo tem sementes o suficiente para plantar maconha (2 Sementes necessбrias)");
return 1;
}
if(Plantando[playerid] == 1) {
SendClientMessage(playerid, COR_ERRO, "| ERRO | Jб comeзou a plantar espere atй crescer para plantar novamente.");
return 1;
}
for(new i = 0; i < sizeof(PosicaoPlantacao); i ++)
{
if(IsPlayerInRangeOfPoint(playerid, 1, PosicaoPlantacao[i][posX], PosicaoPlantacao[i][posY], PosicaoPlantacao[i][posZ]))
{
new string[128];
SendClientMessage(playerid, -1, "| INFO | Vocк comeзou a plantar maconha, espere atй crescer e colha.");
ApplyAnimation(playerid,"BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 32000, 1);
ApplyAnimation(playerid,"BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 32000, 1);
PlayerLeo[playerid][Sementes] -= 2;
Plantando[playerid] = 1;
Colher[playerid] = 1;
Colhido[playerid] = 0;
SetTimerEx("Plantar1", 30000, false, "i", playerid);
return 1;
}
}
}