27.09.2009, 17:19
Hi I got my Offset function and the script compiles but i still get errors!! heres the code:
Errors Are:
Thanks For Any Help!! =]
pawn Код:
if (strcmp("/saveob", cmdtext, true, 10) == 0)
{
new Float:rx, Float:ry, Float:rz;
new Float:xo, Float:yo, Float:zo;
GetObjectRot(ob, rx, ry, rz);
GetObjectOffsetToPlayer(playerid, ob, xo, yo, zo);
new entry[256];
format(entry, sizeof(entry), "object offset: %f, %f, %f \n object rotation: %f, %f, %f", xo, yo, zo, rx, ry, rz);
new File:hFile;
hFile = fopen("ob.txt", io_write);
fwrite(hFile, entry);
fclose(hFile);
return 1;
}
return 0;
}// end of onplayercommandtext
stock GetObjectOffsetToPlayer(playerid, objectid, Float:xoffset, Float:yoffset, Float:zoffset)
{
new Float:px, Float:py, Float:pz, Float:ox, Float:oy, Float:oz;
GetObjectPos(objectid, ox, oy, oz);
GetPlayerPos(playerid, px, py, pz);
new Float:xoffset = px - ox;
new Float:yoffset = py - oy;
new Float:zoffset = pz - oz;
}
Код:
K:\Games\Projects\sa-mp server\filterscripts\cod4.pwn(31) : warning 219: local variable "xoffset" shadows a variable at a preceding level K:\Games\Projects\sa-mp server\filterscripts\cod4.pwn(32) : warning 219: local variable "yoffset" shadows a variable at a preceding level K:\Games\Projects\sa-mp server\filterscripts\cod4.pwn(33) : warning 219: local variable "zoffset" shadows a variable at a preceding level K:\Games\Projects\sa-mp server\filterscripts\cod4.pwn(33) : warning 204: symbol is assigned a value that is never used: "zoffset" K:\Games\Projects\sa-mp server\filterscripts\cod4.pwn(32) : warning 204: symbol is assigned a value that is never used: "yoffset" K:\Games\Projects\sa-mp server\filterscripts\cod4.pwn(31) : warning 204: symbol is assigned a value that is never used: "xoffset" K:\Games\Projects\sa-mp server\filterscripts\cod4.pwn(25) : warning 203: symbol is never used: "zoffset" K:\Games\Projects\sa-mp server\filterscripts\cod4.pwn(25) : warning 203: symbol is never used: "yoffset" K:\Games\Projects\sa-mp server\filterscripts\cod4.pwn(25) : warning 203: symbol is never used: "xoffset"