Jump to content
  • 0

pomoc Dialog


Kluci

Dotaz

Dobrý den potřeboval bych pomoct stímhle:

 

#include <a_samp>
 
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/dzbrane", cmdtext, true, 10) == 0)
{
        ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"Zbraně","Raketomet","Vybrat","Zavřít");
return 1;
}
return 0;
}
 
Potřeboval bych poradit jak udělám když zvolí raketomet tak mu ho dá.
 
Díky předem.

 

 

 

Link to comment
Share on other sites

11 odpovědí na tuto otázku

Recommended Posts

  • 0
#include <a_samp>
 
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/dzbrane", cmdtext, true, 10) == 0)
{
        ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"Zbraně","Raketomet","Vybrat","Zavřít");

        GivePlayerWeapon(playerid, 35, 20); // 35 - ID zbrane , 20 počet nábojov 

return 1;
}
return 0;
}
 
Tu nájdeš ID ZBRANI http://wiki.sa-mp.com/wiki/Weapons ak niečo ešte budeš potrebovať pomôžem ti :)
Link to comment
Share on other sites

  • 0


public OnDialogResponse (playerid, dialogid, response, listitem, inputtext [])
{
switch (dialogid)
{
case 100:
{
if (response)
{
switch (listitem)
{
case 0: GivePlayerWeapon (playerid, 35, 20); //20 si zmen na pocet nabojov
}
}
}
}
return true;
}

 

Link to comment
Share on other sites

  • 0

#include <a_samp>

#pragma tabsize 0 // aby si nemusel tabovať

#define COLOR_ORANGE 0xEC7600FF //definicia farby pre správu

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/dzbrane", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"Zbraně","Raketomet","Vybrat","Zavřít");
return 1;
}
return 0;
}

public OnDialogResponse (playerid, dialogid, response, listitem, inputtext [])
{
switch (dialogid)
{
case 100:
{
if (response) GivePlayerWeapon (playerid, 35, 20);
SendClientMessage(playerid, COLOR_ORANGE, " Dostal si 20 raketometov");
}
}
return true;
}

Link to comment
Share on other sites

  • 0

Díky


Hlásí mě to chybu : only a single statement (or expression) can follow each "case"


Bezva teď mě to vůbec nejde :(


Ne dobrý už to jede moc díky :)


A jak udělám aby tam bylo více zbraní??Třeba raketomet a brokovnice??? nejde mě to :(

Link to comment
Share on other sites

  • 0

public OnDialogResponse (playerid, dialogid, response, listitem, inputtext [])
{
switch (dialogid)
{
case 100:
{
if (response)
{
switch (listitem)
{
case 0: GivePlayerWeapon (playerid, 35, 20); //20 si zmen na pocet nabojov
case 1: GivePlayerWeapon (playerid, 34, 20);
...
}
}
}
}
return true;
}
Link to comment
Share on other sites

  • 0
#include <a_samp>
#define COLOR_ORANGE 0xEC7600FF 

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/dzbrane", cmdtext, true, 10) == 0)
	{
	    ShowPlayerDialog(playerid,100,DIALOG_STYLE_LIST,"Zbraně By Kluci","Raketomet","Brokovnice","Plamenomet","M4Samopal","Sniperka","Uzi","Vybrat","Zavřít");
        return 1;
	}
	return 0;
}
public OnDialogResponse (playerid, dialogid, response, listitem, inputtext [])
{
    switch (dialogid)
    {
        case 100:
	{
	    if (response)
            {
                switch (listitem)
                {
                    case 0: GivePlayerWeapon (playerid, 35, 9999);
                	case 2: GivePlayerWeapon (playerid, 37, 9999);
                    case 3: GivePlayerWeapon (playerid, 31, 9999);
                    case 4: GivePlayerWeapon (playerid, 34, 9999);
                    case 5: GivePlayerWeapon (playerid, 28, 9999);
	        }
            }
        }
    }
    return true;
}

Nevíte proč mi to zobrazuje jenom ten raketomet a ty zbivající zbraně jsou na těch dvou tlačítkách?

Link to comment
Share on other sites

  • 0
  • Globální moderátor

Ban

Uživatel zabanován za multiacc, obcházel znemožnění přispívat na 1 den. Takže problém vyřešen

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...