#include <a_samp>
#define MAX_ARVORES sizeof(Arvores)
new Float:Arvores[5][3] =
{
{1958.3783, 1343.1572, 15.3746},
{1958.6980,1338.9100,16.0142},
{1952.4622,1344.7861,15.3672},
{1960.2061,1345.3385,15.3746},
{1953.2571,1339.7231,15.3746}
};
new Bateu[MAX_PLAYERS] = 0;
new ObjetoArvore[MAX_ARVORES];
public OnGameModeInit()
{
for(new i = 1; i <= MAX_ARVORES; i++)
{
ObjetoArvore[i] = CreateObject(702, Arvores[i][0], Arvores[i][1], Arvores[i][2], 90, 0, 90);
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys && KEY_FIRE)
{
for(new i = 1; i <= MAX_ARVORES; i++)
if(IsPlayerInRangeOfPoint(playerid, 1.0, Arvores[i][0], Arvores[i][1], Arvores[i][2]))
{
Bateu[playerid]++;
PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
if(Bateu[playerid] == 15)
{
Bateu[playerid] = 0;
DestroyObject(ObjetoArvore[i]);
Arvores[i][0] = -1;
Arvores[i][1] = -1;
Arvores[i][2] = -1;
}
}
}
return 1;
}
new Bateu[MAX_PLAYERS] = 0;
new Bateu[MAX_ARVORES];
Bateu[playerid]
Bateu[i]
Troque:
PHP код:
PHP код:
PHP код:
PHP код:
|