Delete ATM
#1

I have a script to make an atm.
But I don't have a script to delete atm, how do I create a script to delete the ATM?
Please help me, because I don't really know about DINI
PHP код:
CMD:createatm(playeridparams[])
{
    new 
String[10000];
    if(
PlayerInfo[playerid][pAdmin] >= 7)
     {
        new 
NewATMID SpawnedATM+1;
        if(
NewATMID >= MAX_ATM)
        {
            
SendClientMessageplayeridCOLOR_WHITE"Too many ATMs are currently spawned!");
        }
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        
formatStringsizeof( String ), "ARWIN14ATM/ATM_%d.ini"NewATMID);
        if(
dini_Exists(String))
        {
            
SpawnedATM++;
             
formatStringsizeof( String ), "ATM (ID: %d) already exist!"NewATMID);
               
SendClientMessageplayeridCOLOR_GREYString);
             
SendClientMessageplayeridCOLOR_YELLOW"Please try again by typing /createatm complete" );
           }
        else
           {
            
ATMInfo[NewATMID][ATMX] = x;
            
ATMInfo[NewATMID][ATMY] = y;
            
ATMInfo[NewATMID][ATMZ] = z;
            
ATMInfo[NewATMID][ATMAngle] = 0;
            
ATMInfo[NewATMID][ATMFee] = 1;
            
dini_Create(String);
            
dini_IntSetString"Fee"ATMInfo[NewATMID][ATMFee]);
            
dini_FloatSetString"X"ATMInfo[NewATMID][ATMX]);
            
dini_FloatSetString"Y"ATMInfo[NewATMID][ATMY]);
            
dini_FloatSetString"Z"ATMInfo[NewATMID][ATMZ]);
            
dini_FloatSetString"Angle"ATMInfo[NewATMID][ATMAngle]);
            
SpawnedATM++;
            
ATMInfo[NewATMID][ATMObjectID] = CreateDynamicObject(19201ATMInfo[NewATMID][ATMX], ATMInfo[NewATMID][ATMY], ATMInfo[NewATMID][ATMZ]-0.500ATMInfo[NewATMID][ATMAngle],-1,-1,-1,250);
            
format(Stringsizeof(String), "[id:%d]\n{FFFFFF}use command '{FF0000}/atm{FFFFFF}' to acces ATM",NewATMID);
            
atm[NewATMID] = CreateStreamed3DTextLabel(StringCOLOR_WHITEATMInfo[NewATMID][ATMX], ATMInfo[NewATMID][ATMY], ATMInfo[NewATMID][ATMZ], 10.00);
               
SendClientMessageplayeridCOLOR_LIGHTBLUE"ATM berhasil dibuat!" );
            
format(Stringsizeof( String ), "ID ATM baru: %d."NewATMID);
            
SendClientMessage(playeridCOLOR_WHITEString);
            
SetTimerEx("simpenmaxlimit"10000"d"playerid);
        }
    }
     else
    {
        
SendClientMessageplayeridCOLOR_GREY"You are not authorized to use this command!" );
    }
    return 
1;

Reply
#2

PHP код:
COMMAND:deleteatm(playeridparams[])
{
    new 
atmid;
    if(
PlayerInfo[playerid][pAdmin] >= 7) return SendClientMessageplayeridCOLOR_GREY"You are not authorized to use this command!" );
    if( 
sscanf params"d"atmid)) return SendClientMessageplayeridCOLOR_GREY"/deleteatm [atm id]" );
    new 
string[64];
    
format(string,sizeof(string),"ARWIN14ATM/ATM_%d.ini",atmid);
    if(!
dini_Exists(string)) return SendClientMessageplayeridCOLOR_GREY"There's no ATM with this ID!" );
    
dini_Remove(string);
    
DestroyDynamicObject(ATMInfo[NewATMID][ATMObjectID]);
    
DestroyDynamic3DTextLabel(ATMInfo[NewATMID][ATMText]);
    return 
1;

something like that, just change it to your code.
Reply
#3

Quote:
Originally Posted by AzaMx
Посмотреть сообщение
PHP код:
COMMAND:deleteatm(playeridparams[])
{
    new 
atmid;
    if(
PlayerInfo[playerid][pAdmin] >= 7) return SendClientMessageplayeridCOLOR_GREY"You are not authorized to use this command!" );
    if( 
sscanf params"d"atmid)) return SendClientMessageplayeridCOLOR_GREY"/deleteatm [atm id]" );
    new 
string[64];
    
format(string,sizeof(string),"ARWIN14ATM/ATM_%d.ini",atmid);
    if(!
dini_Exists(string)) return SendClientMessageplayeridCOLOR_GREY"There's no ATM with this ID!" );
    
dini_Remove(string);
    
DestroyDynamicObject(ATMInfo[NewATMID][ATMObjectID]);
    
DestroyDynamic3DTextLabel(ATMInfo[NewATMID][ATMText]);
    return 
1;

something like that, just change it to your code.
Okay,, i'll try it thanks
Reply
#4

Oh yeah, i forgot something.. So when i create an atm... it create 3D TextLabel.. but not create the object.. idk why
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)