PHP Code:
copyBlock(ent)
{
//if entity is valid
if (is_valid_ent(ent))
{
new Float:vOrigin[3];
new Float:vAngles[3];
new Float:vSizeMin[3];
new Float:vSizeMax[3];
new Float:fMax;
new blockType;
new size;
new axis;
new szCreator[32];
get_user_name(id, szCreator, 31);
replace_all(szCreator, 31, " ", "_");
//get blocktype and origin of currently grabbed block
blockType = entity_get_int(ent, EV_INT_body);
entity_get_vector(ent, EV_VEC_origin, vOrigin);
entity_get_vector(ent, EV_VEC_angles, vAngles);
entity_get_vector(ent, EV_VEC_mins, vSizeMin);
entity_get_vector(ent, EV_VEC_maxs, vSizeMax);
//work out the block size
size = SMALL;
fMax = vSizeMax[0] + vSizeMax[1] + vSizeMax[2];
if (fMax > 64.0) size = NORMAL;
if (fMax > 128.0) size = LARGE;
//work out the axis orientation
for (new i = 0; i < 3; ++i)
{
if (vSizeMax[i] == 4.0)
{
axis = i;
break;
}
}
//create a block of the same type in the same location
return createBlock(0, blockType, vOrigin, axis, size, szCreator);
}
return 0;
}
All the errors are on the same line.
Quote:
error 017: undefined symbol "id"
warning 215: expression has no effect.
warning 215: expression has no effect.
error 001 token: ';" but found ">"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
|