Enter von Häusern & Bizes mit taste

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo,


    könnt ihr mir den Code schreiben um Bizes & Häuser nichtmehr mit /enter /exit , sonder man muss nurnoch enter drücken!
    Vielen dank

  • Hier hab gemacht nur jetzt geht nur das obere enter.
    Exit geht nicht wobei ich auch eingefügt habe!


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){ new string[128]; new sendername[MAX_PLAYER_NAME]; new pveh = GetVehicleModel(GetPlayerVehicleID(playerid)); new newcar = GetPlayerVehicleID(playerid); new gun1 = GetPlayerWeapon(playerid); new gunname1[24]; GetWeaponName(gun1,gunname1,sizeof(gunname1)); if(PRESSED(KEY_SECONDARY_ATTACK)) // ENTER Taste { if(IsPlayerConnected(playerid)) { for(new i = 0; i < sizeof(HouseInfo); i++) { if (IsPlayerInRangeOfPoint(playerid, 10,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez])) { //printf("Found House :%d",i); if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0) { if(PlayerInfo[playerid][pWanted] == 0) { SafeSetPlayerInterior(playerid,HouseInfo[i][hInt]); SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]); SafeSetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]); PlayerInfo[playerid][pLocal] = i; PlayerInfo[playerid][pVirWorld] = HouseInfo[i][hWorld]; HouseEntered[playerid] = i; PlayerInfo[playerid][pInteriorNr] = 39; } else { GameTextForPlayer(playerid, "~r~Verbrecher dürfen nicht in Häuser", 5000, 1); return 1; } } else { GameTextForPlayer(playerid, "~r~Locked", 5000, 1); return 1; } } } for(new i = 0; i < sizeof(BizzInfo); i++) { if (IsPlayerInRangeOfPoint(playerid, 5,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ])) { if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost]) { if(PlayerInfo[playerid][pPbiskey] != i) { if(BizzInfo[i][bLocked] == 1) { GameTextForPlayer(playerid, "~r~Geschlossen", 5000, 1); return 1; } SafeGivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]); format(string, sizeof(string), "~r~-$%d~n~~w~Schreibe /exit~n~zum verlassen", BizzInfo[i][bEntranceCost]); BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost]; ExtortionBiz(i, BizzInfo[i][bEntranceCost]); BizzInfo[i][bProducts]--; OnPropUpdate(2,i); GameTextForPlayer(playerid, string, 5000, 3); } PlayerInfo[playerid][pInteriorNr] = BizzInfo[i][bInteriorNr]; SetPlayerVirtualWorld(playerid,BizzInfo[i][bVirWorld]); SafeSetPlayerInterior(playerid,BizzInfo[i][bInterior]); SafeSetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]); new dood[MAX_PLAYER_NAME]; GetPlayerName(playerid, dood, sizeof(dood)); BizzEntered[playerid] = i; new h,mi,s,y,m,d; getdate(y,m,d); gettime(h,mi,s); format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s payed $%d to enter biz %d",d,m,y,h,mi,s, dood, BizzInfo[i][bEntranceCost], i); printf("%s", string); PayLog(string); if(BizzInfo[i][bVirWorld] == 0 || BizzInfo[i][bVirWorld] == 1) { OnPlayerEnterFood(playerid, 1); } else if(BizzInfo[i][bVirWorld] == 2 || BizzInfo[i][bVirWorld] == 3) { OnPlayerEnterFood(playerid, 2); } else if(BizzInfo[i][bVirWorld] == 4 || BizzInfo[i][bVirWorld] == 5) { OnPlayerEnterFood(playerid, 3); } else if(BizzInfo[i][bVirWorld] == 6) { OnPlayerEnterFood(playerid, 4); } } else { GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1); } } } for(new i = 0; i < sizeof(SBizzInfo); i++) { if (IsPlayerInRangeOfPoint(playerid, 3,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ])) { if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost]) { if(PlayerInfo[playerid][pPbiskey] != i) { if(SBizzInfo[i][sbLocked] == 1) { GameTextForPlayer(playerid, "~r~Geschlossen", 5000, 1); return 1; } SafeGivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]); gSpentCash[playerid] = GetPlayerMoney(playerid); SBizzInfo[i][sbProducts]--; SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost]; ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]); new dood[MAX_PLAYER_NAME]; GetPlayerName(playerid, dood, sizeof(dood)); format(string, sizeof(string), "%s bezahlt $%d zum eintreten %d", dood, SBizzInfo[i][sbEntranceCost], i); printf("%s", string); PayLog(string); OnPropUpdate(3,i); } } else { GameTextForPlayer(playerid, "~r~Du hast nicht genügend Geld", 5000, 1); } } } if (IsPlayerInRangeOfPoint(playerid, 4,2073.2979,-1831.1228,13.5469)) { // Pay & Spray if(GetPlayerState(playerid) == 2) { if(GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 2062.1294,-1831.5498,13.5469); SetVehicleZAngle(tmpcar, 90); SafeGivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]); SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost]; SBizzInfo[5][sbProducts]--; SetTimerEx("AfterSpray1", 7500, false, "i", playerid); } else { SendClientMessage(playerid, COLOR_GREY, "Du hast nicht genügend Geld."); } } } else if (IsPlayerInRangeOfPoint(playerid, 4,1024.9756,-1030.7930,32.0257)) { // Pay & Spray if(GetPlayerState(playerid) == 2) { if(GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 1024.9763,-1021.8850,32.1016); SetVehicleZAngle(tmpcar, 0); SafeGivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]); SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost]; SBizzInfo[5][sbProducts]--; SetTimerEx("AfterSpray2", 7500, false, "i", playerid); } else { SendClientMessage(playerid, COLOR_GREY, "Du hast nicht genügend Geld."); } } } else if (IsPlayerInRangeOfPoint(playerid, 4,488.3819,-1733.0563,11.1752)) { // Pay & Spray if(GetPlayerState(playerid) == 2) { if(GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 487.4099,-1741.4585,11.1330); SetVehicleZAngle(tmpcar, 180); SafeGivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]); SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost]; SBizzInfo[5][sbProducts]--; SetTimerEx("AfterSpray3", 7500, false, "i", playerid); } else { SendClientMessage(playerid, COLOR_GREY, "Du hast nicht genügend Geld."); } } } else if (IsPlayerInRangeOfPoint(playerid, 4,719.8940,-464.8272,16.3359)) { // Pay & Spray if(GetPlayerState(playerid) == 2) { if(GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100) { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 720.3924,-456.0286,16.3359); SetVehicleZAngle(tmpcar, 0); SafeGivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]); SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost]; SBizzInfo[5][sbProducts]--; SetTimerEx("AfterSpray4", 7500, false, "i", playerid); } else { SendClientMessage(playerid, COLOR_GREY, "Du hast nicht genügend Geld."); } } } }
    new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /enter",d,m,y,h,mi,s,sendername); CommandLog(string); return 1; }
    if(PRESSED(KEY_SECONDARY_ATTACK)) // ENTER Taste { if(IsPlayerConnected(playerid)) { if(HouseEntered[playerid] != 9999) { new i = HouseEntered[playerid];
    if (IsPlayerInRangeOfPoint(playerid, 3,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz])) { SafeSetPlayerInterior(playerid,0); SafeSetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]); SetPlayerVirtualWorld(playerid,0); PlayerInfo[playerid][pVirWorld] = 0; HouseEntered[playerid] = 9999; if(HouseInfo[i][hHel] == 1) { new Float:tempheal; GetPlayerHealth(playerid,tempheal); if(tempheal < 100.0) { SetPlayerHealth(playerid,100.0); } } return 1; } } if(BizzEntered[playerid] != 9999) { new i = BizzEntered[playerid];
    if (IsPlayerInRangeOfPoint(playerid, 3,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ])) { SafeSetPlayerInterior(playerid,0); SetPlayerVirtualWorld(playerid, 0); OnPlayerExitFood(playerid); SafeSetPlayerPos(playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]); SetPlayerVirtualWorld(playerid, 0); BizzEntered[playerid] = 9999; } } new carid = GetPlayerVehicleID(playerid); if (IsABus(carid)) { TogglePlayerControllable(playerid, 1); SafeRemovePlayerFromVehicle(playerid); if (Busroute2[playerid][0] != 0 || Busroute1[playerid][0] != 0) BusrouteEnd(playerid, carid); } if (IsASweeper(carid)) { TogglePlayerControllable(playerid, 1); SafeRemovePlayerFromVehicle(playerid); } if(IsAHarvest(carid)) { if (carid != 0) { SetVehicleToRespawn(carid); } if(FarmerPickup[playerid][0] >= 1 && FarmerPickup[playerid][0] <= 22) { FarmerPickup[playerid][0]--; } TogglePlayerControllable(playerid, 1); SafeRemovePlayerFromVehicle(playerid); FarmerVar[playerid] = 0; DisablePlayerCheckpoint(playerid);
    } if(IsADrugHarvest(carid)) {
    if(DrugFarmerPickup[playerid][0] >= 1 && DrugFarmerPickup[playerid][0] <= 37) { DrugFarmerPickup[playerid][0]--; } TogglePlayerControllable(playerid, 1); SafeRemovePlayerFromVehicle(playerid); DrugFarmerVar[playerid] = 0; DisablePlayerCheckpoint(playerid); } if(IsASmuggleCar(carid)) { TogglePlayerControllable(playerid, 1); SafeRemovePlayerFromVehicle(playerid); SmugglerWork[playerid] = 0; DisablePlayerCheckpoint(playerid); } if(Decoding[playerid] == 1) { Decoding[playerid] = 0; KillTimer(DecoderTimer); HideDecoder(playerid); SendClientMessage(playerid, COLOR_NICERED, "You left the car, decoder stopped!"); decodecode = 0; Decoder = 0; } if(IsAnOwnableCar(carid) && CarInfo[carid][cOwned] == 0) { TogglePlayerControllable(playerid, 1); SafeRemovePlayerFromVehicle(playerid); } if(IsPlayerInAnyVehicle(playerid) && !engineOn[GetPlayerVehicleID(playerid)] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { TogglePlayerControllable(playerid, 1); SafeRemovePlayerFromVehicle(playerid); } if(GetPlayerVehicleID(playerid) >= 112 && GetPlayerVehicleID(playerid) <= 130 || GetPlayerVehicleID(playerid) >= 135 && GetPlayerVehicleID(playerid) <= 154) { TogglePlayerControllable(playerid, 1); SafeRemovePlayerFromVehicle(playerid); } else if (IsPlayerInRangeOfPoint(playerid, 3,387.7978,173.8582,1008.3828)) { SafeSetPlayerInterior(playerid,0); SafeSetPlayerPos(playerid,1481.0206,-1771.1138,18.7958); PlayerInfo[playerid][pLocal] = 255; } else if (IsPlayerInRangeOfPoint(playerid, 6,-1404.5299,-259.0602,1043.6563)) { SafeSetPlayerInterior(playerid,0); SafeSetPlayerPos(playerid,2695.6235,-1704.6960,11.8438); } else if (IsPlayerInRangeOfPoint(playerid, 8,-1443.0554,-581.1879,1055.0472)) { SafeSetPlayerInterior(playerid,0); SafeSetPlayerPos(playerid,-2111.5686,-443.9720,38.7344); } else if (IsPlayerInRangeOfPoint(playerid, 8,-1464.7732,1557.5533,1052.5313)) { SafeSetPlayerInterior(playerid,0); SafeSetPlayerPos(playerid,-2080.3079,-406.0309,38.7344); } else if(NoFuel[playerid] == 1) { TogglePlayerControllable(playerid, 1); SafeRemovePlayerFromVehicle(playerid); NoFuel[playerid] = 0; } }
    new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /exit",d,m,y,h,mi,s,sendername); CommandLog(string); return 1; }

  • Code
    if(PRESSED(KEY_SECONDARY_ATTACK)) // ENTER Taste
        { // da deinen /enter und /exit Befehl reinkopieren
        }
  • könnte auch einfach auf denn enter befehl verweisen


    if(PRESSED(KEY_SECONDARY_ATTACK)) { OnPlayerCommandText(playerid,"/enter"); }

  • sicherlich ich glaube du kannst die beide rein packen müsste funktionieren...
    if(PRESSED(KEY_SECONDARY_ATTACK)) { OnPlayerCommandText(playerid,"/enter"); OnPlayerCommandText(playerid,"/exit");}