Problem with teleportmenu and teleporting with car... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with teleportmenu and teleporting with car... (
/showthread.php?tid=83197)
Problem with teleportmenu and teleporting with car... -
VayaConTioz - 23.06.2009
Hi,
i made a teleportmenu a few days ago. It worked well since I noticed, that if i am in a vehicle it happens nothing. So i tried to implement this option.
This is the call for the menu:
Код:
if(strcmp(cmdtext, "/teleport", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
ShowMenuForPlayer(teleportmenu2, playerid);
}
else
{ShowMenuForPlayer(teleportmenu, playerid);
return 1;
}}
The teleportmenu is the normal menu if i am not in a vehicle... this still works. The teleportmenu2 is the menu which is called if i am in a vehicle:
Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == teleportmenu2)
{
switch(row)
{
new v = GetPlayerVehicleID(playerid);
case 0: // GROVE STREET (LS)
{
SetVehiclePos(v, 2492.1934,-1667.5109,13.3438);
PutPlayerInVehicle(playerid, v, 0);
SendClientMessage(playerid, 0xFFFFFFFF, "Willkommen in der Grovestreet");
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 22,300);
GivePlayerWeapon(playerid, 28,1000);
GivePlayerWeapon(playerid, 26,200);
SetPlayerArmour(playerid,0);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 100000);
}
case 1: // BEACH (LS)
{
SetVehiclePos(v, 369.4351,-2046.1688,7.6719);
PutPlayerInVehicle(playerid, v, 0);
SendClientMessage(playerid, 0xFFFFFFFF, "Willkommen am Santa Maria: Beach");
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 22,300);
GivePlayerWeapon(playerid, 28,1000);
GivePlayerWeapon(playerid, 26,200);
SetPlayerArmour(playerid,0);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 100000);
}}}}
The problem is if I am in any vehicle and type /teleport, it opens the teleportmenu2 but i cant choose an option with spacebar. When i press spacebar it happens nothing, it only works if i press "W". But I dont know why. Can someone please help me?
PS.: Sorry for bad english, Iґm german. Hope i could explain it understandable =)
Re: Problem with teleportmenu and teleporting with car... -
pen_theGun - 23.06.2009
pawn Код:
if(strcmp(cmdtext, "/teleport", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
ShowMenuForPlayer(teleportmenu2, playerid);
TogglePlayerControllable(playerid, 1); // Friert den spieler(playerid) ein.
}
else
{
ShowMenuForPlayer(teleportmenu, playerid);
}
return 1;
}
Re: Problem with teleportmenu and teleporting with car... -
VayaConTioz - 23.06.2009
Es funktioniert noch immer nicht. Ich kann im Menь zwar ganz normal mit den Pfeiltasten aussuchen, aber auswдhlen kann ich nur mit W nicht wie gewohnt mit Leertaste.
Re: Problem with teleportmenu and teleporting with car... -
Grim_ - 23.06.2009
English please?
Re: Problem with teleportmenu and teleporting with car... -
VayaConTioz - 23.06.2009
Code of pen_the gun dont solve the problem. The Problem is that i only can choose an option in menu with the "W" key, not with spacebar as regular.