23.06.2009, 14:44
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:
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:
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 =)
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; }}
Код:
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); }}}}
PS.: Sorry for bad english, Iґm german. Hope i could explain it understandable =)