Port Befehl geht nicht...o.ô

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,


    bin ja dabei ein Filterscript + Map zu machen. aber mein Portbefehl geht iwie nicht.!


    if (strcmp(cmdtext,"/adminarea", true) == 0)
    {
    SetPlayerPos(playerid, 753.41674805,-2384.02465820,13.18377209);
    return 1;
    }


    Hier der Code zum porten, beim compilen sagt er mir kein Fehler aber wenn ich im Server /adminarea mache kommt Server: Unknown Command.


    lg

  • Zeig uns mal dein komplettes Filterscript, und deine Server.cfg , denn ich denke du hast die neue .amx nicht ersetzt ?

  • #include <a_samp>


    new admin_weg;
    new admin_weg2;
    new admin_gate;


    public OnFilterScriptInit()
    {
    admin_weg = CreateObject(16610, 834.185546875, -2127.0400390625, -6.8149757385254, 0, 0, 270);
    admin_weg2 = CreateObject(16610, 834.0087890625, -2247.890625, -8.1527976989746, 0, 0, 270);
    CreateObject(11288, 800.0185546875, -2354.9560546875, 3.1195526123047, 0, 0, 1.99951171875);
    CreateObject(17472, 879.48468017578, -2333.9370117188, 10.85572052002, 0, 0, 0);
    CreateObject(17472, 868.94854736328, -2321.9450683594, 13.922161102295, 0, 0, 311.99523925781);
    CreateObject(17472, 891.47686767578, -2356.3693847656, 11.672389984131, 0, 0, 295.99914550781);
    CreateObject(17472, 900.44885253906, -2384.8432617188, 8.5603504180908, 0, 0, 279.99755859375);
    CreateObject(17472, 894.43347167969, -2423.0451660156, 9.3801574707031, 0, 0, 223.99401855469);
    CreateObject(11288, 812.751953125, -2449.404296875, 3.289421081543, 0, 0, 181.99951171875);
    CreateObject(17472, 863.90838623047, -2452.7153320313, 14.81823348999, 0, 0, 223.9892578125);
    CreateObject(17472, 834.65954589844, -2483.7626953125, 10.218467712402, 0, 0, 223.9892578125);
    CreateObject(17472, 809.38134765625, -2503.5693359375, 8.7951145172119, 0, 0, 207.9892578125);
    CreateObject(17472, 769.10858154297, -2505.1555175781, 6.5, 0, 0, 177.98767089844);
    CreateObject(17472, 748.40966796875, -2482.05078125, 8.75, 0, 0, 117.98400878906);
    CreateObject(17472, 726.80480957031, -2454.853515625, 8.914981842041, 0, 0, 117.98217773438);
    CreateObject(17472, 715.69061279297, -2417.9038085938, 9.203685760498, 0, 0, 109.98217773438);
    CreateObject(17472, 720.19799804688, -2381.958984375, 8.3846683502197, 0, 0, 73.978637695313);
    CreateObject(17472, 742.91046142578, -2349.3420410156, 8.9460144042969, 0, 0, 57.976440429688);
    CreateObject(17472, 773.83245849609, -2320.0546875, 8.5506248474121, 0, 0, 49.974853515625);
    CreateObject(17472, 799.38244628906, -2302.6196289063, 8.7582626342773, 0, 0, 33.971313476563);
    CreateObject(5836, 814.03985595703, -2320.6765136719, 24.068225860596, 0, 0, 0);
    admin_gate = CreateObject(980, 834.21765136719, -2306.5932617188, 14.62163734436, 0, 0, 0);
    CreateObject(16089, 834.21112060547, -2306.728515625, 11.848246574402, 0, 0, 88);
    CreateObject(3311,792.34820557,-2343.56127930,14.79237175,0.00000000,0.00000000,40.00000000); //object(sw_woodhaus01a) (1)
    CreateObject(3310,773.64227295,-2359.21093750,13.89393616,0.00000000,0.00000000,130.00000000); //object(sw_woodhaus04) (1)
    CreateObject(3449,759.78332520,-2378.00976562,13.81353378,0.00000000,0.00000000,134.00000000); //object(vegashsenew1) (1)
    //-------------------------------Vehicles-------------------------------------------//
    AddStaticVehicleEx(506,753.41674805,-2384.02465820,13.18377209,44.00000000,-1,-1,15); //Super GT
    AddStaticVehicleEx(541,755.79376221,-2381.68383789,13.09165859,44.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(559,858.51776123,-2355.00366211,12.60799122,173.99969482,3,6,15); //Jester
    print("\n--------------------------------------");
    print("FIlterscript Adminarea © 2010 by Canna");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/weg", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg, 834.18560791016, -2127.0405273438, 15.435024261475, 4);
    return 1;
    }
    if (strcmp("/weg2", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg2, 834.00891113281, -2247.8911132813, 15.347202301025, 4);
    return 1;
    }
    if (strcmp("/agate", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_gate, 834.216796875, -2306.5927734375, 8.6216373443604, 4);
    return 1;
    }
    if (strcmp("/agatezu", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_gate, 834.21765136719, -2306.5932617188, 14.62163734436, 4);
    return 1;
    }
    if (strcmp("/wweg", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg, 834.185546875, -2127.0400390625, -6.8149757385254, 4);
    return 1;
    }
    if (strcmp("/wweg2", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg2, 834.0087890625, -2247.890625, -8.1527976989746, 4);
    return 1;
    }
    if (strcmp(cmdtext,"/adminarea", true) == 0)
    {
    SetPlayerPos(playerid, 753.41674805,-2384.02465820,13.18377209);
    }
    return 0;
    }


  • Gehen die anderen Befehle aus dem Script bzw. lädt der Server das FS beim Starten?

    Moderator der Bereiche: Coding, Vorstellungsrunde und Handelsecke. Über Verwarnungen, falls du zu den Wenigen gehörst, die eine Verwarnung von mir erhalten haben, kannst du jederzeit mit mir reden, sofern der Umgangston stimmt.


    expect us. / unkompetent. Das neue dynamisch. / easy-stripping.net - coming soon! / "9§. the entire website bestands out of english." / Vollprofi in allem, wo gibt und noch mehr; kann auch OOP.
    Kleine Coding-Frage? Schau doch in #dev im IRC vorbei, wir können dir sicher helfen.


    Ich bin für Aufträge im Bereich der Webentwicklung (z.B. User Control Panel) zu haben. Kontaktiere mich diesbezüglich einfach in einer privaten Nachricht mit deinen, möglichst konkreten, Vorstellungen.


    lesen.denken.posten. - [22:54:14] <Goldkiller2> früher gabs immer so coole user da stand in der signatur "lesen.denken.posten."


    Mafia 2 Multiplayer (m2mp.de) - Eine kostenlose Modifikation für Mafia 2, die es, ähnlich wie SAMP, erlaubt über das Internet oder LAN mit bis zu 1000 anderen Spielern zu spielen.

  • Ja die anderen Befehle funktionieren, und das FS lädt er auch o.ô ?(?(

  • if (strcmp("/adminarea", cmdtext, true, 10) == 0)
    {
    SetPlayerPos(playerid, 753.41674805,-2384.02465820,13.18377209);
    }


    Probier es mal so.

  • Hä ?
    Normal müsste das nun gehen...
    Denn bei dem strcmp Command hast du es so geschrieben :


    [FALSCH]if (strcmp(cmdtext,"/adminarea", true) == 0)
    [RICHTIG]if (strcmp("/adminarea", cmdtext, true, 10) == 0)

  • if (strcmp(cmdtext,"/adminarea", true) == 0)
    {
    SetPlayerPos(playerid, 753.41674805,-2384.02465820,13.18377209);
    return 1;
    }


    sollte eigentlich klappen!


    // edit:


    Zitat von Application

    [FALSCH]if (strcmp(cmdtext,"/adminarea", true) == 0)

    funktioniert bei mir einwantfrei...

  • Test CMD
    if (strcmp("/test", cmdtext, true, 10) == 0)


    Richtiger CMD
    if (strcmp("/adminarea", cmdtext, true, 10) == 0)



    Edit:
    Der Test CMD ist wie er aufgebaut ist, in einem Blank Script zu finden, deshalb muss es so richtig sein.

  • Es klappt aber ne :(


    Gibt es vllt noch eine andere Möglichkeit, einen Port zu erstellen.??

  • Muss da nicht ein "return 1;" hin ?



    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/weg", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg, 834.18560791016, -2127.0405273438, 15.435024261475, 4);
    return 1;
    }
    if (strcmp("/weg2", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg2, 834.00891113281, -2247.8911132813, 15.347202301025, 4);
    return 1;
    }
    if (strcmp("/agate", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_gate, 834.216796875, -2306.5927734375, 8.6216373443604, 4);
    return 1;
    }
    if (strcmp("/agatezu", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_gate, 834.21765136719, -2306.5932617188, 14.62163734436, 4);
    return 1;
    }
    if (strcmp("/wweg", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg, 834.185546875, -2127.0400390625, -6.8149757385254, 4);
    return 1;
    }
    if (strcmp("/wweg2", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg2, 834.0087890625, -2247.890625, -8.1527976989746, 4);
    return 1;
    }
    if (strcmp(cmdtext,"/adminarea", true) == 0)
    {
    SetPlayerPos(playerid, 753.41674805,-2384.02465820,13.18377209);
    }
    return 0;
    }



    Edit:


    So komplett überarbeitet :


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/weg", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg, 834.18560791016, -2127.0405273438, 15.435024261475, 4);
    return 1;
    }
    if (strcmp("/weg2", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg2, 834.00891113281, -2247.8911132813, 15.347202301025, 4);
    return 1;
    }
    if (strcmp("/agate", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_gate, 834.216796875, -2306.5927734375, 8.6216373443604, 4);
    return 1;
    }
    if (strcmp("/agatezu", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_gate, 834.21765136719, -2306.5932617188, 14.62163734436, 4);
    return 1;
    }
    if (strcmp("/wweg", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg, 834.185546875, -2127.0400390625, -6.8149757385254, 4);
    return 1;
    }
    if (strcmp("/wweg2", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg2, 834.0087890625, -2247.890625, -8.1527976989746, 4);
    return 1;
    }
    if (strcmp("/adminarea", cmdtext, true, 10) == 0)
    {
    SetPlayerPos(playerid, 753.41674805,-2384.02465820,13.18377209);
    }
    return 1;
    }



    Teste es mal so.

  • Es funktioniert aber immernoch nicht.!


    So sieht mein PAWN-Code jetzt aus:


    #include <a_samp>


    new admin_weg;
    new admin_weg2;
    new admin_gate;


    public OnFilterScriptInit()
    {
    admin_weg = CreateObject(16610, 834.185546875, -2127.0400390625, -6.8149757385254, 0, 0, 270);
    admin_weg2 = CreateObject(16610, 834.0087890625, -2247.890625, -8.1527976989746, 0, 0, 270);
    CreateObject(11288, 800.0185546875, -2354.9560546875, 3.1195526123047, 0, 0, 1.99951171875);
    CreateObject(17472, 879.48468017578, -2333.9370117188, 10.85572052002, 0, 0, 0);
    CreateObject(17472, 868.94854736328, -2321.9450683594, 13.922161102295, 0, 0, 311.99523925781);
    CreateObject(17472, 891.47686767578, -2356.3693847656, 11.672389984131, 0, 0, 295.99914550781);
    CreateObject(17472, 900.44885253906, -2384.8432617188, 8.5603504180908, 0, 0, 279.99755859375);
    CreateObject(17472, 894.43347167969, -2423.0451660156, 9.3801574707031, 0, 0, 223.99401855469);
    CreateObject(11288, 812.751953125, -2449.404296875, 3.289421081543, 0, 0, 181.99951171875);
    CreateObject(17472, 863.90838623047, -2452.7153320313, 14.81823348999, 0, 0, 223.9892578125);
    CreateObject(17472, 834.65954589844, -2483.7626953125, 10.218467712402, 0, 0, 223.9892578125);
    CreateObject(17472, 809.38134765625, -2503.5693359375, 8.7951145172119, 0, 0, 207.9892578125);
    CreateObject(17472, 769.10858154297, -2505.1555175781, 6.5, 0, 0, 177.98767089844);
    CreateObject(17472, 748.40966796875, -2482.05078125, 8.75, 0, 0, 117.98400878906);
    CreateObject(17472, 726.80480957031, -2454.853515625, 8.914981842041, 0, 0, 117.98217773438);
    CreateObject(17472, 715.69061279297, -2417.9038085938, 9.203685760498, 0, 0, 109.98217773438);
    CreateObject(17472, 720.19799804688, -2381.958984375, 8.3846683502197, 0, 0, 73.978637695313);
    CreateObject(17472, 742.91046142578, -2349.3420410156, 8.9460144042969, 0, 0, 57.976440429688);
    CreateObject(17472, 773.83245849609, -2320.0546875, 8.5506248474121, 0, 0, 49.974853515625);
    CreateObject(17472, 799.38244628906, -2302.6196289063, 8.7582626342773, 0, 0, 33.971313476563);
    CreateObject(5836, 814.03985595703, -2320.6765136719, 24.068225860596, 0, 0, 0);
    admin_gate = CreateObject(980, 834.21765136719, -2306.5932617188, 14.62163734436, 0, 0, 0);
    CreateObject(16089, 834.21112060547, -2306.728515625, 11.848246574402, 0, 0, 88);
    CreateObject(3311,792.34820557,-2343.56127930,14.79237175,0.00000000,0.00000000,40.00000000); //object(sw_woodhaus01a) (1)
    CreateObject(3310,773.64227295,-2359.21093750,13.89393616,0.00000000,0.00000000,130.00000000); //object(sw_woodhaus04) (1)
    CreateObject(3449,759.78332520,-2378.00976562,13.81353378,0.00000000,0.00000000,134.00000000); //object(vegashsenew1) (1)
    //-------------------------------Vehicles-------------------------------------------//
    AddStaticVehicleEx(506,753.41674805,-2384.02465820,13.18377209,44.00000000,-1,-1,15); //Super GT
    AddStaticVehicleEx(541,755.79376221,-2381.68383789,13.09165859,44.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(559,858.51776123,-2355.00366211,12.60799122,173.99969482,3,6,15); //Jester
    print("\n--------------------------------------");
    print("FIlterscript Adminarea © 2010 by Canna");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/weg", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg, 834.18560791016, -2127.0405273438, 15.435024261475, 4);
    return 1;
    }
    if (strcmp("/weg2", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg2, 834.00891113281, -2247.8911132813, 15.347202301025, 4);
    return 1;
    }
    if (strcmp("/agate", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_gate, 834.216796875, -2306.5927734375, 8.6216373443604, 4);
    return 1;
    }
    if (strcmp("/agatezu", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_gate, 834.21765136719, -2306.5932617188, 14.62163734436, 4);
    return 1;
    }
    if (strcmp("/wweg", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg, 834.185546875, -2127.0400390625, -6.8149757385254, 4);
    return 1;
    }
    if (strcmp("/wweg2", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg2, 834.0087890625, -2247.890625, -8.1527976989746, 4);
    return 1;
    }
    if (strcmp("/adminarea", cmdtext, true, 10) == 0)
    {
    SetPlayerPos(playerid, 753.41674805,-2384.02465820,13.18377209);
    return 1;
    }
    return 1;
    }

  • joa der return muss türlich da unter set player dingsa :D

  • public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext, "/weg", true) == 0) return MoveObject(admin_weg, 834.18560791016, -2127.0405273438, 15.435024261475, 4);//so muss es überall sein :D


    return 0;
    }

    Kalcor: "... it makes the game look like it's not GTA. This mod is called San Andreas Multiplayer. It's not a custom game engine which you can script..."

  • So sollte es klappen :


    #include <a_samp>


    new admin_weg;
    new admin_weg2;
    new admin_gate;


    public OnFilterScriptInit()
    {
    admin_weg = CreateObject(16610, 834.185546875, -2127.0400390625, -6.8149757385254, 0, 0, 270);
    admin_weg2 = CreateObject(16610, 834.0087890625, -2247.890625, -8.1527976989746, 0, 0, 270);
    CreateObject(11288, 800.0185546875, -2354.9560546875, 3.1195526123047, 0, 0, 1.99951171875);
    CreateObject(17472, 879.48468017578, -2333.9370117188, 10.85572052002, 0, 0, 0);
    CreateObject(17472, 868.94854736328, -2321.9450683594, 13.922161102295, 0, 0, 311.99523925781);
    CreateObject(17472, 891.47686767578, -2356.3693847656, 11.672389984131, 0, 0, 295.99914550781);
    CreateObject(17472, 900.44885253906, -2384.8432617188, 8.5603504180908, 0, 0, 279.99755859375);
    CreateObject(17472, 894.43347167969, -2423.0451660156, 9.3801574707031, 0, 0, 223.99401855469);
    CreateObject(11288, 812.751953125, -2449.404296875, 3.289421081543, 0, 0, 181.99951171875);
    CreateObject(17472, 863.90838623047, -2452.7153320313, 14.81823348999, 0, 0, 223.9892578125);
    CreateObject(17472, 834.65954589844, -2483.7626953125, 10.218467712402, 0, 0, 223.9892578125);
    CreateObject(17472, 809.38134765625, -2503.5693359375, 8.7951145172119, 0, 0, 207.9892578125);
    CreateObject(17472, 769.10858154297, -2505.1555175781, 6.5, 0, 0, 177.98767089844);
    CreateObject(17472, 748.40966796875, -2482.05078125, 8.75, 0, 0, 117.98400878906);
    CreateObject(17472, 726.80480957031, -2454.853515625, 8.914981842041, 0, 0, 117.98217773438);
    CreateObject(17472, 715.69061279297, -2417.9038085938, 9.203685760498, 0, 0, 109.98217773438);
    CreateObject(17472, 720.19799804688, -2381.958984375, 8.3846683502197, 0, 0, 73.978637695313);
    CreateObject(17472, 742.91046142578, -2349.3420410156, 8.9460144042969, 0, 0, 57.976440429688);
    CreateObject(17472, 773.83245849609, -2320.0546875, 8.5506248474121, 0, 0, 49.974853515625);
    CreateObject(17472, 799.38244628906, -2302.6196289063, 8.7582626342773, 0, 0, 33.971313476563);
    CreateObject(5836, 814.03985595703, -2320.6765136719, 24.068225860596, 0, 0, 0);
    admin_gate = CreateObject(980, 834.21765136719, -2306.5932617188, 14.62163734436, 0, 0, 0);
    CreateObject(16089, 834.21112060547, -2306.728515625, 11.848246574402, 0, 0, 88);
    CreateObject(3311,792.34820557,-2343.56127930,14.79237175,0.00000000,0.00000000,40.00000000); //object(sw_woodhaus01a) (1)
    CreateObject(3310,773.64227295,-2359.21093750,13.89393616,0.00000000,0.00000000,130.00000000); //object(sw_woodhaus04) (1)
    CreateObject(3449,759.78332520,-2378.00976562,13.81353378,0.00000000,0.00000000,134.00000000); //object(vegashsenew1) (1)
    //-------------------------------Vehicles-------------------------------------------//
    AddStaticVehicleEx(506,753.41674805,-2384.02465820,13.18377209,44.00000000,-1,-1,15); //Super GT
    AddStaticVehicleEx(541,755.79376221,-2381.68383789,13.09165859,44.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(559,858.51776123,-2355.00366211,12.60799122,173.99969482,3,6,15); //Jester
    print("\n--------------------------------------");
    print("FIlterscript Adminarea © 2010 by Canna");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/weg", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg, 834.18560791016, -2127.0405273438, 15.435024261475, 4);
    return 1;
    }
    if (strcmp("/weg2", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg2, 834.00891113281, -2247.8911132813, 15.347202301025, 4);
    return 1;
    }
    if (strcmp("/agate", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_gate, 834.216796875, -2306.5927734375, 8.6216373443604, 4);
    return 1;
    }
    if (strcmp("/agatezu", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_gate, 834.21765136719, -2306.5932617188, 14.62163734436, 4);
    return 1;
    }
    if (strcmp("/wweg", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg, 834.185546875, -2127.0400390625, -6.8149757385254, 4);
    return 1;
    }
    if (strcmp("/wweg2", cmdtext, true, 10) == 0)
    {
    MoveObject(admin_weg2, 834.0087890625, -2247.890625, -8.1527976989746, 4);
    return 1;
    }
    if (strcmp("/adminarea", cmdtext, true, 10) == 0)
    {
    SetPlayerPos(playerid, 753.41674805,-2384.02465820,13.18377209);
    return 1;
    }
    return 0;
    }



    Edit:
    Atrox was ist denn ?
    Ich finde die Schreibweise ein wenig schwerer , bzw. Unübersichtlicher.

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen