Szerző Téma: Dialogból szétválasztottra  (Megtekintve 871 alkalommal)

Dialogból szétválasztottra
« Dátum: 2015. Május 02. - 20:12:07 »
0 Show voters
Van egy fs-em, az objektid-t / felrak [VALAMI]-vel kéne.
Kód:
 

#include <a_samp>
#define DIALOG_FELRAK 678
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Panzerfaust inkuming\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#endif
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/macska\", cmdtext, true, 10) == 0)
{
    SetPlayerAttachedObject(playerid, 7, 19142,  1, 0.1,  0.05, 0.0,  0.0,   0.0,   0.0);
    EditAttachedObject(playerid, 7);
return 1;
}
if(!strcmp(cmdtext, \"/felrak\", true, 7)) // 7 hosszú a /felrak
    {
        ShowPlayerDialog(playerid,DIALOG_FELRAK, DIALOG_STYLE_INPUT, \"Attacholó.sz*r.exe\", \"{FF0000}OBJEKTID:\", \"Felvesz\", \"Mégse\");
        return 1;
    }
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_FELRAK)
    {
        if(!response) // Mégse
        {
        }
        else // Felrakja
        {
            SetPlayerAttachedObject(playerid, 7, strval(inputtext),  1, 0.1,  0.05, 0.0,  0.0,   0.0,   0.0);
       EditAttachedObject(playerid, 7);
        }
        return 1;
    }
    return 0;
}
« Utoljára szerkesztve: 2015. Május 02. - 20:35:50 írta ƒlaﻛh »

Dialogból szétválasztottra
« Válasz #1 Dátum: 2015. Május 02. - 22:35:04 »
+1 Show voters
Ebből aztán sok mindent meg tudtunk. Mit is szeretnél pontosan?

Nem elérhető Tomasz

  • 123
    • Profil megtekintése
Dialogból szétválasztottra
« Válasz #2 Dátum: 2015. Május 03. - 12:47:45 »
0 Show voters
Paraméteresre akarja megcsinálni a parancsot. Szóval ne egy dialog jelenjen meg hanem egy paramétert kelljen beírni a parancs után.

Nem elérhető BVZS

  • 487
    • Profil megtekintése
Dialogból szétválasztottra
« Válasz #3 Dátum: 2015. Május 03. - 17:08:20 »
+1 Show voters
Így gondolod?
 
#include <zcmd>
CMD:felrak(playerid, params[])
{
    new alparancs[16];
if(sscanf(params, \"s[16]\", alparancs)) SendClientMessage(playerid,-1,\"/felrak [macska]\");
else {
    if(strcmp(alparancs,\"macska\",true) == 0)
   {
       SetPlayerAttachedObject(playerid, 7, 19142,  1, 0.1,  0.05, 0.0,  0.0,   0.0,   0.0);
            EditAttachedObject(playerid, 7);
            return 1;
   }
}
return 1;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal