SA-MP Forums Archive
invite 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: invite help (/showthread.php?tid=132373)



invite help - bartje01 - 07.03.2010

Hey guys. I have a script that invites people to the PD.
But the dialog only shows up when I do it on myself.
Please help
script:
Код:
#include <a_samp>

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define DIALOGID 9122

public OnPlayerCommandText( playerid, cmdtext[] )
{

  dcmd(pdinvite, 8, cmdtext);

  return 0;
}

dcmd_pdinvite(playerid, params[]) {

	new skin;
	skin = GetPlayerSkin(playerid);
	if(skin != 288) return SendClientMessage(playerid, 0x2641FEAA, "You are not a chief");

	new target;
 	target = strval(params);

	if(!params[0]) return SendClientMessage(playerid, 0x2641FEAA, "ERROR: /pdinvite <playerid>");
	if(target == playerid)
	ShowPlayerDialog(target, 300, DIALOG_STYLE_LIST, "Help", "YES\nNO", "Select", "Cancel");
 	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])


 if(dialogid == 300 && response)
	{

		switch(listitem)
	  {
			case 1:
	    {
      SetPlayerColor(playerid,0x2641FEAA);
			}

			case 0:
	    {
      SendClientMessage(playerid, 0x33AA33AA, "You canceled. Was it a mistake? Ask again.");

			}
	}




 }