SA-MP Forums Archive
ShowPlayerDialog - 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)
+--- Thread: ShowPlayerDialog (/showthread.php?tid=409866)



ShowPlayerDialog - Kudoz - 23.01.2013

Hello! I just need a little help!

I want a cmd for admins, so they can do /showrules [id].
That means the admin force another player to read the "rulesdialog".

Is this almost like a kick cmd? With a TargetId and stuff?

my rulesdialog:

Код:
 ShowPlayerDialog(playerid,DIALOG_WELCOME,DIALOG_STYLE_MSGBOX,"{FF6347}DriftUnitz RULES","{B4B5B7}Hacking or {FF6347}ANY {B4B5B7}other form of cheat is NOT tolerated here!\nHacking equals{FF6347}BAN! NO exceptions.\n{B4B5B7}No DeathMatching! Will result in jail. \nRespect EVERYONE!\nDon't Ask For {FF6347}[Admin] {B4B5B7}Status","OK","OK");



Re: ShowPlayerDialog - FUNExtreme - 23.01.2013

Quote:
Originally Posted by Kudoz
Посмотреть сообщение
Hello! I just need a little help!
Is this almost like a kick cmd? With a TargetId and stuff?
Exactly, instaid of showing it to playerid (the admin who typed the command). You show it to the targetid.

Because of the way you asked the question I suppose you know how to make it now you know this.


Re: ShowPlayerDialog - antonio112 - 23.01.2013

pawn Код:
CMD:showrules(playerid, params[])
{
    new pID;
    if(sscanf(params, "u", pID))
        return SendClientMessage(playerid, -1, "Usage: /showrules [PlayerID]");
    if(!IsPlayerConnected(pID))
        return SendClientMessage(playerid, -1, "Selected player is not CONNECTED.");
   
    SendClientMessage(playerid, -1, "Rules dialog processed.");
    ShowPlayerDialog(pID,DIALOG_WELCOME,DIALOG_STYLE_MSGBOX,"{FF6347}DriftUnitz RULES","{B4B5B7}Hacking or {FF6347}ANY {B4B5B7}other form of cheat is NOT tolerated here!\nHacking equals{FF6347}BAN! NO exceptions.\n{B4B5B7}No DeathMatching! Will result in jail. \nRespect EVERYONE!\nDon't Ask For {FF6347}[Admin] {B4B5B7}Status","OK","OK");
    return 1;
}



Re: ShowPlayerDialog - Kudoz - 23.01.2013

Alright, thanks! I'ma try now, and I'll be back if I can't get it working, Lol


EDIT:
Didnt see the other post. Thanks!
but 1 problem, i changed to dcmd_showrules.

Код:
 C:\Users\daniel\Desktop\DriftUnitZ\filterscripts\LuxAdmin.pwn(12246) : warning 203: symbol is never used: "dcmd_showrules"
??


Re: ShowPlayerDialog - -=Dar[K]Lord=- - 23.01.2013

Just use the ZCMD include

pawn Код:
CMD:showrules(playerid,params[])
{
      if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xFF0000FF,"[ERROR]:- You Are not a rcon admin!");
      new player = strval(params):
      if(sscanf(params,"u",player))return SendClientMessage(playerid,0xFF0000FF,"[Useage]:- /showrules [id]");
      ShowPlayerDialog(player,DIALOG_WELCOME,DIALOG_STYLE_MSGBOX,"{FF6347}DriftUnitz RULES","{B4B5B7}Hacking or {FF6347}ANY {B4B5B7}other form of cheat is NOT tolerated here!\nHacking equals{FF6347}BAN! NO exceptions.\n{B4B5B7}No DeathMatching! Will result in jail. \nRespect EVERYONE!\nDon't Ask For {FF6347}[Admin] {B4B5B7}Status","OK","OK");
      new string[100];
      format(string,sizeof(string),"You Have Forced Id %d to see rules!",player);
      SendClientMessage(playerid,-1,string);
      return 1;
}
EDIT :- Lol is it true that i am slow

@antonio112 he wants the cmd for admin lol

put these lines if you are using dcmd in onplayercommandtext

pawn Код:
dcmd(showrules,9,cmdtext);



Re: ShowPlayerDialog - antonio112 - 23.01.2013

I have no clue what his admin variable is ... That's why I didn't make it for admin.


Re: ShowPlayerDialog - Kudoz - 23.01.2013

Код:
 C:\Users\daniel\Desktop\DriftUnitZ\filterscripts\LuxAdmin.pwn(5098) : error 001: expected token: ";", but found ":"
C:\Users\daniel\Desktop\DriftUnitZ\filterscripts\LuxAdmin.pwn(5098) : error 029: invalid expression, assumed zero
C:\Users\daniel\Desktop\DriftUnitZ\filterscripts\LuxAdmin.pwn(5098 -- 5099) : warning 215: expression has no effect
C:\Users\daniel\Desktop\DriftUnitZ\filterscripts\LuxAdmin.pwn(5099) : error 001: expected token: ";", but found "if"
C:\Users\daniel\Desktop\DriftUnitZ\filterscripts\LuxAdmin.pwn(5099) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
here:
Код:
dcmd_showrules(playerid,params[])
{
      if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,0xFF0000FF,"[ERROR]:- You Are not a rcon admin!");
      new player = strval(params):
      if(sscanf(params,"u",player))return SendClientMessage(playerid,0xFF0000FF,"[Usage]:- /showrules [id]");
      ShowPlayerDialog(player,DIALOG_WELCOME,DIALOG_STYLE_MSGBOX,"{FF6347}DriftUnitz RULES","{B4B5B7}Hacking or {FF6347}ANY {B4B5B7}other form of cheat is NOT tolerated here!\nHacking equals{FF6347}BAN! NO exceptions.\n{B4B5B7}No DeathMatching! Will result in jail. \nRespect EVERYONE!\nDon't Ask For {FF6347}[Admin] {B4B5B7}Status","OK","OK");
      new jstring[128];
	  new AdminName[MAX_PLAYER_NAME];
	  new Target[MAX_PLAYER_NAME];
	  GetPlayerName(playerid, playername, sizeof(playername));
	  format(jstring, sizeof(jstring), ".: [{B4B5B7}Admin{9ACD32}] ( {B4B5B7}%s {9ACD32}) {B4B5B7}has showed the Rules to {9ACD32}( {B4B5B7}%s {9ACD32}) {9ACD32}:.", AdminName, Target);
	  SendClientMessageToAll(COLOR_GREEN, jstring);
      return 1;
}
the errors is on these 2 line:
Код:
 new player = strval(params):
      if(sscanf(params,"u",player))return SendClientMessage(playerid,0xFF0000FF,"[Usage]:- /showrules [id]");



Re: ShowPlayerDialog - antonio112 - 23.01.2013

Well, change the ":" with ";" ... Can't be that hard to understand the error line.


Re: ShowPlayerDialog - Kudoz - 23.01.2013

I did so.
I fixed some failed shit with the GetPlayerName too, and now its this:
Код:
 C:\Users\daniel\Desktop\DriftUnitZ\filterscripts\LuxAdmin.pwn(5100) : error 017: undefined symbol "sscanf"
C:\Users\daniel\Desktop\DriftUnitZ\filterscripts\LuxAdmin.pwn(5105) : error 017: undefined symbol "id"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: ShowPlayerDialog - Kudoz - 23.01.2013

Fixed!