06.10.2014, 06:46
I'm creating a drug system and when I type /growweed in-game, it returns "You can only plant weed seeds in the bush across from All Saints General Hospital and the inner skirts of Flint Country by the Flint gas station!", even when I am at these points (standing exactly on the point as well) it still sends me this message.
Please help me, I'm not sure what I'm doing wrong. Thanks!
pawn Код:
CMD:growweed(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 30, 1232.2, -1344.3, 14.13) && IsPlayerInRangeOfPoint(playerid, 400, -395, -1338.3, 25.3))
{
if(PlayerStat[playerid][HasWeedSeeds] > 0)
{
new string[128], Float:x, Float:y, Float:z,Float:Angle;
GetPlayerPos(playerid, x,y,z);
GetPlayerFacingAngle(playerid, Angle);
CreateObject(playerid, 823, x, y, z, Angle, Angle, Angle);
format(string, sizeof(string), "%s kneels down and plants some weed seeds.", GetICName(playerid));
SendNearByMessage(playerid, ACTION_COLOR, string, 6);
SendClientMessage(playerid, GREEN, "You have planted marijuana bush, please come back later to harvest it!");
SendClientMessage(playerid, GREEN, "Be careful other players do not take your weed, so keep a close eye on it!");
PlayerStat[playerid][HasWeedSeeds] = 0;
}
else
{
SendClientMessage(playerid, GREY, "You don't have any weed seeds!");
}
}
else
{
SendClientMessage(playerid, GREY, "You can only plant weed seeds in the bush across from All Saints General Hospital");
SendClientMessage(playerid, GREY, "and the inner skirts of Flint Country by the Flint gas station!");
}
return 1;
}