07.08.2013, 00:54
Okay I am creating a menu for weapons, and I am using the tutorial on SAMP Wiki, it all makes sense, but it doesn't compile.
Here is my OnGameModeInIt()
I have these near the top of my script
Here is my "if" things, I don't know where to place this in the script
Finally here is the command to bring the menu on the screen
Thanks for reading, I hope you can help me
Here is my OnGameModeInIt()
pawn Код:
public OnGameModeInit()
{
SetGameModeText("Test gamemode");
//----Player Class Selection
AddPlayerClass(23,2038.5416,1342.3601,10.6719,270.0824,0,0,0,0,0,0);
AddPlayerClass(46,1831.0970,-1682.6102,13.5469,88.3051,0,0,0,0,0,0);
AddPlayerClass(45,1481.3297,-1748.6530,15.4453,359.7071,0,0,0,0,0,0);
AddPlayerClass(83,723.3815,-1494.9203,1.9343,359.2792,0,0,0,0,0,0);
AddPlayerClass(92,1126.6831,-1425.8101,15.7969,357.7497,0,0,0,0,0,0);
//---------------------------[SERVER VEHICLES]------------------------------
AddStaticVehicle(502,1478.9257,-1737.8595,13.2929,270.0982,0,0);
//Weapons Menu
Weaponsmenu = CreateMenu("Weaponsmenu", 1, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(Weaponsmenu, 0, "Sawnoff");
AddMenuItem(Weaponsmenu, 0, "Sniper");
AddMenuItem(Weaponsmenu, 0, "Deagle");
AddMenuItem(Weaponsmenu, 0, "M4");
AddMenuItem(Weaponsmenu, 0, "Tec-9");
AddMenuItem(Weaponsmenu, 0, "MP5");
return 1;
}
pawn Код:
new Menu:Weaponsmenu;
new Menu:CurrentMenu = GetPlayerMenu(playerid);
pawn Код:
if (CurrentMenu == Weaponsmenu)
{
switch(row)
{
case 0: //Sawnoff
{
GivePlayerWeapon(playerid, 26, 500);
SendClientMessage(playerid, 0xFFFFFFFF, "You have been given a Sawnoff");
}
case 1: //Sniper
{
GivePlayerWeapon(playerid, 34, 50);
SendClientMessage(playerid, 0xFFFFFFFF, "You have been given a Sniper");
}
case 2: //Deagle
{
GivePlayerWeapon(playerid, 24, 250);
SendClientMessage(playerid, 0xFFFFFFFF, "You have been given a Deagle");
}
case 3: //M4
{
GivePlayerWeapon(playerid, 31, 300);
SendClientMessage(playerid, 0xFFFFFFFF, "You have been given an M4");
}
case 4: //Tec-9
{
GivePlayerWeapon(playerid, 32, 500);
SendClientMessage(playerid, 0xFFFFFFFF, "You have been given a Tec-9");
}
case 5: //MP5
{
GivePlayerWeapon(playerid, 29, 350);
SendClientMessage(playerid, 0xFFFFFFFF, "You have been given an MP5");
}
}
}
pawn Код:
if (strcmp("/weapons", cmdtext, true, 8))
{
ShowMenuForPlayer(weaponsmenu,playerid);
return 1;
}