errors -
noamch1997 - 21.08.2014
now i get unfined symbol objectid error..
- my objectid is 1608 .. CreateObject(1608, 821.84656, -2044.69141, 15.45633, -3.06000, -59.03994, 167.4198

;
so how to define it ?
pawn Code:
new bool: gMoveObjects;
if(gMoveObjects == false)
{
new Float: X, Float: Y, Float: Z;
GetObjectPos(objectid, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 30.0, X, Y, Z))
{
gMoveObjects = true;
MoveObjects(0);
}
}
forward MoveObjects(index);
public MoveObjects(index)
{
new Float: X, Float: Y, Float: Z;
GetObjectPos(objectid, x, y, z);
for(new i; i != MAX_PLAYERS; ++i)
{
if(IsPlayerInRangeOfPoint(i, 30.0, 821.84656, -2044.69141, 15.45633))
{
static time;
switch(index %= 6)
{
case 0: time = MoveObject(objectid, 821.84656, -2044.69141, 15.45633, 3);
case 1: time = MoveObject(objectid, 823.4802, -2071.3523, 15.4563, 4);
case 2: time = MoveObject(objectid, 821.5845, -2072.7134, 15.6320, 5);
case 3: time = MoveObject(objectid, 835.9559, -2088.6130, 15.6320, 6);
case 4: time = MoveObject(objectid, 844.3004, -2084.1091, 16.0045, 7);
case 5: time = MoveObject(objectid, 849.3589, -2059.7637, 15.6320, 8);
}
++index;
SetTimerEx("MoveObjects",time+150,false,"i",index);
return ;
}
}
gMoveObjects = false;
}
Re : errors -
S4t3K - 21.08.2014
In fact, I think you haven't yet gotten the point of programmation (I'm not laughing, I was exactly the same at the very beginning).
The function headers are stating variable names (cf : "GetObjectPos(objectid, &Float

, &Float:y, &Float:z);").
But when YOU use them, you're absolutely not forced at all to keep the same names.
For example, doing it :
pawn Code:
new
pObjects[MAX_PLAYERS]
;
CMD:object(playerid, params[])
{
pObjects[playerid] = CreateObject(1611, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0);
return 1;
}
// your function
new
qwertyuiop = pObjects[playerid],
Float:pos[3]
;
GetObjectPos(qwertyuiop, pos[0], pos[1], pos[2]);
Will get the pos of the integer number which is assigned to the variable "qwertyuiop" (which, btw, is the same as the one assigned to pObjects[playerid]).
But to "define" objectid, you first have to CREATE it.
How to create a variable ?
pawn Code:
new myVariable; // done ! myVariable is created ! do the same with objectid !
Re: Re : errors -
noamch1997 - 21.08.2014
Quote:
Originally Posted by S4t3K
In fact, I think you haven't yet gotten the point of programmation (I'm not laughing, I was exactly the same at the very beginning).
The function headers are stating variable names (cf : "GetObjectPos(objectid, &Float  , &Float:y, &Float:z);").
But when YOU use them, you're absolutely not forced at all to keep the same names.
For example, doing it :
pawn Code:
new pObjects[MAX_PLAYERS] ;
CMD:object(playerid, params[]) { pObjects[playerid] = CreateObject(1611, 0.0, 0.0, 5.0, 0.0, 0.0, 0.0); return 1; }
// your function
new qwertyuiop = pObjects[playerid], Float:pos[3] ; GetObjectPos(qwertyuiop, pos[0], pos[1], pos[2]);
Will get the pos of the integer number which is assigned to the variable "qwertyuiop" (which, btw, is the same as the one assigned to pObjects[playerid]).
But to "define" objectid, you first have to CREATE it.
How to create a variable ?
pawn Code:
new myVariable; // done ! myVariable is created ! do the same with objectid !
|
man i dont know pawn i am beginner ... how can i slove my solution ?
i created a variable:
Re: errors -
Andre02 - 21.08.2014
Satek told you everything, to solve your problem you need to create the variable.
When "undefined symbol "symbol"" comes up ,it means that the "symbol" is not created so you will have to create it and to create you need to add it on your code like that:
pawn Code:
new symbol; // symbol created
The undefined symbol is "objectid" ,so you will have to create it.
I will let you do it, so you can learn it by yourself.
I am also a beginner so if someone that know better then me see something that is wrong just tell me so i also learn.
Re: errors -
noamch1997 - 22.08.2014
the shark is not mooving