25.01.2015, 15:26
I want to creating Lumberjack system with tree growing when cutted, but in CMd i can't set return for tree cutted.
Ex : 30 tree is cutted and growing, they return when using CMD. In my CMD now can't do that. I don't know why, if (i) = another number without cutted tree number, they send return message but still got marker. I want to return message only for total max tree cutted (30) can display this return message. Anyone can help me !
Ex : 30 tree is cutted and growing, they return when using CMD. In my CMD now can't do that. I don't know why, if (i) = another number without cutted tree number, they send return message but still got marker. I want to return message only for total max tree cutted (30) can display this return message. Anyone can help me !
PHP код:
CMD:lcut(playerid, params[])
{
if(PlayerInfo[playerid][pJob] == 5 || PlayerInfo[playerid][pJob2] == 5)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsALumberJackCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
for(new i = 1; i < 30; i++)
{
if(TreeCutted[i] == 0)
{
new Float:x, Float:y, Float:z;
GetDynamicObjectPos(Tree[i], x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 3);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_LUMBERJACK;
SetPVarInt(playerid, "TreeID", i);
Lumberjackcar[playerid] = vehicleid;
GameTextForPlayer(playerid, "~w~Just go on ~r~marker~w~ .", 6000, 5);
}
else return SendClientMessageEx(playerid, COLOR_GREY, "Tree is growing!");
}
}
}
return 1;
}