06.03.2012, 12:05
Hello.
I'm new at making menu , and it's my first try .
I searched on samp wiki and found a simple tuto.
I did it , but i got one error , it's on the "switch(row)" line.My error is "undefined symbol "row""
Here is my script :
Should i define it , or i'm not supposed to be on the "OnPlayerCommandText" ?
Thanks
I'm new at making menu , and it's my first try .
I searched on samp wiki and found a simple tuto.
I did it , but i got one error , it's on the "switch(row)" line.My error is "undefined symbol "row""
Here is my script :
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/deathmatch", cmdtext, true, 10) == 0) { SetPlayerPos(playerid, 1307.5884,-1158.6796,23.8281); SendClientMessage(playerid, COLOR_GREEN, "You have been teleported to the DeathMatch Area!"); if (GetPlayerSkin(1)) { GivePlayerWeapon(playerid, 22, 50); GivePlayerWeapon(playerid, 18, 5); } if (GetPlayerSkin(2)) { GivePlayerWeapon(playerid, 25, 30); GivePlayerWeapon(playerid, 24, 40); } if (GetPlayerSkin(3)) { GivePlayerWeapon(playerid, 23, 40); GivePlayerWeapon(playerid, 26, 35); } return 1; } if (strcmp("/safearea", cmdtext, true, 10) == 0) { SetPlayerPos(playerid, 701.5940,-519.2322,16.3302); ResetPlayerWeapons(playerid); SendClientMessage(playerid, COLOR_GREEN, "You have been teleported to the Safe Area!"); return 1; } if (strcmp("/kill", cmdtext, true, 10) ==0) { SetPlayerHealth(playerid, 0); SendClientMessage(playerid, COLOR_YELLOW, "You commited a suicide."); return 1; } if (strcmp("/teleportmenu", cmdtext, true, 10) ==0) { if (!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, COLOR_GREY, "You don't have access to this command."); } if (IsPlayerAdmin(playerid)) { new Menu:teleportmenu; teleportmenu = CreateMenu("Teleportmenu", 2, 200.0, 100.0, 150.0, 150.0); AddMenuItem(teleportmenu, 0, "LS"); AddMenuItem(teleportmenu, 0, "LS"); AddMenuItem(teleportmenu, 0, "SF"); AddMenuItem(teleportmenu, 0, "SF"); AddMenuItem(teleportmenu, 0, "LV"); AddMenuItem(teleportmenu, 0, "LV"); AddMenuItem(teleportmenu, 1, "Grove Street"); AddMenuItem(teleportmenu, 1, "Starfish Tower"); AddMenuItem(teleportmenu, 1, "Wheel Arch Angels"); AddMenuItem(teleportmenu, 1, "Jizzys"); AddMenuItem(teleportmenu, 1, "4 Dragons"); AddMenuItem(teleportmenu, 1, "Come-a-Lot"); new Menu:CurrentMenu = GetPlayerMenu(playerid); if (CurrentMenu == teleportmenu) { switch(row) { case 0: { SetPlayerPos(playerid, 2493.9133, -1682.3986, 13.3382); SetPlayerInterior(playerid, 0); } case 1: { SetPlayerPos(playerid, 1541.2833, -1362.4741, 329.6457); SetPlayerInterior(playerid, 0); } case 2: { SetPlayerPos(playerid, -2705.5503, 206.1621, 4.1797); SetPlayerInterior(playerid, 0); } case 3: { SetPlayerPos(playerid, -2617.5156, 1390.6353, 7.1105); SetPlayerInterior(playerid, 0); } case 4: { SetPlayerPos(playerid, 2028.5538, 1008.3543, 10.8203); SetPlayerInterior(playerid, 0); } case 5: { SetPlayerPos(playerid, 2169.1838, 1122.5426, 12.6107); SetPlayerInterior(playerid, 0); } } } } return 1; } return 0; }
Thanks