PDA

View Full Version : Help error 017: undefined symbol "ctstring" this why?please help.


Zyova
23/01/2015, 09:30 AM
./includes/commands.pwn(55562) : error 017: undefined symbol "ctstring" this why?please help.
*But i have this enum

enum customTextEnum
{
bool:ctExists,
ctString[255],
ctColor,
ctFont[32],
Float:ctX,
Float:ctY,
Float:ctZ,
Float:ctRX,
Float:ctRY,
Float:ctRZ,
ctSize,
ctModel,
ctBackColor,
ctObjectID
};


CMD:createcustomtext(playerid, params[])
{
new cmdtext[255];
new string1[512];
new tmp1[150];
new idx;
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
tmp1 = strtok(cmdtext, idx);
if (!strlen(tmp1))
{
SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /createcustomtext [text]");
return 1;
}
strmid(tmp1, cmdtext, strfind(cmdtext, " ") + 1, strlen(cmdtext));
for (new i = 0; i < MAX_CUSTOM_TEXTS; i ++)
{
if (!CustomTextEnum[i][ctExists])
{
new Float:x3, Float:y3, Float:z3, Float:a1;
GetPlayerPos(playerid, x3, y3, z3);
GetPlayerFacingAngle(playerid, a1);

x3 += (4.0 * floatsin(-a1, degrees));
y3 += (4.0 * floatcos(a1, degrees));
z3 += 5.5;

CustomTextEnum[i][ctExists] = true;
format(CustomTextEnum[i][ctstring], 255, tmp1);
CustomTextEnum[i][ctColor] = 0xFF000000;
format(CustomTextEnum[i][ctFont], 32, "Arial");

CustomTextEnum[i][ctX] = x3;
CustomTextEnum[i][ctY] = y3;
CustomTextEnum[i][ctZ] = z3;
CustomTextEnum[i][ctRX] = 0.0;
CustomTextEnum[i][ctRY] = 0.0;
CustomTextEnum[i][ctRZ] = a1 - 180;
CustomTextEnum[i][ctObjectID] = CreateDynamicObject(2885, x3, y3, z3, 0.0, 0.0, a1);
CustomTextEnum[i][ctSize] = 24;
CustomTextEnum[i][ctModel] = 2885;
CustomTextEnum[i][ctBackColor] = 0xFFFFFFFF;

SetDynamicObjectMaterialText(CustomTextEnum[i][ctObjectID], 0, Wrap(tmp1), _, _, _, _, 0xFF000000, 0xFFFFFFFF, 1);

format(string1, sizeof(string1), "You have created a custom text (ID: %d).", i);
SendClientMessage(playerid, -1, string1);

format(string1, sizeof(string1), "INSERT INTO `CustomTexts` (`ctID`) VALUES('%d')", i);
db_query(CustomTextDB, string1);

SaveCustomText(i);
return 1;
}
}
SendClientMessage(playerid, 0xAFAFAFFF, "You cannot spawn any more custom texts.");
return 1;
}
else SendClientMessage(playerid, 0xAFAFAFFF, "You are not authorized to use this command.");
return 1;
}

Ironboy
23/01/2015, 09:39 AM
You've given small letter 's', use the same as that in the enum.

format(CustomTextEnum[i][ctString], 255, tmp1);

Zyova
23/01/2015, 09:57 AM
I have write this format(CustomTextEnum[i][ctstring], 255, tmp1); Under CustomTextEnum[i][ctExists] = true; do you see?

Ironboy
23/01/2015, 10:02 AM
I have write this format(CustomTextEnum[i][ctstring], 255, tmp1); Under CustomTextEnum[i][ctExists] = true; do you see?

Open your eyes and see the difference!
ctString & ctstring

Zyova
23/01/2015, 10:07 AM
OMG,sorry it's my bad :D.

Zyova
23/01/2015, 10:19 AM
But still doesn't work IN Game,but success in compile.