28.06.2012, 18:17
Hey,
I made a menu when you enter the PD star inside the pd hq.
only it keeps "refreshing" and when I presh Equipment it loads that menu, but after a few seconds it goes back to the main menu.
and when i presh a gun in the Equiptment it doesn't give me that gun....
Maybe someone can help who has knowledge with menu's
I made a menu when you enter the PD star inside the pd hq.
only it keeps "refreshing" and when I presh Equipment it loads that menu, but after a few seconds it goes back to the main menu.
and when i presh a gun in the Equiptment it doesn't give me that gun....
pawn Код:
new PDPos;
new Menu:PD;
new Menu:PDEq;
public OnGameModeInit()
{
PD = CreateMenu("~b~Police",1,15,150,200);
SetMenuColumnHeader(PD , 0, "~w~Select an Option");
AddMenuItem(PD,0,"Join PD");
AddMenuItem(PD,0,"Equiptment");
AddMenuItem(PD,0,"Leave PD");
PDEq = CreateMenu("~b~PD",1,15,150,200);
SetMenuColumnHeader(PDEq , 0, "~w~Equiptment");
AddMenuItem(PDEq,0,"Deagle");
AddMenuItem(PDEq,0,"Mp5");
AddMenuItem(PDEq,0,"Shotgun");
PDPos = CreatePickup(1247, 23, 254.4361,77.2889,1003.6406);//PD Join
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == PDPos)
{
ShowMenuForPlayer(Menu:PD, playerid);
TogglePlayerControllable(playerid,false);
}
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
if(GetPlayerMenu(playerid) == PD)
{
switch(row)
{
case 0:
{
Player[playerid][Cop] = 1;
TogglePlayerControllable(playerid,true);
}
case 1:
{
ShowMenuForPlayer(Menu:PDEq, playerid);
DisableMenu(Menu:PD);
}
case 2:
{
Player[playerid][Cop] = 0;
TogglePlayerControllable(playerid,true);
}
}
}
if(GetPlayerMenu(playerid) == PDEq)
{
switch(row)
{
case 0:
{
GivePlayerWeapon(playerid, 24, 100);
TogglePlayerControllable(playerid,true);
}
case 1:
{
GivePlayerWeapon(playerid, 29, 150);
TogglePlayerControllable(playerid,true);
}
case 2:
{
GivePlayerWeapon(playerid, 25, 50);
TogglePlayerControllable(playerid,true);
}
}
}
return 1;
}
public OnPlayerExitedMenu(playerid)
{
TogglePlayerControllable(playerid,true);
return 1;
}