11.09.2018, 10:51
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
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(playerid, params[])
{
new String[10000];
if(PlayerInfo[playerid][pAdmin] >= 7)
{
new NewATMID = SpawnedATM+1;
if(NewATMID >= MAX_ATM)
{
SendClientMessage( playerid, COLOR_WHITE, "Too many ATMs are currently spawned!");
}
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
format( String, sizeof( String ), "ARWIN14ATM/ATM_%d.ini", NewATMID);
if(dini_Exists(String))
{
SpawnedATM++;
format( String, sizeof( String ), "ATM (ID: %d) already exist!", NewATMID);
SendClientMessage( playerid, COLOR_GREY, String);
SendClientMessage( playerid, COLOR_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_IntSet( String, "Fee", ATMInfo[NewATMID][ATMFee]);
dini_FloatSet( String, "X", ATMInfo[NewATMID][ATMX]);
dini_FloatSet( String, "Y", ATMInfo[NewATMID][ATMY]);
dini_FloatSet( String, "Z", ATMInfo[NewATMID][ATMZ]);
dini_FloatSet( String, "Angle", ATMInfo[NewATMID][ATMAngle]);
SpawnedATM++;
ATMInfo[NewATMID][ATMObjectID] = CreateDynamicObject(19201, ATMInfo[NewATMID][ATMX], ATMInfo[NewATMID][ATMY], ATMInfo[NewATMID][ATMZ]-0.5, 0, 0, ATMInfo[NewATMID][ATMAngle],-1,-1,-1,250);
format(String, sizeof(String), "[id:%d]\n{FFFFFF}use command '{FF0000}/atm{FFFFFF}' to acces ATM",NewATMID);
atm[NewATMID] = CreateStreamed3DTextLabel(String, COLOR_WHITE, ATMInfo[NewATMID][ATMX], ATMInfo[NewATMID][ATMY], ATMInfo[NewATMID][ATMZ], 10.0, 0);
SendClientMessage( playerid, COLOR_LIGHTBLUE, "ATM berhasil dibuat!" );
format(String, sizeof( String ), "ID ATM baru: %d.", NewATMID);
SendClientMessage(playerid, COLOR_WHITE, String);
SetTimerEx("simpenmaxlimit", 1000, 0, "d", playerid);
}
}
else
{
SendClientMessage( playerid, COLOR_GREY, "You are not authorized to use this command!" );
}
return 1;
}