19.04.2013, 21:43
Compilador ta travando quando tento compilar esse FS (Sou novato em pawn ainda)
Код:
#define FILTERSCRIPT #include <a_samp> new Menu:TeleportesADM; new vehicleid = GetPlayerVehicleID(playerid); public OnGameModeInit() { TeleportesADM = CreateMenu("Teleportes", 1, 200.0, 100.0, 150.0, 150.0); AddMenuItem(hospital, 0, "Prefeitura - LS"); AddMenuItem(hospital, 1, "DP - LS"); AddMenuItem(hospital, 2, "Hospital Market - LS"); AddMenuItem(hospital, 3, "Hospital Jefferson - LS"); AddMenuItem(hospital, 4, "Sair"); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/teleportes", true) == 0) { if(IsPlayerAdmin(playerid)) { ShowMenuForPlayer(TeleportesADM, playerid); // Mostrar o Menu ao jogador TogglePlayerControllable(playerid, false); // Vamos parб-lo para que ele nгo se mova com o Menu aberto SendClientMessage(playerid, 0xFFFFFFAA, "Bem vindo ao Menu de Teleportes - by: AutoClick"); // A mensagem ao abrir o menu (opcional) return 1; } else { SendClientMessage(playerid,0xFFFFFFAA,"Vocк nгo й um Admin."); return 0; } } } public OnPlayerSelectedMenuRow(playerid, row) { new Menu:CurrentMenu = GetPlayerMenu(playerid); // Qual menu estб aberto? Precisamos saber antes de dar a funзгo а eles < if(CurrentMenu == TeleportesADM) // Por isso essas linhas < { switch(row) // Agora й cada opзгo por si { case 0: // Essa й a opзгo Prefeitura { if(IsPlayerInAnyVehicle(playerid) { SetVehiclePos(vehicleid, 29,1476.7415,-1744.4495,13.5469,198.6300,0,0,0,0,0,0); } else { SetPlayerPos (playerid, 29,1476.7415,-1744.4495,13.5469,198.6300,0,0,0,0,0,0); TogglePlayerControllable(playerid, 1); // E finalmente deixar ele controlбvel denovo } } case 1: // Essa й a opзгo DP { if(IsPlayerInAnyVehicle(playerid) { SetVehiclePos(vehicleid, 29,1542.3608,-1675.5220,13.5544,272.0767,0,0,0,0,0,0); } else { SetPlayerPos (playerid, 29,1542.3608,-1675.5220,13.5544,272.0767,0,0,0,0,0,0); TogglePlayerControllable(playerid, 1); // E finalmente deixar ele controlбvel denovo } } case 2: // Essa й a opзгo Hosp.Market { if(IsPlayerInAnyVehicle(playerid) { SetVehiclePos(vehicleid, 29,1184.4124,-1324.1893,13.5747,86.7869,0,0,0,0,0,0); } else { SetPlayerPos (playerid, 29,1184.4124,-1324.1893,13.5747,86.7869,0,0,0,0,0,0); TogglePlayerControllable(playerid, 1); // E finalmente deixar ele controlбvel denovo } } case 3: // Essa й a opзгo Hosp.Jefferson { if(IsPlayerInAnyVehicle(playerid) { SetVehiclePos(vehicleid, 29,2016.4611,-1432.0688,13.5455,306.6287,0,0,0,0,0,0); } else { SetPlayerPos (playerid, 29,2016.4611,-1432.0688,13.5455,306.6287,0,0,0,0,0,0); TogglePlayerControllable(playerid, 1); // E finalmente deixar ele controlбvel denovo } } case 4: // Essa й a opзгo Sair { TogglePlayerControllable(playerid, 1); } } } } public OnPlayerExitedMenu(playerid) { TogglePlayerControllable(playerid, true); // Assim, se o player apertar F, vai poder andar novamente. return 1; }