Hallo, ich habe im Forum das aufgeschnappt:
new Menu:showme;
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == showme)
{
switch(row)
{
case 0:
{
SetPlayerColor(playerid, COLOR_GREY);
SendClientMessage(playerid, COLOR_GREY, "Color");
TogglePlayerControllable(playerid, true);
}
case 1:
{
SetPlayerColor(playerid, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_PURPLE, "Color");
TogglePlayerControllable(playerid, true);
}
case 2:
{
SetPlayerColor(playerid, COLOR_DBLUE);
SendClientMessage(playerid, COLOR_DBLUE, "Color");
TogglePlayerControllable(playerid, true);
}
case 3:
{
SetPlayerColor(playerid, COLOR_YELLOW);
SendClientMessage(playerid, COLOR_YELLOW, "Color");
TogglePlayerControllable(playerid, true);
}
case 4:
{
SetPlayerColor(playerid, COLOR_RED);
SendClientMessage(playerid, COLOR_RED, "Color");
TogglePlayerControllable(playerid, true);
}
case 5:
{
SetPlayerColor(playerid, COLOR_GREEN);
SendClientMessage(playerid, COLOR_GREEN, "Color");
TogglePlayerControllable(playerid, true);
}
case 6:
{
SetPlayerColor(playerid, COLOR_LIGHTGREEN);
SendClientMessage(playerid, COLOR_LIGHTGREEN, "Color");
TogglePlayerControllable(playerid, true);
}
case 7:
{
SetPlayerColor(playerid, TEAM_ORANGE_COLOR);
SendClientMessage(playerid, TEAM_ORANGE_COLOR, "Color");
TogglePlayerControllable(playerid, true);
}
case 8:
{
SetPlayerColor(playerid, COLOR_YELLOW2);
SendClientMessage(playerid, COLOR_YELLOW2, "Color");
TogglePlayerControllable(playerid, true);
}
case 9:
{
SetPlayerColor(playerid, TEAM_HIT_COLOR);
SendClientMessage(playerid, TEAM_HIT_COLOR, "invisible");
TogglePlayerControllable(playerid, true);
}
}
}
}
Ongamemodeinit
showme = CreateMenu("Color", 2, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(showme, 0, "Grau");
AddMenuItem(showme, 0, "Lila");
AddMenuItem(showme, 0, "Blau");
AddMenuItem(showme, 0, "Gelb");
AddMenuItem(showme, 0, "Rot");
AddMenuItem(showme, 0, "Grün");
AddMenuItem(showme, 0, "Hellgrün");
AddMenuItem(showme, 0, "Orange");
AddMenuItem(showme, 0, "Hellgelb");
AddMenuItem(showme, 0, "Unsichtbar");
if (strcmp("/showme", cmdtext, true, 10) == 0)
{
ShowMenuForPlayer(showme, playerid);
return 1;
}
Nach dem einfügen in die Gamemode kommen 2 Fehler:
W:\Server\SA-MP 0.3a Windows Server\gamemodes\GM.pwn(7769) : error 017: undefined symbol "cmdtext"
W:\Server\SA-MP 0.3a Windows Server\gamemodes\GM.pwn(7771) : error 017: undefined symbol "playerid"
Wer kann mir bitte sagen wie ich die fehler weg kriege oder was nicht stimmt?
Danke