Zeig doch mal bitte den Code dazu.
Ok, ist ein bisschen mehr Code, da das gesamte Callback ist.
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
switch(newkeys) {
case KEY_SECONDARY_ATTACK: {
for(new i=0;i<sizeof Interior;i++) {
if(IsPlayerInRangeOfPoint(playerid,3,Interior[i][A_X],Interior[i][A_Y],Interior[i][A_Z])) {
SetPlayerVirtualWorld(playerid,Interior[i][InteriorVirtualWorld]);
SetPlayerPos(playerid,Interior[i][I_X],Interior[i][I_Y],Interior[i][I_Z]);
SetPlayerInterior(playerid,Interior[i][InteriorID]);
}
else if(IsPlayerInRangeOfPoint(playerid,3,Interior[i][I_X],Interior[i][I_Y],Interior[i][I_Z])) {
SetPlayerVirtualWorld(playerid,0);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,Interior[i][A_X],Interior[i][A_Y],Interior[i][A_Z]);
}
}
for(new i=0;i!=sizeof ATM;i++) {
if(IsPlayerInRangeOfPoint(playerid,3,ATM[i][aX],ATM[i][aY],ATM[i][aZ])) {
ShowPlayerDialog(playerid,DIALOG_ATM,DIALOG_STYLE_LIST,"Bankomat - Hauptmenü","Auszahlen\nEinzahlen\nKontostand\nÜberweisen","OK","Abbrechen");
}
}
if(IsPlayerInRangeOfPoint(playerid,3,-28.1062,-89.9486,1003.5469)) {
ShowPlayerDialog(playerid,DIALOG_SKAUFEN,DIALOG_STYLE_LIST,"Kaufvorgang","Zeitung","OK","Quit");
}
else if(IsPlayerInRangeOfPoint(playerid,3,1730.2362,-2335.4951,13.5469)) {
new str[100];
if(SpielerInfo[playerid][pJob] != 1)return SendClientMessage(playerid,ROT,"Du bist kein Pilot!");
else if(SpielerSachen[playerid][pPilotAuszeit] > gettime())return SendClientMessage(playerid,ROT,"Du kannst nur alle 10 Minuten fliegen!");
else if(SpielerInfo[playerid][pPilotFluege] == 5 || SpielerInfo[playerid][pPilotFluege] == 20 || SpielerInfo[playerid][pPilotFluege] == 40 || SpielerInfo[playerid][pPilotFluege] == 65 || SpielerInfo[playerid][pPilotFluege] == 111) return PilotSpezialAuftrag(playerid);
else if(SpielerInfo[playerid][pPilotFluege] < 15) {
format(str,sizeof str,"Dodo");
}
else if(SpielerInfo[playerid][pPilotFluege] < 30) {
format(str,sizeof str,"Dodo\nCropduster");
}
else if(SpielerInfo[playerid][pPilotFluege] < 50) {
format(str,sizeof str,"Dodo\nCropduster\nBeagle");
}
else if(SpielerInfo[playerid][pPilotFluege] < 50) {
format(str,sizeof str,"Dodo\nCropduster\nBeagle");
}
else if(SpielerInfo[playerid][pPilotFluege] < 100) {
format(str,sizeof str,"Dodo\nCropduster\nBeagle\nNevada");
}
else {
format(str,sizeof str,"Dodo\nCropduster\nBeagle\nNevada\nShamal");
}
ShowPlayerDialog(playerid,DIALOG_FLUGZEUGAUSWAHL,DIALOG_STYLE_LIST,"Verfügbare Flugzeuge",str,"OK","Quit");
}
else if(IsPlayerInRangeOfPoint(playerid,3,1094.2566,-1875.6587,13.5469)) {
if(SpielerInfo[playerid][pJob] != 2)return SendClientMessage(playerid,ROT,"Du bist kein Waffendealer!");
ShowPlayerDialog(playerid,DIALOG_WCREATE,DIALOG_STYLE_LIST,"Waffe auswählen","Silenced Pistol\nDesert Eagle\nMP5\nSniper Rifle","OK","Quit");
}
else if(IsPlayerInRangeOfPoint(playerid,5,1456.8768,-1750.9211,13.5469)) {
if(SpielerInfo[playerid][pJob] > 0)return SendClientMessage(playerid,ROT,"Andy: Tut mir leid, du hast schon einen Job!");
ShowPlayerDialog(playerid,DIALOG_IJOBS,DIALOG_STYLE_LIST,"Ich biete dir an, ...","Waffendealer zu werden","OK","Quit");
}
else if(GetPVarInt(playerid,"inSpec") == 1) {
TogglePlayerSpectating(playerid,0);
SpawnPlayer(playerid);
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,GetPVarFloat(playerid,"LastX"),GetPVarFloat(playerid,"LastY"),GetPVarFloat(playerid,"LastZ"));
SetPVarInt(playerid,"inSpec",0);
DeletePVar(playerid,"inSpec");
DeletePVar(playerid,"LastX");
DeletePVar(playerid,"LastY");
DeletePVar(playerid,"LastZ");
}
else if(IsPlayerInRangeOfPoint(playerid,3,361.8299,173.5657,1008.3828)) {
ShowPlayerDialog(playerid,DIALOG_RATHAUS,DIALOG_STYLE_LIST,"Rathaus Informationspunkt","Beantragungen","OK","Abbrechen");
}
else if(!GetPVarInt(playerid,"InHaus")) {
new ID = GetNearestHouse(playerid,3);
if(ID == SpielerInfo[playerid][pMiethausid]) {
SetPlayerInterior(playerid,Haus[ID][hInterior]);
SetPlayerPos(playerid,Haus[ID][rX],Haus[ID][rY],Haus[ID][rZ]);
SetPVarInt(playerid,"InHaus",true);
}
if(ID == -1)return true;
if(Haus[ID][hAbgeschlossen])return true;
SetPlayerInterior(playerid,Haus[ID][hInterior]);
SetPlayerPos(playerid,Haus[ID][rX],Haus[ID][rY],Haus[ID][rZ]);
SetPVarInt(playerid,"InHaus",true);
}
new ID = GetNearestHouseExit(playerid,3);
if(ID == SpielerInfo[playerid][pMiethausid]) {
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid,Haus[ID][hX],Haus[ID][hY],Haus[ID][hZ]);
DeletePVar(playerid,"InHaus");
}
if(ID == -1)return true;
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid,Haus[ID][hX],Haus[ID][hY],Haus[ID][hZ]);
DeletePVar(playerid,"InHaus");
return true;
}
}
return 1;
}