Destroying a dynamic object.
#1

Hello there, when am destroying the ATM and restarting the server, the object won't be deleted why? I guess it won't save so that's why it won't be deleted. How can i fix that.

PHP код:
    }
    if(
dialogid == 52)
    {
        if(
response)
        {
            new 
tmpid IsPlayerAtATM(playerid);
            if(
tmpid!=-1)
            {
                new 
path[32];
                
format(path,sizeof(path),"atm%d.txt",tmpid);
                
dini_Remove(path);
                
Delete3DTextLabel(atmInfo[tmpid][aText]);
                
DestroyDynamicObject(atmInfo[tmpid][aObject]);
                
atmInfo[tmpid][aX]=0.0;
                
atmInfo[tmpid][aY]=0.0;
                
atmInfo[tmpid][aZ]=0.0;
                
atmInfo[tmpid][aA]=0.0;
                
//SendClientMessage(playerid, COLOR_GREY,"ATM ID: %d destroyed successfully",tmpid);
                
new string[128];
                
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has destroyed an ATM"RPN(playerid));
                
SendAdminMessage(COLOR_DARKRED1string);
                return 
1;
            } else return 
0;
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY,"Destroying ATM canceled");
            return 
1;
        }
    }
    if(
dialogid == 51)
    {
        if(
response)
        {
            new 
Float:Pos[4];
            
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
            
GetPlayerFacingAngle(playerid,Pos[3]);
            
//new atmid = CreateATM(Pos[0],Pos[1],Pos[2],Pos[3]);
            
CreateATM(Pos[0],Pos[1],Pos[2],Pos[3]);
            
//SendClientMessage(playerid, COLOR_GREY,"ATM ID: %d successfully created", atmid);
            
new string[128];
               
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created an ATM"RPN(playerid));
            
SendAdminMessage(COLOR_DARKRED1string);
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY,"Creating ATM canceled");
            return 
1;
        } 
The command:

PHP код:
}
CMD:deleteatm(playeridparams[])
{
        if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
        if(
PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
        {
        new 
tmpid IsPlayerAtATM(playerid);
        if(
tmpid!=-1)
        {
            new 
stringa[MAX_STRING];
            
format(stringa,sizeof(stringa),"Are you sure you want to destroy ATM ID: %d",tmpid);
            
ShowPlayerDialog(playerid,52,DIALOG_STYLE_MSGBOX,"ATM destroy",stringa,"Yes","No");
            return 
1;
        } else return 
SendClientMessage(playeridCOLOR_GREY,"You are not at ATM");
    }

Reply


Messages In This Thread
Destroying a dynamic object. - by TheSnaKe - 23.12.2014, 15:49
Re: Destroying a dynamic object. - by TheSnaKe - 23.12.2014, 20:24
Re: Destroying a dynamic object. - by Schneider - 23.12.2014, 20:29
Re: Destroying a dynamic object. - by TheSnaKe - 23.12.2014, 20:34
Re: Destroying a dynamic object. - by Schneider - 23.12.2014, 21:14
Re: Destroying a dynamic object. - by TheSnaKe - 23.12.2014, 21:28
Re: Destroying a dynamic object. - by Schneider - 23.12.2014, 22:21

Forum Jump:


Users browsing this thread: 1 Guest(s)