Warning help -
Shazwan - 02.05.2015
I did check what bug is but seems looks everything are in a right place please help.
Код:
RRP.PWN(4317) : warning 219: local variable "rx" shadows a variable at a preceding level
RRP.PWN(4317) : warning 219: local variable "ry" shadows a variable at a preceding level
RRP.PWN(4317) : warning 219: local variable "rz" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Warnings.
Код:
This line > public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
if(response)
{
new string[128];
if(GetPVarInt(playerid, "gEdit") == 1)
{
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action!");
new gateid = GetPVarInt(playerid, "EditingGateID");
GateInfo[gateid][gPosX] = x;
GateInfo[gateid][gPosY] = y;
GateInfo[gateid][gPosZ] = z;
GateInfo[gateid][gRotX] = rx;
GateInfo[gateid][gRotY] = ry;
GateInfo[gateid][gRotZ] = rz;
SaveGates();
format(string, sizeof(string), "You have finished editing the open position of Gate ID: %d", gateid);
SendClientMessage(playerid, COLOR_WHITE, string);
DeletePVar(playerid, "gEdit");
DeletePVar(playerid, "EditingGateID");
}
if(GetPVarInt(playerid, "gEdits") == 2)
{
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action!");
new gateid = GetPVarInt(playerid, "EditingGateIDs");
GateInfo[gateid][gPosXM] = x;
GateInfo[gateid][gPosYM] = y;
GateInfo[gateid][gPosZM] = z;
GateInfo[gateid][gRotXM] = rx;
GateInfo[gateid][gRotYM] = ry;
GateInfo[gateid][gRotZM] = rz;
SaveGates();
format(string, sizeof(string), "You have finished editing the closed position of Gate ID: %d", gateid);
SendClientMessage(playerid, COLOR_WHITE, string);
DeletePVar(playerid, "gEdits");
DeletePVar(playerid, "EditingGateIDs");
}
if(response == EDIT_RESPONSE_CANCEL)
{
if(GetPVarType(playerid, "gEdit") == 1)
{
CreateGate(GetPVarInt(playerid, "EditingGateID"));
DeletePVar(playerid, "gEdit");
DeletePVar(playerid, "EditingGateID");
SendClientMessage(playerid, COLOR_WHITE, "You have stopped yourself from editing the gate.");
}
else
{
CreateGate(GetPVarInt(playerid, "EditingObjectID"));
DeletePVar(playerid, "oEdit");
DeletePVar(playerid, "EditingObjectID");
SendClientMessage(playerid, COLOR_WHITE, "You have stopped yourself from editing the object.");
}
}
return 1;
}
Re: Warning help -
Mencent - 02.05.2015
Hello!
You already defined rx,ry and rz. Search for rx,ry and rz in your script.
Then you should send us the row where you find this.
Re: Warning help -
Shazwan - 02.05.2015
I done lookup at the script but theres no rx ry rz at other script plus It only show this line that have a warning
Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
Re: Warning help -
Konstantinos - 02.05.2015
Ctrl + F and type
rx to the box of the current script. If it doesn't find any other result other than those from the OnPlayerEditDynamicObject callback, check all the include files you're using.
Re: Warning help -
Mencent - 02.05.2015
Change your streamer.inc with mine and write the callback like this:
http://www.file-upload.net/download-...eamer.inc.html
PHP код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx_x, Float:ry_y, Float:rz_z)
{
if(response)
{
new string[128];
if(GetPVarInt(playerid, "gEdit") == 1)
{
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action!");
new gateid = GetPVarInt(playerid, "EditingGateID");
GateInfo[gateid][gPosX] = x;
GateInfo[gateid][gPosY] = y;
GateInfo[gateid][gPosZ] = z;
GateInfo[gateid][gRotX] = rx_x;
GateInfo[gateid][gRotY] = ry_y;
GateInfo[gateid][gRotZ] = rz_z;
SaveGates();
format(string, sizeof(string), "You have finished editing the open position of Gate ID: %d", gateid);
SendClientMessage(playerid, COLOR_WHITE, string);
DeletePVar(playerid, "gEdit");
DeletePVar(playerid, "EditingGateID");
}
if(GetPVarInt(playerid, "gEdits") == 2)
{
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action!");
new gateid = GetPVarInt(playerid, "EditingGateIDs");
GateInfo[gateid][gPosXM] = x;
GateInfo[gateid][gPosYM] = y;
GateInfo[gateid][gPosZM] = z;
GateInfo[gateid][gRotXM] = rx_x;
GateInfo[gateid][gRotYM] = ry_y;
GateInfo[gateid][gRotZM] = rz_z;
SaveGates();
format(string, sizeof(string), "You have finished editing the closed position of Gate ID: %d", gateid);
SendClientMessage(playerid, COLOR_WHITE, string);
DeletePVar(playerid, "gEdits");
DeletePVar(playerid, "EditingGateIDs");
}
if(response == EDIT_RESPONSE_CANCEL)
{
if(GetPVarType(playerid, "gEdit") == 1)
{
CreateGate(GetPVarInt(playerid, "EditingGateID"));
DeletePVar(playerid, "gEdit");
DeletePVar(playerid, "EditingGateID");
SendClientMessage(playerid, COLOR_WHITE, "You have stopped yourself from editing the gate.");
}
else
{
CreateGate(GetPVarInt(playerid, "EditingObjectID"));
DeletePVar(playerid, "oEdit");
DeletePVar(playerid, "EditingObjectID");
SendClientMessage(playerid, COLOR_WHITE, "You have stopped yourself from editing the object.");
}
}
return 1;
}
Re: Warning help -
Shazwan - 02.05.2015
Thanks Mencent and Konstantinos, I found it at the variables
Код:
new Float:rx[MAX_LAUNCH];
new Float:ry[MAX_LAUNCH];
new Float:rz[MAX_LAUNCH];