20.04.2014, 16:50
I have changed all my code..
But when i plant more of one, when i try to pickweed only works on one that i have planted, why
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#include "registration_system.pwn"
#define MAX_WEED 1000
#define MAX_WEED_PER_PLAYER 3
#define LIBRARY "BOMBER"
#define ANIMATION "BOM_Plant_Crouch_In"
enum piantainfo
{
Float:poswx,
Float:poswy,
Float:poswz
}
new winfo[MAX_WEED][piantainfo];
new mariaobject[MAX_WEED];
new contopiante;
CMD:plantseed(playerid,params[])
{
if(pinfo[playerid][seeds] < 5) return SendClientMessage(playerid,-1,"[SERVER]You havn't sufficient seeds for plant");
new id = contopiante;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
winfo[id][poswx] = x;
winfo[id][poswy] = y;
winfo[id][poswz] = z;
mariaobject[id] = CreateObject(3409,x,y,z,0.0,0.0,0.0,100);
contopiante++;
return 1;
}
CMD:pickweed(playerid,params[])
{
for(new i = 0; i < MAX_WEED; i++)
{
if(IsPlayerInRangeOfPoint(playerid,3.0,winfo[i][poswx],winfo[i][poswy],winfo[i][poswz]))
{
DestroyObject(mariaobject[i]);
}
else
{
return 0;
}
}
return 1;
}
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif