SA-MP Forums Archive
help - 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: help (/showthread.php?tid=644569)



help - reddoxx - 10.11.2017

i want help with this locker command

Код:
COMMAND:locker(playerid, params[])
{
  	if(PlayerInfo[playerid][pFaction] != 2) return SCM(playerid, COLOR_LIGHTRED, "Nem vagy rendvйdelmi szerv tagja.");
  
  	if(IsPlayerInRangeOfPoint(playerid, 6.0, 2074.8101,-1719.7982,13.5469,195.8301) || PlayerInfo[playerid][pFaction] == 2)
 	{
		ShowPlayerDialog(playerid, DIALOG_LOCKER, DIALOG_STYLE_LIST, "LSPD", "Golyубllу mellйny\nGumibot\nPaprikaspray\nDesert Eagle\nShotgun\nMP5\nM4\nSniper\nTazer\nRuhбzat", "Vбlaszt", "Bezбr");
	}
	if(IsPlayerInRangeOfPoint(playerid, 6.0, 2074.8101,-1719.7982,13.5469,195.8301) || PlayerInfo[playerid][pFaction] == 6)
	{
		ShowPlayerDialog(playerid, DIALOG_SDLOCKER, DIALOG_STYLE_LIST, "SASD", "Golyубllу mellйny\nGumibot\nPaprikaspray\nDesert Eagle\nShotgun\nMP5\nM4\nSniper\nTazer\nRuhбzat", "Vбlaszt", "Bezбr");
	}
	else return SCM(playerid, COLOR_LIGHTRED, "Nem vagy a szekrйnyek kцzelйben!");
	return 1;
}
when i compile this command, i can't use, i got an error message in game
Код:
"if(PlayerInfo[playerid][pFaction] != 2) return SCM(playerid, COLOR_LIGHTRED, "Nem vagy rendvйdelmi szerv tagja.");"
when i remove this line
Код:
"if(PlayerInfo[playerid][pFaction] != 2) return SCM(playerid, COLOR_LIGHTRED, "Nem vagy rendvйdelmi szerv tagja.");"
, i use everywhere the command.
like, the position is in the lspd hq, and i can use the command in my house.


Re: help - R4nd4ll - 10.11.2017

Woah woah

Use [ code ] and [ /code ] I cant read shit man


Re: help - reddoxx - 10.11.2017

thread fixed


Re: help - reddoxx - 10.11.2017

i try to fix the command, but i not have good results.


Re: help - zMason - 10.11.2017

You restrict players from using the command if they're not faction 2, so this line can never be true: || PlayerInfo[playerid][pFaction] == 6

I would do it like this:

Код:
COMMAND:locker(playerid, params[])
{
  	if(IsPlayerInRangeOfPoint(playerid, 6.0, 2074.8101,-1719.7982,13.5469,195.8301) && PlayerInfo[playerid][pFaction] == 2)
 	{
		ShowPlayerDialog(playerid, DIALOG_LOCKER, DIALOG_STYLE_LIST, "LSPD", "Golyубllу mellйny\nGumibot\nPaprikaspray\nDesert Eagle\nShotgun\nMP5\nM4\nSniper\nTazer\nRuhбzat", "Vбlaszt", "Bezбr");
return 1;
	}
	if(IsPlayerInRangeOfPoint(playerid, 6.0, 2074.8101,-1719.7982,13.5469,195.8301) && PlayerInfo[playerid][pFaction] == 6)
	{
		ShowPlayerDialog(playerid, DIALOG_SDLOCKER, DIALOG_STYLE_LIST, "SASD", "Golyубllу mellйny\nGumibot\nPaprikaspray\nDesert Eagle\nShotgun\nMP5\nM4\nSniper\nTazer\nRuhбzat", "Vбlaszt", "Bezбr");
return 1;
	}
	SCM(playerid, COLOR_LIGHTRED, "Nem vagy a szekrйnyek kцzelйben!");
	return 1;
}