Jump to content
  • 0

pomoc Dialogy


MrBeNy

Dotaz

Zdravim,

Chtel bych tu poprosit jestly by nekdo neukazal +- jak by mel vypadat dialog pro povolani ... protoze ja mam jen menu a vubec nechapu ty Dialogy tak jestly by to tu nekdo mohl napsat abych se podival a snad pak bych to pochopil...

Predem diky MrBeNy

 

Ukazka jak mam udelane povolani ja:

 

new policie, Menu:policiem;
policie = CreatePickup(1581,1,2281.8655,2431.1155,10.8203);
policiem= CreateMenu("~b~P~w~olicie", 1, 150.0, 100.0, 250.0, 150.0);
AddMenuItem(policiem, 0, "Zamestnat se");
AddMenuItem(policiem, 0, "Konec");

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == policie)
{
ShowMenuForPlayer(policiem,playerid);
}

public OnPlayerSpawn(playerid)
{
if(povolani[playerid] == 1){//povolani policajta
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 3, 1);
GivePlayerWeapon(playerid, 25, 1000);
GivePlayerWeapon(playerid, 24, 1000);
SetPlayerSkin(playerid,281);
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2296.9258,2468.3110,10.8203);
SetPlayerColor(playerid,COLOR_LIGHTBLUE);
}

public OnPlayerSelectedMenuRow(playerid, row)
{
new string[256];
new Menu:Current = GetPlayerMenu(playerid);
if (Current == policiem ) {
switch(row) {
case 0:{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
if(obcanka[playerid] != 1) return  SendClientMessage(playerid,  0xFF0000AA, "Nemáš obcanku");
format(string, sizeof(string), " [ Zamestnani ]Hráč %s se zamestnal u policie", pname);
SendClientMessageToAll(COLOR_ORANGE, string);
printf(string);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 3, 1);
GivePlayerWeapon(playerid, 25, 1000);
GivePlayerWeapon(playerid, 24, 1000);
povolani[playerid] = 1;
SetPlayerSkin(playerid, 281);
SetPlayerColor(playerid,COLOR_LIGHTBLUE);
}
}
}

Link to comment
Share on other sites

2 odpovědí na tuto otázku

Recommended Posts

  • 0

nevim co natom nechapeš mas 3 typy dialogu ...na povolani treba DIALOG_STYLE_MSGBOX.... do publicu OnPlayerPickupPickup daš misto ShowMenuForPlayer(policiem,playerid);

==>

ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Zaměstnání","Policie - klik na zaměstnat\nse zaměstnáš","Zaměstnat","Nic"); // 1 znamena id dialogu,styl dialogu.....

a misto public OnPlayerSelectedMenuRow(playerid, row)uděláš public OnDialogResponse

 

viewtopic.php?f=8&t=5493&st=0&sk=t&sd=a&hilit=STYLE_MSGBOX //podle mě je to celkem vysvětlený

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...