01.12.2012, 18:46
Menu comes up But wont change Skins.. as i select Next or previous and Menu disapeers
pawn Код:
new Menu:Policemenu;
new CopSkin[5][0] =
{
{280},
{281},
{282},
{283},
{288}
};
pawn Код:
public OnGameModeInit()
{
//============================Police Menu=======================================
Policemenu = CreateMenu("Police Duty", 1, 200.0, 200.0, 150.0, 150.0);
AddMenuItem(Policemenu, 0, "Next Skin");
AddMenuItem(Policemenu, 0, "Previous Skin");
AddMenuItem(Policemenu, 0, "Use The Skin");
AddMenuItem(Policemenu, 0, "Exit Police Duty");
return 1;
}
pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:PoliceMenu = GetPlayerMenu(playerid);
if(PoliceMenu == Policemenu)
{
switch(row)
{
case 0: //Next Uniform
{
if(PlayerInfo[playerid][jSkin] == 0)
{
PlayerInfo[playerid][jSkin] = 4;
}
else PlayerInfo[playerid][jSkin]++;
SetPlayerSkin(playerid, CopSkin[PlayerInfo[playerid][jSkin]][PlayerInfo[playerid][jSkin]]);
ShowMenuForPlayer(PoliceMenu,playerid);
}
case 1: //Previous Uniform
{
if(PlayerInfo[playerid][jSkin] == 4)
{
PlayerInfo[playerid][jSkin] = 0;
}
else PlayerInfo[playerid][jSkin]--;
SetPlayerSkin(playerid, CopSkin[PlayerInfo[playerid][jSkin]][PlayerInfo[playerid][jSkin]]);
ShowMenuForPlayer(PoliceMenu,playerid);
}
case 2:// Accepted Selected Skin As A Officer
{
SendClientMessage(playerid, WHITE, "You are now On Duty as a cop");
SetPlayerColor(playerid, LIGHTBLUE);
GivePlayerWeapon(playerid, 3, 1);
GivePlayerWeapon(playerid, 24, 200);
GivePlayerWeapon(playerid, 25, 200);
GivePlayerWeapon(playerid, 41, 200);
SetPlayerArmour(playerid, 100);
dini_IntSet(file, "PoliceTeam",PlayerInfo[playerid][pPoliceTeam] = 3);
dini_IntSet(file, "Job",PlayerInfo[playerid][pJob] = 3);
ChatSystem = 0;
TogglePlayerControllable(playerid, 1);
}
case 3: // Exit Police Duty
{
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SendClientMessage(playerid, WHITE, "You are now Off Duty as a cop");
SetPlayerColor(playerid, WHITE);
ResetPlayerWeapons(playerid);
SetPlayerArmour(playerid, 0);
dini_IntSet(file, "PoliceTeam",PlayerInfo[playerid][pPoliceTeam] = 0);
dini_IntSet(file, "JobSkin", PlayerInfo[playerid][jSkin] = 0);
dini_IntSet(file, "Job",PlayerInfo[playerid][pJob] = 0);
ChatSystem = 1;
TogglePlayerControllable(playerid, 1);
}
}
}
return 1;
}