RP script help
#3

You can put more than 300 objects in the server with a streamer.
If your dialogs are not working, maybe the dialogid's are not different.
If you want a rules dialog to show, when a player connects, use this FS - LINK .
If you want a help dialog to show, when a player types /help, use this:
Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Help Dialog", "First item\nSecond item\nThird item", "Select", "Close");
return 1;
}
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
{
switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
{
case 1:// Our dialog!
{
switch(listitem)// Checking which listitem was selected
{
case 0:// The first item listed
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"F irst item","Your text","Close", "");
}
case 1: // The second item listed
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"S econd item","Your text","Close", "");
}
case 2: // The third item listed
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"T hird item","Your text","Close", "");
}
}
}
}
}
return 1;
}

You can also use \n to make a new line. Example:
Quote:

ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"F irst item","Hi!\nYou listed first item!\nNow close!","Close", "");

If you want a rules dialog to show, when a player types /rules, use this:
Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/rules", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Server Rules", "Don't Use Hacks\nDon't Swear\nRespect All Players\nHave Fun!", "Close", "");
return 1;
}
return 0;
}

Hope I helped you!
Reply


Messages In This Thread
RP script help - by jimis - 07.01.2012, 14:42
Re : RP script help - by rbcrp - 07.01.2012, 15:14
Re: RP script help - by naruto_hina - 09.01.2012, 10:05
Re: RP script help - by jimis - 09.01.2012, 11:42

Forum Jump:


Users browsing this thread: 1 Guest(s)