Jump to content
  • 0

pomoc Banka


Michal Kuřátko (_Michael_)

Dotaz

Čaute, mám banku, když vejdu poprvé na pickup vše je jak má, ale když opustím pickup a znovu na něj vejdu menu už se nezobrazí :(

 

public Bank_OnPlayerPickUpPickup(playerid, pickupid)
{
if(IsPlayerInRangeOfPoint(playerid,2,2305.9546,-16.1322,26.7496))
{
 new b = GetPlayerVirtualWorld(playerid)-2;
 SetPlayerPos(playerid,BankInfo[b][biX],BankInfo[b][biY],BankInfo[b][biZ]);
 SetPlayerVirtualWorld(playerid,0);
}
new i = GetPlayerBank(playerid);
if(i != -1)
{
  SetPlayerPos(playerid,2308.6433,-16.2987,26.7496);
  SetPlayerVirtualWorld(playerid,BankInfo[i][vw]);
}
if(IsPlayerInRangeOfPoint(playerid,3,2315.9526,-7.3184,26.7422))
{
 if(!DS[playerid])
 {
	 if(!BankAcc(playerid))
	 {
		 DS[playerid]=true;
		 ShowPlayerDialog(playerid,DIALOGB01,DIALOG_STYLE_MSGBOX,"Banka","Nemáš založený účet.\n Chcete si ho založit za poplatek 20$?","Ano","Ne");
	 }
	 else
	 {
		 DS[playerid]=true;
		 ShowPlayerDialog(playerid,DIALOGB02,DIALOG_STYLE_INPUT,"Banka","Zadej heslo:","Zadat","Cancel");
	 }
 }
}
return 1;
}

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0

použil by som tu ochranu takto:

hore dám:

new bool:ShowedPlayerDialog[MAX_PLAYERS];

vytvorim si stock:

stock ShowPlayerDialogEx(playerid,id,style,a[],b[],c[],d[]){
if(ShowedPlayerDialog[playerid]) return false;
ShowPlayerDialog(playerid,id,style,a,b,c,d);
ShowedPlayerDialog[playerid] = true;
return true;
}

potom showujem dialog takto:

ShowPlayerDialogEx(playerid,DIALOGB01,DIALOG_STYLE_MSGBOX,"Banka","Nemáš založený účet.\n Chcete si ho založit za poplatek 20$?,"Ano","Ne");

v OnDialogResponse spravim toto:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
ShowedPlayerDialog[playerid] = false;
return 1;
}

a ne*riem sa s "ručným" zadávanim DS[playerid], samozrejme na tento účel :) (toto som sa naučil z QWER-ovich scriptov)

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...