GetObjectPos problem
#1

The problem is when I click the "floppy" icon I got everything back, the checkpoint created but at the same position where I created the ball originally so there is a problem with the GetObjectPos line (I guess). Can someone help me with this?

PHP Code:
new 
    
Float:px,
    
Float:py,
    
Float:pz,
    
cpsize,
    
policecheckpoint,
    
ball,
    
    
Float:ballx,
    
Float:bally,
    
Float:ballz
;
CMD:cptest(playeridparams[])
{
    if(
sscanf(params"i"cpsize)) return UsageTag(playerid"/cptest [SIZE]");
    
GetPlayerPos(playeridFloat:pxFloat:pyFloat:pz);
    
ball CreateObject(1946Float:px+1Float:py+1Float:pz, -1, -1, -13);
    
EditObject(playeridball);
    return 
1;
}
hook OnPlayerEditObject(playeridplayerobjectobjectidresponseFloat:fXFloat:fYFloat:fZFloat:fRotXFloat:fRotYFloat:fRotZ)
{
    if(
objectid == ball)
    {
        if(
response == EDIT_RESPONSE_FINAL)
        {
            
GetObjectPos(ballFloat:ballxFloat:ballyFloat:ballz); 
            
policecheckpoint CreateDynamicCP(Float:ballxFloat:ballyFloat:ballzcpsize, -1, -1, -1100);
            
ServerTag(playerid"edit_response_final called");
            
DestroyObject(ball);
        }
    }
    
    if(
response == EDIT_RESPONSE_CANCEL)
    {
        
DestroyObject(ball);
    }
    return 
1;

Reply


Messages In This Thread
GetObjectPos problem - by polygxn - 23.02.2019, 08:40
Re: GetObjectPos problem - by Kane - 23.02.2019, 08:58
Re: GetObjectPos problem - by polygxn - 23.02.2019, 09:01

Forum Jump:


Users browsing this thread: 1 Guest(s)