25.03.2019, 13:56
PHP код:
#define MAX_PLANTACOES 2
static const Float:Plantacoes[3][MAX_PLANTACOES] = {
{0.0, 0.0, 0.0}, // X, Y, Z
{0.0, 0.0, 0.0}
}
public OnGameModeInit() {
new string[20];
for(new i = 0; i < MAX_PLANTACOES; ++i) {
format(string, 20, "Plantaзгo ID: %d", i);
Create3DTextLabel(string, 0xFFFFFFFF, Plantacoes[i][0], Plantacoes[i][1], Plantacoes[i][2], 20.0, 0);
}
return 1;
}
IsPlayerInPlantation(playerid) {
for(new i = 0; i < MAX_PLANTACOES; ++i) {
if(IsPlayerInRangeOfPoint(playerid, 5.0, Plantacoes[i][0], Plantacoes[i][1], Plantacoes[i][2]))
return i;
}
return -1;
}
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.