16.10.2010, 03:11
Show the player who types it the Dialog or the one whos close enough?
Heres just a base line of it, as you said you can do the rest.
First it starts a new command called sellweapons.
It assigns some variables to be used, and checks if the input from the command matches. Such as the user id.
Then gets the players pos, and checks if your close enough.
Then Shows the dialog to the one who typed it. (Just change the playerid in the dialog to userid if its the other way around)
Heres just a base line of it, as you said you can do the rest.
pawn Код:
COMMAND:sellweapons(playerid, params[]) {
new userid, Float:x, Float:y, Float:z;
if (sscanf(params, "i", userid)) return SendClientMessage(playerid, COLOR_RED, "/sellweapons <playerid>");
GetPlayerPos(userid, x, y, z);
if (!IsPlayerInRangeOfPoint(playerid, 4, x, y, z)) return SendClientMessage(playerid, COLOR_RED, "Not close enough!");
//Any other checks here..such as team, admin etc...
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Selling Weapons", "Choose a weapon\none\two", "Ok", "Cancel");
return 1;
}
It assigns some variables to be used, and checks if the input from the command matches. Such as the user id.
Then gets the players pos, and checks if your close enough.
Then Shows the dialog to the one who typed it. (Just change the playerid in the dialog to userid if its the other way around)