try fixing this fuction[pro's only] -
Abhishek. - 14.08.2012
pawn Код:
#include <a_samp>
#define MAX_OBJECTER 10000
#define VIEW_DISTANCE 10.0
new Object_Table[MAX_OBJECTER];
enum objecter{
obid,
Float:X,
Float:Y,
Float:Z,
Float:rX,
Float:ry,
};
new ObjectFactry[MAX_OBJECTER][objecter];
stock CreateObjector(Objectid,Float:X,Float:Y,Float:Z,Float:rX,Float:rY,Float:rZ);
{
new objecting_index = 0;
objecting_index++;
ObjectFactry[objecting_index][0] = objectid;
ObjectFactry[objecting_index][1] = X;
ObjectFactry[objecting_index][2] = Y;
ObjectFactry[objecting_index][3] = Z;
ObjectFactry[objecting_index][4] = rX;
ObjectFactry[objecting_index][5] = rY;
ObjectFactry[objecting_index][6] = rZ;
return 0;
}
public OnPlayerConnect(playerid)
{
SetTimer("Makeing",1000,1);
return 1;
}
forward Makeing(playerid);
public Makeing(playerid)
{
new Float:X,Float:Y,Float:Z;
GetPlayerpos(playerid,X,Y,Z);
for(new i=0;i<=MAX_OBJECTER;;i++)
{
if(IsPlayerInRangeOfPoint(playerid,VIEW_DISTANCE,ObjectFactry[i][1],ObjectFactry[i][2],ObjectFactry[i][3])
{
Object_Table[i]=CreateObject(ObjectFactry[i][0],ObjectFactry[i][1],ObjectFactry[i][2],ObjectFactry[i][3],ObjectFactry[i][4],ObjectFactry[i][5],ObjectFactry[i][6],VIEW_DISTANCE);
}
if(GetPlayerDistanceFromPoint(playerid,ObjectFactry[i][1],ObjectFactry[i][2],ObjectFactry[i][3] > VIEW_DISTANCE))
{
DestroyObject(Object_Table[i]);
}
}
return 1;
}
Error's:
Код:
G:\C\sa\filterscripts\Objector.pwn(33) : warning 219: local variable "X" shadows a variable at a preceding level
G:\C\sa\filterscripts\Objector.pwn(33) : warning 219: local variable "Y" shadows a variable at a preceding level
G:\C\sa\filterscripts\Objector.pwn(33) : warning 219: local variable "Z" shadows a variable at a preceding level
G:\C\sa\filterscripts\Objector.pwn(33) : warning 219: local variable "rX" shadows a variable at a preceding level
G:\C\sa\filterscripts\Objector.pwn(34) : error 055: start of function body without function header
G:\C\sa\filterscripts\Objector.pwn(36) : error 010: invalid function or declaration
G:\C\sa\filterscripts\Objector.pwn(44) : error 010: invalid function or declaration
G:\C\sa\filterscripts\Objector.pwn(54) : warning 219: local variable "X" shadows a variable at a preceding level
G:\C\sa\filterscripts\Objector.pwn(54) : warning 219: local variable "Y" shadows a variable at a preceding level
G:\C\sa\filterscripts\Objector.pwn(54) : warning 219: local variable "Z" shadows a variable at a preceding level
G:\C\sa\filterscripts\Objector.pwn(55) : error 017: undefined symbol "GetPlayerpos"
G:\C\sa\filterscripts\Objector.pwn(56) : error 029: invalid expression, assumed zero
G:\C\sa\filterscripts\Objector.pwn(56) : error 001: expected token: ";", but found ")"
G:\C\sa\filterscripts\Objector.pwn(56) : error 029: invalid expression, assumed zero
G:\C\sa\filterscripts\Objector.pwn(56) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
8 Errors.
Re: try fixing this fuction[pro's only] -
admantis - 14.08.2012
First of all, you don't tell us the error and you probably can't fix it because the indentation / spacing is.. weird.
Re: try fixing this fuction[pro's only] -
Abhishek. - 14.08.2012
ah i was compressing it and oops i never make threads here only help so forgot to post the errors well just wait a second
Re: try fixing this fuction[pro's only] -
IceMeteor - 14.08.2012
change
pawn Код:
Float:X,
Float:Y,
Float:Z,
Float:rX,
Float:ry,
to
pawn Код:
Float:localX,
Float:localY,
Float:localZ,
Float:localrX,
Float:localry,
and all the variable there
AND dont put semicolon behind stock
Re: try fixing this fuction[pro's only] -
admantis - 14.08.2012
1) stock keyword is not a function, stock defines a function!
pawn Код:
stock CreateObjector(Objectid,Float:X,Float:Y,Float:Z,Float:rX,Float:rY,Float:rZ);
// Should be
stock CreateObjector(Objectid,Float:X,Float:Y,Float:Z,Float:rX,Float:rY,Float:rZ)
// without the semicolon (;)
2), X, Y and Z are already used at a preceding level, try to use a less generic global variable name.
3) GetPlayer
pos is not a function, try GetPlayer
Pos.
4) Empty statement at:
pawn Код:
for(new i=0;i<=MAX_OBJECTER;;i++)
// Should be:
for(new i=0;i<=MAX_OBJECTER;i++)
5) Bad parenthesis match:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,VIEW_DISTANCE,ObjectFactry[i][1],ObjectFactry[i][2],ObjectFactry[i][3])
// Should be
if(IsPlayerInRangeOfPoint(playerid,VIEW_DISTANCE,ObjectFactry[i][1],ObjectFactry[i][2],ObjectFactry[i][3]))
There could be a couple more mistakes, but please: think before you script. Silly things like bad capitalization make me think you script while drunk.
Re: try fixing this fuction[pro's only] -
Abhishek. - 14.08.2012
i am currently too messed up sir
mind fixing it and compile it for checking wheather is working and post here?
Re: try fixing this fuction[pro's only] -
Abhishek. - 14.08.2012
sorry for double post but....
now i get these
Код:
G:\C\sa\filterscripts\Objector.pwn(33) : warning 219: local variable "ry" shadows a variable at a preceding level
G:\C\sa\filterscripts\Objector.pwn(58) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(58) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(58) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(59) : error 001: expected token: ")", but found "{"
G:\C\sa\filterscripts\Objector.pwn(60) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(60) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(60) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(60) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(60) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(60) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(60) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(60) : error 032: array index out of bounds (variable "ObjectFactry")
G:\C\sa\filterscripts\Objector.pwn(62) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(62) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(62) : warning 213: tag mismatch
G:\C\sa\filterscripts\Objector.pwn(62) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Re: try fixing this fuction[pro's only] -
[MM]RoXoR[FS] - 14.08.2012
FIXED
pawn Код:
#include <a_samp>
#define MAX_OBJECTER 10000
#define VIEW_DISTANCE 10.0
new Object_Table[MAX_OBJECTER];
enum objecter{
obid,
Float:X,
Float:Y,
Float:Z,
Float:rX,
Float:rY,
Float:rZ,
};
new ObjectFactry[MAX_OBJECTER][objecter];
stock CreateObjector(Objectid,Float:_X,Float:_Y,Float:_Z,Float:_rX,Float:_rY,Float:_rZ)
{
new objecting_index = 0;
objecting_index++;
ObjectFactry[objecting_index][0] = objectid;
ObjectFactry[objecting_index][1] = _X;
ObjectFactry[objecting_index][2] = _Y;
ObjectFactry[objecting_index][3] = _Z;
ObjectFactry[objecting_index][4] = _rX;
ObjectFactry[objecting_index][5] = _rY;
ObjectFactry[objecting_index][6] = _rZ;
return 0;
}
public OnPlayerConnect(playerid)
{
SetTimer("Makeing",1000,1);
return 1;
}
forward Makeing(playerid);
public Makeing(playerid)
{
new Float:_X,Float:_Y,Float:_Z;
GetPlayerPos(playerid,_X,_Y,_Z);
for(new i=0;i<=MAX_OBJECTER;i++)
{
if(IsPlayerInRangeOfPoint(playerid,VIEW_DISTANCE,ObjectFactry[i][X],ObjectFactry[i][Y],ObjectFactry[i][Z]))
{
Object_Table[i]=CreateObject(ObjectFactry[i][obid],ObjectFactry[i][X],ObjectFactry[i][Y],ObjectFactry[i][Z],ObjectFactry[i][rX],ObjectFactry[i][rY],ObjectFactry[i][rZ],VIEW_DISTANCE);
}
if(GetPlayerDistanceFromPoint(playerid,ObjectFactry[i][X],ObjectFactry[i][Y],ObjectFactry[i][Z]) > VIEW_DISTANCE)
{
DestroyObject(Object_Table[i]);
}
}
return 1;
}
You need to start from basics
Re: try fixing this fuction[pro's only] -
Abhishek. - 14.08.2012
well thx
and dont you mean calling me n00b if yes then man sometimes guys can get too messed up that they forget the basic things in mind ,and i am not n00b because makeing that logic isnt an easy task do it?
Re: try fixing this fuction[pro's only] -
DaRealShazz - 14.08.2012
Yep, sometimes I forget to eat and how to walk. People forget basic things all the time.
/sarcasm