SA-MP Forums Archive
[FilterScript] Dynamic ATM Rob System (ATM Add, Delete) [Y_INI] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Dynamic ATM Rob System (ATM Add, Delete) [Y_INI] (/showthread.php?tid=603729)



Dynamic ATM Rob System (ATM Add, Delete) [Y_INI] - Hwang - 26.03.2016



Hello everybody, system made for member's request. ATM System is dynamic as add for /atmadd [atm name], delete for /atmdelete [atm id]. Video is below. Thanks!

[ame]http://www.youtube.com/watch?v=o_c39bQfyZ0[/ame]

Click for Download



Re: Dynamic ATM Rob System (ATM Add, Delete) [Y_INI] - ThugLife2424 - 26.03.2016

Eline Sağlık Abi


Re: Dynamic ATM Rob System (ATM Add, Delete) [Y_INI] - Pottus - 27.03.2016

Code:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Come on dude use zcmd for commands.

Code:
forward ATM_TimeUpdater(); public ATM_TimeUpdater()
{
	new
		uString[156];
	for (new i = false; i <= MAX_ATM; i++){
	if(ATMInfo[i][aTime] > 0){
	ATMInfo[i][aTime]--;
	if(ATMInfo[i][aTime] <= 1){
	format(uString,156,"{ffffff}%s(%i)\n{ffffff}State: {77c97d}Active", ATMInfo[i][aName], atm_class);
	Update3DTextLabelText(ATMInfo[i][aLabel], -1, uString);
	ATMInfo[i][aDurum] = true;
	ATMInfo[i][aTime] = 0;
	}
	}
	}
	return true;
}
Not checking if an ATM is actually created.

Code:
SetPVarInt(playerid, "ATMcalinanMiktar", (random(MAX_ATM_PARA))+MIN_ATM_PARA);
You are using regular variables but mix in pvars for no reason use regular variables.

Code:
stock CreateATM(atmname[], Float:aaaX, Float:aaaY, Float:aaaZ, Float:aaaA){
atm_class++;
Code:
stock DestroyATM()
atm_class = 1;
Do I even need to explain the conniptions this will cause in your system.


Re: Dynamic ATM Rob System (ATM Add, Delete) [Y_INI] - Hwang - 27.03.2016

Quote:
Originally Posted by Pottus
View Post
Code:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Come on dude use zcmd for commands.

Code:
forward ATM_TimeUpdater(); public ATM_TimeUpdater()
{
	new
		uString[156];
	for (new i = false; i <= MAX_ATM; i++){
	if(ATMInfo[i][aTime] > 0){
	ATMInfo[i][aTime]--;
	if(ATMInfo[i][aTime] <= 1){
	format(uString,156,"{ffffff}%s(%i)\n{ffffff}State: {77c97d}Active", ATMInfo[i][aName], atm_class);
	Update3DTextLabelText(ATMInfo[i][aLabel], -1, uString);
	ATMInfo[i][aDurum] = true;
	ATMInfo[i][aTime] = 0;
	}
	}
	}
	return true;
}
Not checking if an ATM is actually created.

Code:
SetPVarInt(playerid, "ATMcalinanMiktar", (random(MAX_ATM_PARA))+MIN_ATM_PARA);
You are using regular variables but mix in pvars for no reason use regular variables.

Code:
stock CreateATM(atmname[], Float:aaaX, Float:aaaY, Float:aaaZ, Float:aaaA){
atm_class++;
Code:
stock DestroyATM()
atm_class = 1;
Do I even need to explain the conniptions this will cause in your system.
Turkish server owners usually dcmd uses. System firstly shared on Turkish forum site. Zcmd version easily passes.

Thanks for interest

Quote:
Originally Posted by ThugLife2424
View Post
Eline Sağlık Abi
Thank you.


Re: Dynamic ATM Rob System (ATM Add, Delete) [Y_INI] - rootcause - 27.03.2016

ATM_TimeUpdater has an array index out of bounds issue and it spams the console if you have crashdetect enabled.

Code:
for (new i = false; i <= MAX_ATM; i++)
should be

Code:
for (new i = 0; i < MAX_ATM; i++)



Re: Dynamic ATM Rob System (ATM Add, Delete) [Y_INI] - TrentyK - 27.03.2016

Wow, good filterscrit, i will test it in my server

+rep


Re: Dynamic ATM Rob System (ATM Add, Delete) [Y_INI] - Zorono - 09.04.2016

Bug:-
When I Do Any Command (/atmadd - /atmdelete) i get unknown command message
Please Fix This Proplem