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;
}
if(IsPlayerInRangeOfPoint(playerid, 30, 1232.2, -1344.3, 14.13) && IsPlayerInRangeOfPoint(playerid, 400, -395, -1338.3, 25.3))
if(IsPlayerInRangeOfPoint(playerid, 30, 1232.2, -1344.3, 14.13) || IsPlayerInRangeOfPoint(playerid, 400, -395, -1338.3, 25.3))
new string[128], Float
![]() GetPlayerPos(playerid, x,y,z); GetPlayerFacingAngle(playerid, Angle); CreateObject(playerid, 823, x, y, z, Angle, Angle, Angle); u didn't add co-ordinates where to plant seed get co-ords add them and than try might fix this issue... |
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);
Thats wrong;
Код:
if(IsPlayerInRangeOfPoint(playerid, 30, 1232.2, -1344.3, 14.13) && IsPlayerInRangeOfPoint(playerid, 400, -395, -1338.3, 25.3)) Use the OR statement. Код:
if(IsPlayerInRangeOfPoint(playerid, 30, 1232.2, -1344.3, 14.13) || IsPlayerInRangeOfPoint(playerid, 400, -395, -1338.3, 25.3)) |
CMD:agiveseeds(playerid, params[])
{
new targetid, string[128], amount;
if(PlayerStat[playerid] [AdminLevel] < 2) return SendClientMessage(playerid, GREY, "You don't have access to this command!");
if(sscanf(params, "ud", targetid, amount)) return SendClientMessage(playerid, GREY, "USAGE: /agiveseeds [playerid] [amount]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, "That player is not connected!");
else
{
PlayerStat[targetid][HasWeed] = amount;
format(string, sizeof(string), "You have given %s %d weed seed(s)!", GetOOCName(targetid), amount);
SendClientMessage(playerid, WHITE, string);
format(string, sizeof(string), "Administrator %s has given you %d weed seeds(s)!", GetOOCName(playerid), amount);
SendClientMessage(targetid, WHITE, string);
AdminActionLog(string);
}
return 1;
}