SA-MP Forums Archive
Vending Machine - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Română/Romanian (https://sampforum.blast.hk/forumdisplay.php?fid=40)
+---- Thread: Vending Machine (/showthread.php?tid=641714)



Vending Machine - RedGun2015 - 19.09.2017

Am incercat sa modific locatia unde sa se execute OnPlayerUseVendinMachine, insa nu merge, ca sa folosesc dozatorul trebuie sa fiu in el practic, nu in fata lui. Am incercat sa sterg si IsPlayerInDynamicArea insa tot nu merge. trebuie sa fiu practic in locul unde el pozitionat X,Y,Z, nu in fata lui.

Folosesc include-ul vending.inc

Cum pot rezolva?

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if((newkeys & KEY_SECONDARY_ATTACK) && (GetPlayerAnimationIndex(playerid) != 1660))
	{
		for(new i; i < MAX_MACHINES; i++)
		{
			if(!IsValidVendingMachine(i))
				continue;

			#if defined Streamer_IncludeFileVersion
			if(!IsPlayerInDynamicArea(playerid, g_eVendingData[i][E_VENDING_AREA]))
			    continue;
			#else
			new Float:x, Float:y;
			GetXYInFrontOfVending(i, x, y, 0.5);
			if(!IsPlayerInRangeOfPoint(playerid, 1, 1552.5898, -1683.4698, 13.5504))
				continue;
			#endif

			SetPlayerFacingAngle(playerid, g_eVendingData[i][E_VENDING_RZ]);
			if(OnPlayerUseVendingMachine(playerid, i) != 0)
			{
				if(g_eVendingData[i][E_VENDING_TYPE] == MACHINE_SNACK) {
					ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0, 1);
					PlayerPlaySound(playerid, 42601, 0.0, 0.0, 0.0);
				}
				else {
					ApplyAnimation(playerid, "VENDING", "VEND_USE", 3.0, 0, 0, 0, 0, 0, 1);
					PlayerPlaySound(playerid, 42600, 0.0, 0.0, 0.0);
					SetTimerEx("OnAnimationDrink", 1800, false, "i", playerid);
				}

				#if !defined NO_SPRUNK_ACTION
				if(g_eVendingData[i][E_VENDING_TYPE] == MACHINE_SPRUNK) SetTimerEx("ven_SetPlayerAnimation", 2500, false, "i", playerid);
				#endif
			}
			else ClearAnimations(playerid);
		}
	}
	#if !defined NO_SPRUNK_ACTION
	else if((newkeys & KEY_FIRE) && g_eLastDrink[playerid] < GetTickCount() && (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK))
	{
		OnPlayerDrinkSprunk(playerid);
		g_eLastDrink[playerid] = GetTickCount() + 2350;
	}
	#endif
	#if defined inc_Ven_OnPlayerKeyStateChange
		return inc_Ven_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
	#else
		return 0;
	#endif
}



Re: Vending Machine - RedGun2015 - 26.09.2017

Quote:
Originally Posted by RIDE2DAY
Посмотреть сообщение
Sigur folosesti script-ul corect? Incearca sa schimbi inc. care il ai cu asta:

https://github.com/Larcenny/vending
https://sampforum.blast.hk/showthread.php?tid=553952

Tine cont ca trebuie sa folosesti CreateVendingMachine pentru a crea un dozator.
am schimbat anumite variabile pentru ca imi zice ca le mai am odata definite, am incercat sa modific IsPlayrInRangeOfPoint sa pun alta raza, am pus 10.0, 5.0, 30.0, 999.0 si degeaba, nu merge.

Код:
D:\Gamemode\gamemode\pawno\include\vending.inc(237) : warning 219: local variable "rx" shadows a variable at a preceding level
D:\Gamemode\gamemode\pawno\include\vending.inc(237) : warning 219: local variable "ry" shadows a variable at a preceding level
D:\Gamemode\gamemode\pawno\include\vending.inc(237) : warning 219: local variable "rz" shadows a variable at a preceding level
D:\Gamemode\gamemode\pawno\include\vending.inc(404) : warning 219: local variable "rx" shadows a variable at a preceding level
D:\Gamemode\gamemode\pawno\include\vending.inc(404) : warning 219: local variable "ry" shadows a variable at a preceding level
D:\Gamemode\gamemode\pawno\include\vending.inc(404) : warning 219: local variable "rz" shadows a variable at a preceding level
D:\Gamemode\gamemode\pawno\include\vending.inc(437) : warning 219: local variable "rx" shadows a variable at a preceding level
D:\Gamemode\gamemode\pawno\include\vending.inc(437) : warning 219: local variable "ry" shadows a variable at a preceding level
D:\Gamemode\gamemode\pawno\include\vending.inc(437) : warning 219: local variable "rz" shadows a variable at a preceding level
D:\Gamemode\gamemode\pawno\include\vending.inc(581) : warning 202: number of arguments does not match definition



Re: Vending Machine - Florin48 - 27.09.2017

Eu pe acesta il folosesc, e facut de mine dar e doar pentru dozatoarele deja existente in joc.
Trebuie doar sa pui in GM: public OnPlayerUseVending(playerid)

https://www.mediafire.com/file/ao7d74o1ilnmjo8/vending.rar


Re: Vending Machine - DimaShift - 30.09.2017

pai de unde sa stiu ce are!
arata liniiele date
237
404
... .