SA-MP Forums Archive
PDmenu need 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PDmenu need help. (/showthread.php?tid=71231)



PDmenu need help. - faeain - 30.03.2009

Hello, i have made a pdmenu but i dont know how to put it on a special location that + how to make it for cops on‌ly =).
Код:
/*
*/

#include <a_samp>

new Menu:pdmenu;

#define LIGHT_BLUE 0x33CCFFAA

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("  PDMenu Made By: Faeain  ");
	print("--------------------------------------\n");
	pdmenu = CreateMenu("pd menu", 1, 220.0, 100.0, 150.0, 150.0);
	AddMenuItem(pdmenu, 0, "Standard");
	AddMenuItem(pdmenu, 0, "Double Standard");
	AddMenuItem(pdmenu, 0, "Swat");
	AddMenuItem(pdmenu, 0, "Heavy Swat");
	AddMenuItem(pdmenu, 0, "Sharpshooter");
	return 1;
}

public OnFilterScriptExit()
{

	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext, "/pdmenu", true) == 0)
	{
  	ShowMenuForPlayer(pdmenu, playerid);
  	return 1;
	}
	return 0;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	new Menu:CurrentMenu = GetPlayerMenu(playerid);
	if(CurrentMenu == pdmenu)
	{
  	switch(row)
  	{
	    case 0: //Standard
	    {
				ResetPlayerWeapons(playerid);
				GivePlayerWeapon(playerid, 3 , 1);
		    	GivePlayerWeapon(playerid, 41 , 1000);
        	GivePlayerWeapon(playerid, 25 , 200);
     		GivePlayerWeapon(playerid, 24 , 200);
  		 	 	SetPlayerArmour(playerid, 150);
  	    SendClientMessage(playerid, LIGHT_BLUE, "You are equipped with standard kit.");
	    }
	    case 1: //Double Standard
	    {
				ResetPlayerWeapons(playerid);
     		GivePlayerWeapon(playerid, 3 , 1);
     		GivePlayerWeapon(playerid, 41 , 999);
		  	GivePlayerWeapon(playerid, 29 , 500);
	      GivePlayerWeapon(playerid, 24 , 200);
	      SetPlayerArmour(playerid, 150);
		  	SendClientMessage(playerid, LIGHT_BLUE, "You are equipped with double standard kit.");
	    }
	    case 2: //Swat
	    {
				ResetPlayerWeapons(playerid);
     		GivePlayerWeapon(playerid, 29 , 500);
		  	GivePlayerWeapon(playerid, 31 , 500);
	      GivePlayerWeapon(playerid, 24 , 300);
		  	SetPlayerArmour(playerid, 200);
	      SendClientMessage(playerid, LIGHT_BLUE, "You are equipped with swat gear.");
	    }
	    case 3: //Heavy Swat
	    {
				ResetPlayerWeapons(playerid);
		  	GivePlayerWeapon(playerid, 29 , 500);
		  	GivePlayerWeapon(playerid, 27 , 200);
		  	GivePlayerWeapon(playerid, 31 , 600);
	      GivePlayerWeapon(playerid, 24 , 500);
	      SetPlayerArmour(playerid, 200);
		    SendClientMessage(playerid, LIGHT_BLUE, "You are equipped with heavy swat gear.");
	    }
	    case 4: //Sharpshooter
	    {
				ResetPlayerWeapons(playerid);
	      GivePlayerWeapon(playerid, 34 , 300);
		    GivePlayerWeapon(playerid, 24 , 200);
	      SetPlayerArmour(playerid, 200);
		    SendClientMessage(playerid, LIGHT_BLUE, "You are equipped with sharpshooter gear.");
			}
		}
	}
	return 1;
}
Thanks =).


Re: PDmenu need help. - (.Aztec); - 30.03.2009

What's the declaration for the Police Department?

Like in godfather, it is "IsACop(playerid);"


Re: PDmenu need help. - faeain - 30.03.2009

No idea but im using Carlito's rp script, maybe that helps abit :/.


Re: PDmenu need help. - (.Aztec); - 30.03.2009

Damn, I am not familiar with that script.. Sorry, but I can't help.


Re: PDmenu need help. - Shellegg - 31.03.2009

The declaration is:

pawn Код:
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)



Re: PDmenu need help. - ICECOLDKILLAK8 - 31.03.2009

So use PlayerToPoint and a check for thier faction in your /pdmenu command


Re: PDmenu need help. - faeain - 31.03.2009

I have to move the filterscript to the gamemode for it to work i guess.
But i dont know where..
Код:
public OnPlayerSelectedMenuRow(playerid, row)
Код:
public OnFilterScriptExit()
Код:
public OnFilterScriptInit()
I put everything from OnFilterScriptInit to OnGameModeInit but i had some big ass errors when i tried to compile it.
So what names should my codes have if it was in a gamemode.
Thanks=)