18.12.2012, 18:39
Hello.
At first, you need to make variable with will hold selected id of selected player.
After on, you must do some stuff in OnPlayerClickPlayer callback (which, as I believe, you've already done).
For example:
Then you can do something like this
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
At first, you need to make variable with will hold selected id of selected player.
pawn Код:
new myId;
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;
}
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;
}
}
Greetz,
LetsOWN