08.11.2012, 14:17
OnPlayerClickPlayer detects when you double click on a player's name on the player list (TAB). To detect dialog pressing, you need to do something like this:
%d or %i - integers in format
%f - floats in format
%s - strings in format
Those are the ones you'll use the most.
pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Weapons", "Rifle\nDeagle", "Purchase", "Close");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1:
{
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 33);
SendClientMessage(playerid, -1, "You have purchased a rifle.");
}
case 1:
{
GivePlayerWeapon(playerid, 24);
SendClientMessage(playerid, -1, "You have purchased a deagle.");
}
}
}
}
return 0;
}
%f - floats in format
%s - strings in format
Those are the ones you'll use the most.