CMD:editobj (Problem)
#1

hello, I'm almost done with my map tool.
one command left, /Editobj.

This is what i have.

Код:
CMD:editobj(playerid, params[])
{
	new string[128], idx;
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pMapper] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
 	if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editobj [Object ID]");
 	if(!ObjInfo[idx][oModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid Object id.");
	GetDynamicObjectPos(ObjInfo[idx][oObj], oCX[playerid], oCY[playerid], oCZ[playerid]);
	GetDynamicObjectRot(ObjInfo[idx][oObj], oCRX[playerid], oCRY[playerid], oCRZ[playerid]);
	EditDynamicObject(playerid, ObjInfo[idx][oObj]);
    format(string, sizeof(string), "MapperWarn: %s is editting a object. (object id: %d)", RPN(playerid), idx);
    SendMapperMessage(COLOR_GREEN, 1, string);
	return 1;
}
But still. i'm getting these errors.

Код:
C:\Users\Fabio\Desktop\LSC-RP\gamemodes\ZRP.pwn(13967) : error 028: invalid subscript (not an array or too many subscripts): "oCX"
C:\Users\Fabio\Desktop\LSC-RP\gamemodes\ZRP.pwn(13967) : warning 215: expression has no effect
C:\Users\Fabio\Desktop\LSC-RP\gamemodes\ZRP.pwn(13967) : error 001: expected token: ";", but found "]"
C:\Users\Fabio\Desktop\LSC-RP\gamemodes\ZRP.pwn(13967) : error 029: invalid expression, assumed zero
C:\Users\Fabio\Desktop\LSC-RP\gamemodes\ZRP.pwn(13967) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

1. Show which lines the errors are on.
2. Show the declaration of 'oCX' and 'oCY' etc.

You're only specifying a player ID in the array, I assume you need an object ID also.
Reply
#3

Declaration:
Код:
enum objInfo
{
	oObj,
	Text3D:oText,
	oModel,
	Float:oCX,
	Float:oCY,
	Float:oCZ,
	Float:oCRX,
	Float:oCRY,
	Float:oCRZ,
	Float:oOX,
	Float:oOY,
	Float:oOZ,
	Float:oORX,
	Float:oORY,
	Float:oORZ,
}
new ObjInfo[MAX_OBJ][objInfo];
Error line:
Код:
	GetDynamicObjectPos(ObjInfo[idx][oObj], oCX[playerid], oCY[playerid], oCZ[playerid]);
Whole cmd Posted earlier in this topic!
Reply
#4

Anybody?
Reply
#5

pawn Код:
enum objInfo
{
    oObj,
    Text3D:oText,
    oModel,
    Float:oCX,
    Float:oCY,
    Float:oCZ,
    Float:oCRX,
    Float:oCRY,
    Float:oCRZ,
    Float:oOX,
    Float:oOY,
    Float:oOZ,
    Float:oORX,
    Float:oORY,
    Float:oORZ
}
Reply
#6

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
pawn Код:
enum objInfo
{
    oObj,
    Text3D:oText,
    oModel,
    Float:oCX,
    Float:oCY,
    Float:oCZ,
    Float:oCRX,
    Float:oCRY,
    Float:oCRZ,
    Float:oOX,
    Float:oOY,
    Float:oOZ,
    Float:oORX,
    Float:oORY,
    Float:oORZ
}
This didnt fixed the command. :O
Reply
#7

Anybody :O?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)