please help... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: please help... (
/showthread.php?tid=183558)
please help... -
[Lsrcr]Rafa - 16.10.2010
guys i want when some player will tupe /sellweapons [id] to show dialog on other player who is near him 10.0metters

just show me the way how to start and ill make the dialog with the weapons
Re: please help... -
mrmuffins - 16.10.2010
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.
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;
}
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)
Re: please help... -
[Lsrcr]Rafa - 17.10.2010
well i think it is simple but ...

btw where i need to put this and tell me what i need other stuff (dialog, ..... ? )
Thanks.
Re: please help... -
legodude - 17.10.2010
rafa you are copycatting lsrcr right

well.maybeu shudmake ur own ideas.
ontopic
wiki.sa-mp.com/wiki/ShowPlayerDialog
wiki.sa-mp.com/wiki/GetPlayerPos
wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint
wiki.sa-mp.com/wiki/OnDialogResponse
and fix it yourself
and please don't make topicsbout the same 4minutes after eachother
Re: please help... -
[Lsrcr]Rafa - 17.10.2010
lol copying lsrcr i dont even thing about that omfg O_O
that am asking just to learn how to script...