05.05.2015, 12:25
Dear Peopel of the internet,
I thank you in advance for your help
very simple little piece of script here what it should do is detect if you are near X object
and then if you have a knife in hand
will let you cut the tree and gather wood
For the life of me cant get it to work, seems to think you are never near the item in game ; (
Where am i going wrong?
<3 Duke
I thank you in advance for your help
very simple little piece of script here what it should do is detect if you are near X object
and then if you have a knife in hand
will let you cut the tree and gather wood
For the life of me cant get it to work, seems to think you are never near the item in game ; (
Where am i going wrong?
<3 Duke
Код:
CMD:cuttree(playerid, params[]) { if(IsPlayerConnected(playerid)) { if(GetPlayerWeapon(playerid) == 4) { if(IsPlayerNearObject(playerid, 837, 10.0)) { GameTextForPlayer(playerid, "CUTTING DOWN TREE", 3500, 5); new string[158]; new sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "%s takes out their Hatchet and starts to cut down the tree for wood", sendername); ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN); AccountInfo[playerid][pWood] += 4; } else return SendClientMessage(playerid, RED, "[Database:]{FFFFFF} You are not near any cuttable trees, please look for forests."); } else return SendClientMessage(playerid, RED, "[Database:]{FFFFFF} You cannot cut down any trees, you do not have a Hatchet"); } return 1; }