Toys not saving (+REP)
#1

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?

PHP код:
public OnPlayerEditAttachedObject(playeridresponseindexmodelidboneidFloat:fOffsetXFloat:fOffsetYFloat:fOffsetZFloat:fRotXFloat:fRotYFloat:fRotZFloat:fScaleXFloat:fScaleYFloat:fScaleZ)
{
    if(
response)
    {
        
SendClientMessage(playeridCOLOR_ORANGE"Toys edition Saved");
        if(
fOffsetX 999.0)
        {
            
fOffsetX 999.0;
            
SendClientMessage(playeridCOLOR_WHITE"Maximum X Offset exeeded, damped to maximum");
        }
        if(
fOffsetY 999.0) {
            
fOffsetY 999.0;
            
SendClientMessage(playeridCOLOR_WHITE"Maximum Y Offset exeeded, damped to maximum");
        }
        if(
fOffsetZ 999.0) {
            
fOffsetZ 999.0;
            
SendClientMessage(playeridCOLOR_WHITE"Maximum Z Offset exeeded, damped to maximum");
        }
        if(
fOffsetX < -999.0) {
            
fOffsetX = -999.0;
            
SendClientMessage(playeridCOLOR_WHITE"Maximum X Offset exeeded, damped to maximum");
        }
        if(
fOffsetY < -999.0) {
            
fOffsetY = -999.0;
            
SendClientMessage(playeridCOLOR_WHITE"Maximum Y Offset exeeded, damped to maximum");
        }
        if(
fOffsetZ < -999.0) {
            
fOffsetZ = -999.0;
            
SendClientMessage(playeridCOLOR_WHITE"Maximum Z Offset exeeded, damped to maximum");
        }
        if(
fScaleX 999.0) {
            
fScaleX 999.0;
            
SendClientMessage(playeridCOLOR_WHITE"Maximum X Scale exeeded, damped to maximum");
        }
        if(
fScaleY 999.0) {
            
fScaleY 999.0;
            
SendClientMessage(playeridCOLOR_WHITE"Maximum Y Scale exeeded, damped to maximum");
        }
        if(
fScaleZ 999.0) {
            
fScaleZ 999.0;
            
SendClientMessage(playeridCOLOR_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(playeridCOLOR_RED"Toys edition cancelled");
    }
    return 
1;

Reply
#2

Show the part where you save the data in a file.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)