SA-MP Forums Archive
atm issues - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: atm issues (/showthread.php?tid=586662)



atm issues - NickMirra - 23.08.2015

Код:
CMD:makeatm(playerid, params[])
{
	if(!CheckAdmin(playerid, HIGH_ADMIN_LEVEL)) return NotAuthMSG(playerid);
	new atmid, atminfo[256], interior, Float:x, Float:y, Float:z;
	if(sscanf(params,"s[256]", atminfo)) return SyntaxMSG(playerid, "/makeatm [Info]");
	atmid = GetNextATMID();
	GetPlayerPos(playerid, x, y, z);
	interior = GetInterior(playerid);
	ATMInfo[atmid][atmPosX] = x;
	ATMInfo[atmid][atmPosY] = y;
	ATMInfo[atmid][atmPosZ] = z;
	ATMInfo[atmid][atmAtmOn] = 1;
	ATMInfo[atmid][atmInterior] = interior;
	format(ATMInfo[atmid][atmInfo], 256, "%s", atminfo);
	format(msg, sizeof(msg), ""EMBED_ORANGE"["EMBED_YELLOW"ATM-%d"EMBED_ORANGE"]\n"EMBED_WHITE"%s.\n"EMBED_LIGHTBLUE"/withdraw /balance", atmid, atminfo);
	ATMInfo[atmid][atmLabel] = CreateDynamic3DTextLabel(msg, -1, x, y, z, 3.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, -1, -1, 100.0);
	ATMInfo[atmid][atmPickUp] = CreateObject(2942, 1, x, y, z, -1, -1);
	AddATMToFile(atmid, atminfo, interior, x, y, z);
	format(msg, sizeof(msg), "A new ATM was added, [Info: %s, ID: %d]", atminfo, atmid);
	SCM(playerid, COLOR_GREEN, msg);
	return 1;
}


Код:
ATMInfo[atmid][atmPickUp] = CreateObject(2942, 1, x, y, z, -1, -1);

I type the command in game and it does not create that objectg any ideas?


Re: atm issues - Nephxes - 24.08.2015

Well, your function CreateObject have not all arguments. And it probably can not work because of you use streamer plugin and you should not mix it with vanilla objects streamer.


Re: atm issues - Champagne - 24.08.2015

Im new at scripting and i don't know how to fix this, But i believe the script cant tell which coordinates are which, try using enum.

<a href="https://sampwiki.blast.hk/wiki/CreateObject"> Click here for more information on Creating Objects </a>


Re: atm issues - NickMirra - 24.08.2015

Yea i fixed it i really need to stop be lazy