Dialog for a command
#1

Hey again ! I have this command ;

Код:
         if (strcmp(cmdtext, "/lawbook", true) == 0)
        {
 			new jstring[128];
    		new playername[MAX_PLAYER_NAME];
    		GetPlayerName(playerid, playername, sizeof(playername));
    		format(jstring, sizeof(jstring), "| [ {B4B5B7}%s {FF6347}] {B4B5B7}is reading {FF6347}/Lawbook |", playername);
    		SendClientMessageToAll(COLOR_LIGHTRED, jstring);
            SendClientMessage(playerid, COLOR_LIGHTRED,".:: {B4B5B7}Any form of Hacking / Cheating is {FF6347}NOT {B4B5B7}tolerated here! {FF6347}::.");
            SendClientMessage(playerid, COLOR_LIGHTRED,".:: {B4B5B7}Hacking will result in a {FF6347}BAN ::.");
                SendClientMessage(playerid, COLOR_LIGHTRED,".:: {B4B5B7}Respect each and every person! That means {FF6347}EVERYONE ::.");
                SendClientMessage(playerid, COLOR_LIGHTRED,".:: {B4B5B7}No DeathMatching! DM will result in {FF6347}Jail {B4B5B7}or {FF6347}Kick ::.");
                SendClientMessage(playerid, COLOR_LIGHTRED,".:: {B4B5B7}Always respect the Admin's decision! {FF6347}::.");
                SendClientMessage(playerid, COLOR_LIGHTRED,".:: {B4B5B7} DriftUnitZ is hosted by {FF6347}[{B4B5B7}Cir.Cuz{FF6347}] {B4B5B7}AKA {FF6347}[{B4B5B7}Kudoz{FF6347}] and owned by himself and {FF6347}[{B4B5B7}VeilSide{FF6347}] {FF6347}::.");
                SendClientMessage(playerid, COLOR_LIGHTRED, " .:: {B4B5B7}THIS SERVER AND SCRIPTS BELONGS TO THE OWNER {FF6347}[{B4B5B7}Cir.Cuz{FF6347}] {B4B5B7}AKA {FF6347}[{B4B5B7}Kudoz{FF6347}]! ::.");
                SendClientMessage(playerid, COLOR_LIGHTRED, " .:: ^{B4B5B7}EXCEPTIONS ARE LOCATED IN /CREDITS {FF6347}^ ! ::.");
                SendClientMessage(playerid, COLOR_LIGHTRED,".:: {B4B5B7}Now go out the and have fun! :) ::.");
                SendClientMessage(playerid, COLOR_LIGHTRED,".:: {B4B5B7}Sincerely , {FF6347}[{B4B5B7}Cir.Cuz{FF6347}] ::.");
                return 1;
        }
and I need this to be in a dialog, but also the first line to be SendClientMessage. Then I mean, I want the line "%s is reading /lawbook" as SendClientMessage, but the rest in dialog. How can I do this?
Reply
#2

I would have scripted the dialogue,but I want to do it on your own.This is the only way to learn how to do it.I will help you a little with sharing this:
PHP код:
if (strcmp("/lawbook"cmdtexttrue10) == 0)
    {
        
ShowPlayerDialog(playerid,5000,DIALOG_STYLE_MSGBOX,"Tittle","Text,"OK","");
        return 1;
    } 
PHP код:
if (strcmp("/lawbook"cmdtexttrue10) == 0)
    {
        
ShowPlayerDialog(playerid,5000,DIALOG_STYLE_MSGBOX,"Lawbook","Yes i am the boss here","OK","");
        return 
1;
    } 
Reply
#3

PHP код:
if (strcmp(cmdtext"/lawbook"true) == 0)
        {
         new 
jstring[128];
            new 
playername[MAX_PLAYER_NAME];
            
GetPlayerName(playeridplayernamesizeof(playername));
            
format(jstringsizeof(jstring), "| [ {B4B5B7}%s {FF6347}] {B4B5B7}is reading {FF6347}/Lawbook |"playername);
            
ShowPlayerDialog(playerid,5000,DIALOG_STYLE_MSGBOX,"Lawbook","TEXT","OK","");
                return 
1;
        } 
Sorry i gave you a wrong code,but I am a newbie scripter.I just wanted to help.
Reply
#4

Thank you very much!
About the SendClientMessage thing, I'll just put it right above that one? As they say that they're reading /Lawbook.

[EDIT]

Didn't see your 2nd post! Thanks mate, you helped me Alot!
TYVM!
Reply
#5

Hhmm,let me guess..Its an RolePlaying gamemode?So once you open your server and the player type /lawbook,on the chatbox we will see *NAME is reading the lawbook (something like /do or /me?)?
If i am right,then just place it before ShowPlayerDialog
Reply
#6

Yea thanks! But I have 1 problem.. When I log in to my server, there is an dialog too, where I have to register/Login. And when I open the /Lawbook dialog, and press Accept, I have to type in my password again.. How can I fix this? It's in 2 different scripts btw. This goes to the gamemode, and the other one is in the Admin script.
Reply
#7

I didnt understand clearly.So you got an Login/register dialogue if I am not mistaken.Have you placed /lawbook command under "OnPlayerConnect"? Can you explain it again please?
Reply
#8

/lawbook is under OnPlayerCommandText, and the login/register is under OnPlayerConnect. And when I'm logged in and playing like always, its ok, but when I type /lawbook , the lawbook dialog opens, and I press Accept, I have to login again, like, type in my password.
Reply
#9

Well, they're obviously conflicting eachother. someone told me it's because the login/register is a FS inside the adminscript, and the /Rules is in the GM. How can I fix this?
Reply
#10

I am not sure,can you please try to:
  1. Change the button from "Agree" to "OK" or something else
  2. Change the dialog id (5000) to something other (Why?Because in my opinion there is somewhere in your script,something like "OnPlayerDialogReponse",which is redirecting you to the register dialog.)
You will ask me what i mean.I mean that,on my server,while connecting,before login dialogue is Displayed,i got my Server Terms and Conditions dialogue,with two buttons,"Accept" and "Decline".Clicking accept will re-direct you to login dialogue,while clicking "Decline" will kick you from the server,sending an Client Message "You didnt accept the server rules,so you have been kicked".

Hope you understand what I mean.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)