16.06.2010, 16:52
how do i make this script for admins only...with no money oh and level 3 and above thx
Код:
//==================== // Created by ANtus [2010] //==================== #include <a_samp> //==================== new Menu:Menu; new Menu:WepMenu; new Menu:VehMenu; new Menu:PlMenu; //==================== #define COLOR_NARANCS 0xFF9900AA //==================== public OnFilterScriptInit() { Menu = CreateMenu("Menu", 1,20,120,150,40); AddMenuItem(Menu, 0, "Weapon Menu"); AddMenuItem(Menu, 0, "Vehicle Menu"); AddMenuItem(Menu, 0, "Player Menu"); WepMenu = CreateMenu("Weapons", 1,20,120,150,40); AddMenuItem(WepMenu, 0, "Deagle ~g~$1500"); AddMenuItem(WepMenu, 0, "Tec9 ~g~$2000"); AddMenuItem(WepMenu, 0, "SMG ~g~$3000"); AddMenuItem(WepMenu, 0, "AK47 ~g~$5000"); AddMenuItem(WepMenu, 0, "M4A1 ~g~$6000"); AddMenuItem(WepMenu, 0, "Sniper ~g~5000"); AddMenuItem(WepMenu, 0, "B~r~ack"); VehMenu = CreateMenu("Veh Menu", 1,20,120,150,40); AddMenuItem(VehMenu, 0, "Repair Vehicle ~g~$500"); AddMenuItem(VehMenu, 0, "Black Vehicle ~g~$100"); AddMenuItem(VehMenu, 0, "White Vehicle ~g~$100"); AddMenuItem(VehMenu, 0, "Yellow Vehicle ~g~$10"); AddMenuItem(VehMenu, 0, "B~r~ack"); PlMenu = CreateMenu("AirPlanes", 1,20,120,150,40); AddMenuItem(PlMenu, 0, "Stunt ~g~$1500"); AddMenuItem(PlMenu, 0, "Squallo ~g~$1200"); AddMenuItem(PlMenu, 0, "Maverick ~g~$1500"); AddMenuItem(PlMenu, 0, "B~r~ack"); return 1; } //==================== public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/Menu", cmdtext, true, 10) == 0) { ShowMenuForPlayer(Menu,playerid); TogglePlayerControllable(playerid,false); return 1; } return 0; } //==================== public OnPlayerSelectedMenuRow(playerid, row) { new Menu:CurrentMenu = GetPlayerMenu(playerid); if(CurrentMenu == Menu) { switch(row) { case 0: { ShowMenuForPlayer(WepMenu, playerid); } case 1: { ShowMenuForPlayer(VehMenu, playerid); } case 2: { ShowMenuForPlayer(PlMenu, playerid); } } } if(CurrentMenu == WepMenu) { switch(row) { case 0: { GivePlayerMoney(playerid,1500); GivePlayerWeapon(playerid,24,100); GameTextForPlayer(playerid, "..::Desert Deagle::..",2000,5); TogglePlayerControllable(playerid,1); } case 1: { GivePlayerMoney(playerid,2000); GivePlayerWeapon(playerid,32,100); GameTextForPlayer(playerid, "..::Tec9::..",2000,5); TogglePlayerControllable(playerid,1); } case 2: { GivePlayerMoney(playerid,3000); GivePlayerWeapon(playerid,29,100); GameTextForPlayer(playerid, "..::SMG::..",2000,5); TogglePlayerControllable(playerid,1); } case 3: { GivePlayerMoney(playerid,5000); GivePlayerWeapon(playerid,30,100); GameTextForPlayer(playerid, "..::AK47::..",2000,5); TogglePlayerControllable(playerid,1); } case 4: { GivePlayerMoney(playerid,6000); GivePlayerWeapon(playerid,31,100); GameTextForPlayer(playerid, "..::M4A1::..",2000,5); TogglePlayerControllable(playerid,1); } case 5: { GivePlayerMoney(playerid,1500); GivePlayerWeapon(playerid,34,100); GameTextForPlayer(playerid, "..::Sniper::..",2000,5); TogglePlayerControllable(playerid,1); } case 6: { ShowMenuForPlayer(Menu, playerid); } } } if(CurrentMenu == VehMenu) { switch(row) { case 0: { GivePlayerMoney(playerid,-500); RepairVehicle(playerid); GameTextForPlayer(playerid, "Vehicle repaired!",2000,5); } case 1: { GivePlayerMoney(playerid,-100); ChangeVehicleColor(playerid,random(0),random(0)); TogglePlayerControllable(playerid,1); } case 2: { GivePlayerMoney(playerid,-100); ChangeVehicleColor(playerid,random(1),random(1)); TogglePlayerControllable(playerid,1); } case 3: { GivePlayerMoney(playerid,-100); ChangeVehicleColor(playerid,random(6),random(6)); TogglePlayerControllable(playerid,1); } case 4: { ShowMenuForPlayer(Menu, playerid); } } } if(CurrentMenu == PlMenu) { switch(row) { case 0: { new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); CreateVehicle(513, X,Y,Z, 0.0, 100, 100, 60000); HideMenuForPlayer(Menu, playerid); TogglePlayerControllable(playerid, true); GivePlayerMoney(playerid, -1500); new name[256]; new string[256]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "[INFO] %s got a Stunt-plane $1500.", name); SendClientMessageToAll(COLOR_NARANCS, string); TogglePlayerControllable(playerid,1); } case 1: { new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); CreateVehicle(446, X,Y,Z, 0.0, 100, 100, 60000); HideMenuForPlayer(Menu, playerid); TogglePlayerControllable(playerid, true); GivePlayerMoney(playerid, -1200); new name[256]; new string[256]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "[INFO] %s got a Squallo for $1200.", name); SendClientMessageToAll(COLOR_NARANCS, string); TogglePlayerControllable(playerid,1); } case 2: { new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); CreateVehicle(487, X,Y,Z, 0.0, 100, 100, 60000); HideMenuForPlayer(Menu, playerid); TogglePlayerControllable(playerid, true); GivePlayerMoney(playerid, -1500); new name[256]; new string[256]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "[INFO] %s got a Maverick for $1500.", name); SendClientMessageToAll(COLOR_NARANCS, string); TogglePlayerControllable(playerid,1); } case 3: { ShowMenuForPlayer(Menu, playerid); } } } return 1; } //==================== public OnPlayerExitedMenu(playerid) { TogglePlayerControllable(playerid, true); return 1; } //====================