CMD:water(playerid, params[])
{
for(new i=0; i<sizeof(WaterPos); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, WaterPos[i][0], WaterPos[i][1], WaterPos[i][2]))
{
new Float:health = GetPlayerHealth(playerid, health);
if(health == 100.0)
return SendClientMessage(playerid, FactColor[11], "You already have 100 health !");
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, FactColor[11], "You have been fully healed !");
}
else if(!IsPlayerInRangeOfPoint(playerid, 2, WaterPos[i][0], WaterPos[i][1], WaterPos[i][2]))
return SendClientMessage(playerid, FactColor[11], "You are not at the right place !");
}
return 1;
}
i will try when i will update my actual version of gamemode
|
First show us . WaterPos[i][] main lines. I mean points.
Second, PHP код:
Third Did you define FactColor[11] perfectly? fourth Nevermind forgot ! |
new const FactColor[] =
{
0xFFE4C4FF, 0x0000FFFF, 0x7B68EE0FF, 0x00008BFF, 0xF9526BFF,
0x778899FF, 0xFFF46EFF, 0x008000FF, 0x800080FF, 0xFFFF00FF,
0x00FFFFFF, 0xFFA343FF, 0x00FF00FF, 0xFF69B4FF, 0x660000FF
};
new Float:WaterPos[][] =
{
{ 252.1506,111.4887,1003.2188 },
{ 270.2978,186.2076,1008.1719 },
{ 249.6548,196.7341,1008.1719 },
{ 257.9287,196.7354,1008.1719 },
{ 229.1164,155.1423,1003.0234 },
{ 227.3604,143.4446,1003.0234 },
{ 231.3758,180.2250,1003.0313 },
{ 227.3651,184.3604,1003.0313 },
{ 1496.2740,1304.3014,1093.2891 },
{ 1249.1284,5.7868,1008.2578 },
{ 754.9944,-40.5415,1000.5859 }
};
CMD:water(playerid, params[])
{
for(new i = 0; i < sizeof(WaterPos); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, WaterPos[i][0], WaterPos[i][1], WaterPos[i][2]))
{
new Float:health = GetPlayerHealth(playerid, health);
if(health == 100.0) return SendClientMessage(playerid, FactColor[11], "You already have 100 health !");
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, FactColor[11], "You have been fully healed !");
return 1;
}
}
return SendClientMessage(playerid, FactColor[11], "You are not at the right place !");
}
new Float:WaterPos[11][3] =
{
{ 252.1506,111.4887,1003.2188 },
{ 270.2978,186.2076,1008.1719 },
{ 249.6548,196.7341,1008.1719 },
{ 257.9287,196.7354,1008.1719 },
{ 229.1164,155.1423,1003.0234 },
{ 227.3604,143.4446,1003.0234 },
{ 231.3758,180.2250,1003.0313 },
{ 227.3651,184.3604,1003.0313 },
{ 1496.2740,1304.3014,1093.2891 },
{ 1249.1284,5.7868,1008.2578 },
{ 754.9944,-40.5415,1000.5859 }
};
|
Try this:
Код:
CMD:water(playerid, params[])
{
for(new i = 0; i < sizeof(WaterPos); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, WaterPos[i][0], WaterPos[i][1], WaterPos[i][2]))
{
new Float:health = GetPlayerHealth(playerid, health);
if(health == 100.0) return SendClientMessage(playerid, FactColor[11], "You already have 100 health !");
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, FactColor[11], "You have been fully healed !");
return 1;
}
}
return SendClientMessage(playerid, FactColor[11], "You are not at the right place !");
}
new Float:WaterPos[11][3] =
{
{ 252.1506,111.4887,1003.2188 },
{ 270.2978,186.2076,1008.1719 },
{ 249.6548,196.7341,1008.1719 },
{ 257.9287,196.7354,1008.1719 },
{ 229.1164,155.1423,1003.0234 },
{ 227.3604,143.4446,1003.0234 },
{ 231.3758,180.2250,1003.0313 },
{ 227.3651,184.3604,1003.0313 },
{ 1496.2740,1304.3014,1093.2891 },
{ 1249.1284,5.7868,1008.2578 },
{ 754.9944,-40.5415,1000.5859 }
};
|