01.12.2017, 17:34
PHP код:
enum mpInfo {
mpObjc,
Float:mpPos[3]
};
new Float:Mecanicos[][mpInfo] = {
{-1, {299.27261, 1423.04456, 8.71771}},
{-1, {294.43201, 1393.79041, 9.17888}},
{-1, {314.09689, 1410.77551, 7.35632}},
{-1, {308.55414, 1385.33337, 8.15589}}
};
public OnGameModeInit()
{
for(new i = 0; i < sizeof(Mecanicos); i++)
{
Mecanicos[i][mpObjc] = CreateObject(745, Mecanicos[i][mpPos][0], Mecanicos[i][mpPos][1], Mecanicos[i][mpPos][2], 0.00000, 0.00000, 0.00000);
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_YES)
{
for(new i = 0; i < sizeof(Mecanicos); i++)
{
if(IsValidObject(Mecanicos[i][mpObjc])) //checar se a pedra existe
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, Mecanicos[i][mpPos][0], Mecanicos[i][mpPos][1], Mecanicos[i][mpPos][2]))
{
SendClientMessage(playerid, -1, "Vocк esta no raio de uma das pedras");
DestroyObject(Mecanicos[i][mpObjc]);
Mecanicos[i][mpObjc] = -1; //por seguranзa resetar a variбvel (evitar conflito de IDs)
return 1;
}
}
}
}
return 1;
}