[HELP] dialog
#2

Hello.

At first, you need to make variable with will hold selected id of selected player.
pawn Код:
new myId;
After on, you must do some stuff in OnPlayerClickPlayer callback (which, as I believe, you've already done).

For example:
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
ShowPlayerDialog(2002, DIALOG_STYLE_INPUT, "Give cash", "Give him a cash cus he's so poor and so..", "Give", "No way");
clickedplayerid = myId;
return 1;
}
Then you can do something like this
pawn Код:
if(strlen(inputtext) > 0)
{
new amount;
amount = strval(inputtext);

if(amount <= 0)
{
// If amount is 0 or lower
}
else
{
// If amount is bigger than 0
GivePlayerMoney(myId, amount);
// You can do also some other stuff, like SendClientMessage which says * USERNAME has just given you $x or something.

// Yay, forget to give this one.. :P Just for debug stuff
myId = -1;
}
}
Sorry, I am in hurry a little, and this cody may be a little messy, but I believe You will understand, what I wanted to write

Greetz,
LetsOWN
Reply


Messages In This Thread
[HELP] dialog - by NvidiaForTheWin - 18.12.2012, 18:27
Re: [HELP] dialog - by LetsOWN[PL] - 18.12.2012, 18:39
Re : [HELP] dialog - by NvidiaForTheWin - 18.12.2012, 18:50
Re: [HELP] dialog - by LetsOWN[PL] - 18.12.2012, 18:52
Re : [HELP] dialog - by NvidiaForTheWin - 18.12.2012, 19:03
Re: [HELP] dialog - by LetsOWN[PL] - 18.12.2012, 19:04
Re : [HELP] dialog - by NvidiaForTheWin - 18.12.2012, 19:16
Re: [HELP] dialog - by LetsOWN[PL] - 18.12.2012, 19:19
Re : Re: [HELP] dialog - by NvidiaForTheWin - 18.12.2012, 19:24
Re: [HELP] dialog - by LetsOWN[PL] - 18.12.2012, 19:27

Forum Jump:


Users browsing this thread: 2 Guest(s)