19.02.2014, 02:49
I've been browsing around for awhile and couldn't seem to find the solution to this problem.
Anyways, I have a toy system like any other roleplaying server would, except after I'm done editing the toys. If I take off my toys, or log out, then the toy will not save its position.
I'm not sure if these lines will have anything to do with it:
How can I fix it so that my toys actually save their position?
Anyways, I have a toy system like any other roleplaying server would, except after I'm done editing the toys. If I take off my toys, or log out, then the toy will not save its position.
I'm not sure if these lines will have anything to do with it:
How can I fix it so that my toys actually save their position?
PHP код:
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
if(response)
{
SendClientMessage(playerid, COLOR_ORANGE, "Toys edition Saved");
if(fOffsetX > 999.0)
{
fOffsetX = 999.0;
SendClientMessage(playerid, COLOR_WHITE, "Maximum X Offset exeeded, damped to maximum");
}
if(fOffsetY > 999.0) {
fOffsetY = 999.0;
SendClientMessage(playerid, COLOR_WHITE, "Maximum Y Offset exeeded, damped to maximum");
}
if(fOffsetZ > 999.0) {
fOffsetZ = 999.0;
SendClientMessage(playerid, COLOR_WHITE, "Maximum Z Offset exeeded, damped to maximum");
}
if(fOffsetX < -999.0) {
fOffsetX = -999.0;
SendClientMessage(playerid, COLOR_WHITE, "Maximum X Offset exeeded, damped to maximum");
}
if(fOffsetY < -999.0) {
fOffsetY = -999.0;
SendClientMessage(playerid, COLOR_WHITE, "Maximum Y Offset exeeded, damped to maximum");
}
if(fOffsetZ < -999.0) {
fOffsetZ = -999.0;
SendClientMessage(playerid, COLOR_WHITE, "Maximum Z Offset exeeded, damped to maximum");
}
if(fScaleX > 999.0) {
fScaleX = 999.0;
SendClientMessage(playerid, COLOR_WHITE, "Maximum X Scale exeeded, damped to maximum");
}
if(fScaleY > 999.0) {
fScaleY = 999.0;
SendClientMessage(playerid, COLOR_WHITE, "Maximum Y Scale exeeded, damped to maximum");
}
if(fScaleZ > 999.0) {
fScaleZ = 999.0;
SendClientMessage(playerid, COLOR_WHITE, "Maximum Z Scale exeeded, damped to maximum");
}
PlayerToyInfo[playerid][index][ptPosX] = fOffsetX;
PlayerToyInfo[playerid][index][ptPosY] = fOffsetY;
PlayerToyInfo[playerid][index][ptPosZ] = fOffsetZ;
PlayerToyInfo[playerid][index][ptRotX] = fRotX;
PlayerToyInfo[playerid][index][ptRotY] = fRotY;
PlayerToyInfo[playerid][index][ptRotZ] = fRotZ;
PlayerToyInfo[playerid][index][ptScaleX] = fScaleX;
PlayerToyInfo[playerid][index][ptScaleY] = fScaleY;
PlayerToyInfo[playerid][index][ptScaleZ] = fScaleZ;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Toys edition cancelled");
}
return 1;
}