Jump to content
  • 0

Problema Cum sa rezolv?


Pinki95

Question

Vreau ca in loc sa scri /bank sa fie un pickup:

[pawn]COMMAND:bank(playerid, params[])

{

// Setup local variables

new file[100], Name[24];

// Send the command to all admins so they can see it

SendAdminText(playerid, "/bank", params);

    // Get the playername

format(Name, sizeof(Name), APlayerData[playerid][PlayerName]);

// Construct the complete filename for this player's bank-account

format(file, sizeof(file), BankFile, Name);

// Check if the player has logged in

if (APlayerData[playerid][LoggedIn] == true)

{

// Check if the player doesn't have a bank account

if (!fexist(file))

{

// Ask for a password to setup his bank account

ShowPlayerDialog(playerid, DialogBankPasswordRegister, DIALOG_STYLE_INPUT, "Enter password", "Please enter a password to register your bank account:", TXT_DialogButtonSelect, TXT_DialogButtonCancel);

}

else // The player has a bank account

{

// If the player hasn't logged in to his bank account yet

if (APlayerData[playerid][bankLoggedIn] == false)

{

// Ask for the password to login to his bank account

ShowPlayerDialog(playerid, DialogBankPasswordLogin, DIALOG_STYLE_INPUT, "Enter password", "Please enter your password to login to your bank account:", TXT_DialogButtonSelect, TXT_DialogButtonCancel);

}

else // The player has logged in to his bank account already

{

    // Show the main bank menu dialog

ShowBankMenu(playerid);

}

}

}

else

    return 0;

// Let the server know that this was a valid command

return 1;

}[/pawn]

560x95_F01616_1625F2_030303_000000.png
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Buna Ziua,

Deci ca sa inteleg ,vreti ca atunci cand intrati intr-un pickup sa va arate dialogul?

Daca da:

La Inceput

new banklabel;
La OngamemodeInit
banklabel= CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
la OnPlayerPickupPickup
    if(pickupid == banklabel)
// Setup local variables
	new file[100], Name[24];

	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/bank", params);

    // Get the playername
	format(Name, sizeof(Name), APlayerData[playerid][PlayerName]);
	// Construct the complete filename for this player's bank-account
	format(file, sizeof(file), BankFile, Name);

	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Check if the player doesn't have a bank account
		if (!fexist(file))
		{
			// Ask for a password to setup his bank account
			ShowPlayerDialog(playerid, DialogBankPasswordRegister, DIALOG_STYLE_INPUT, "Enter password", "Please enter a password to register your bank account:", TXT_DialogButtonSelect, TXT_DialogButtonCancel);
		}
		else // The player has a bank account
		{
			// If the player hasn't logged in to his bank account yet
			if (APlayerData[playerid][BankLoggedIn] == false)
			{
				// Ask for the password to login to his bank account
				ShowPlayerDialog(playerid, DialogBankPasswordLogin, DIALOG_STYLE_INPUT, "Enter password", "Please enter your password to login to your bank account:", TXT_DialogButtonSelect, TXT_DialogButtonCancel);
			}
			else // The player has logged in to his bank account already
			{
			    // Show the main bank menu dialog
				ShowBankMenu(playerid);
			}
		}
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}
   

Surse:

http://wiki.sa-mp.com/wiki/

M-am lasat de comunitatea sa-mp.ro

Link to comment
Share on other sites

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.