Frage Bei Dialog

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
  • if (strcmp("/team", cmdtext, true) == 0)
    {
    ShowPlayerDialog(playerid, Spawn, DIALOG_STYLE_LIST, "Spawn", "Cop\nTerror\nSwat\nGangster\nFrei\nFrei 2", "Auswählen", "Abbrechen");
    return 1;
    }



    Kann Mir mal einer pls helfen
    Wie kann ich das machen das das automatic une befehl beim on kommen sich das öffnet??


    Bitte um hilfe

  • Hi,


    ShowPlayerDialog(playerid, Spawn, DIALOG_STYLE_LIST, "Spawn", "Cop\nTerror\nSwat\nGangster\nFrei\nFrei 2", "Auswählen", "Abbrechen");


    einfach unter OnPlayerConnect einfügen:


    public OnPlayerConnect(playerid)
    {
    ShowPlayerDialog(playerid, Spawn, DIALOG_STYLE_LIST, "Spawn", "Cop\nTerror\nSwat\nGangster\nFrei\nFrei 2", "Auswählen", "Abbrechen");
    return 1;
    }

  • #define FILTERSCRIPT


    #include <a_samp>


    #define Spawn 5


    #if defined FILTERSCRIPT


    public OnFilterScriptInit()
    {
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }


    #else


    main()
    {


    }


    #endif


    public OnGameModeInit()
    {



    return 1;
    }


    public OnGameModeExit()
    {
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Spawn", "Cop\nTerror\nSwat\nGangster\nFrei\nFrei 2", "Auswählen", "Abbrechen");
    return 1;
    }


    public OnPlayerDeath(playerid, killerid, reason)
    {
    return 1;
    }


    public OnVehicleSpawn(vehicleid)
    {
    return 1;
    }


    public OnVehicleDeath(vehicleid, killerid)
    {
    return 1;
    }


    public OnPlayerText(playerid, text[])
    {
    return 1;
    }


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    return 0;
    }


    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    return 1;
    }


    public OnPlayerExitVehicle(playerid, vehicleid)
    {
    return 1;
    }


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    return 1;
    }


    public OnPlayerEnterCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerEnterRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnPlayerLeaveRaceCheckpoint(playerid)
    {
    return 1;
    }


    public OnRconCommand(cmd[])
    {
    return 1;
    }


    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }


    public OnObjectMoved(objectid)
    {
    return 1;
    }


    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }


    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }


    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }


    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }


    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }


    public OnPlayerSelectedMenuRow(playerid, row)
    {
    return 1;
    }


    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }


    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }


    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }


    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }


    public OnPlayerUpdate(playerid)
    {
    return 1;
    }


    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }


    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }


    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == 5)
    {
    if(response)
    {
    if(listitem == 0)
    {
    SetPlayerPos(playerid,218.4359,1905.2633,17.7016);
    SetPlayerSkin(playerid,285);
    }
    if(listitem == 1)
    {
    SetPlayerPos(playerid,-228.9177,2602.8569,62.7031);
    SetPlayerSkin(playerid,250);
    }
    if(listitem == 2)
    {
    SetPlayerPos(playerid,-312.4494,1534.5494,75.5625);
    SetPlayerSkin(playerid,186);
    }
    if(listitem == 3)
    {
    SetPlayerPos(playerid,-297.8937,1099.0570,19.5938);
    SetPlayerSkin(playerid,221);
    }
    if(listitem == 4)
    {
    SetPlayerPos(playerid,-786.1680,1440.1334,13.7891);
    SetPlayerSkin(playerid,113);
    }
    if(listitem == 5)
    {
    SetPlayerPos(playerid,-1497.3909,2666.0513,55.6875);
    SetPlayerSkin(playerid,73);
    }
    }
    }
    return 1;
    }


    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }


    Habe das so jetz aber der menu geht auf aber es passiert nichs wenn ich es auswähle
    habe mehrere dialoge darum habe ich die zahl 5 gennomen es geht aber nicht!!!
    Bitte um weitere Hilfe Pls

  • Zitat

    public OnPlayerSpawn(playerid)
    {
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Spawn", "Cop\nTerror\nSwat\nGangster\nFrei\nFrei 2", "Auswählen", "Abbrechen");
    return 1;
    }


    Das machste nicht unter "OnPlayerSpawn" sondern unter "OnPlayerConnect"


    Also so:
    public OnPlayerConnect(playerid)
    {
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Spawn", "Cop\nTerror\nSwat\nGangster\nFrei\nFrei 2", "Auswählen", "Abbrechen");
    return 1;
    }


    Das ganze sollte am besten schlussendlich so aussehen:


    Unter OnPlayerConnect nicht unter OnPlayerSpawn:
    public OnPlayerConnect(playerid)
    {
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Spawn", "Cop\nTerror\nSwat\nGangster\nFrei\nFrei 2", "Auswählen", "Abbrechen");
    return 1;
    }


    und das unter OnDialogResponse sollte so aussehen:
    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == 5)
    {
    if(response)
    {
    if(listitem == 0)
    {
    // SetSpawnInfo(playerid,Team,Skin,X,Y,Z,A,Waffe1,Ammo1,Waffe2,Ammo2,Waffe3,Ammo3);
    SetSpawnInfo(playerid,1,285,218.4359,1905.2633,17.7016,0,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    }
    if(listitem == 1)
    {
    SetSpawnInfo(playerid,2,250,-228.9177,2602.8569,62.7031,0,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    }
    if(listitem == 2)
    {
    SetSpawnInfo(playerid,3,186,-312.4494,1534.5494,75.5625,0,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    }
    if(listitem == 3)
    {
    SetSpawnInfo(playerid,4,221,-297.8937,1099.0570,19.5938,0,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    }
    if(listitem == 4)
    {
    SetSpawnInfo(playerid,5,113,-786.1680,1440.1334,13.7891,0,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    }
    if(listitem == 5)
    {
    SetSpawnInfo(playerid,6,73,-1497.3909,2666.0513,55.6875,0,0,0,0,0,0,0);
    SpawnPlayer(playerid);
    }
    }
    else
    {
    Kick(playerid); // Einfach die Abfrage mit "else" wegnehmen, wenn du nicht möchtest dass er gekickt wird
    }
    }
    return 1;
    }


    hoffe konnte helfen!


    MFG luckyguy

  • danke

    3 Mal editiert, zuletzt von Bushido and kay one ()