Command /help in dialog
#1

I want to have /help command in dialog... like this:


Here is my /help command:

Код:
if(strcmp(cmd, "/help", true) == 0 || strcmp(cmd, "/komande", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    SendClientMessage(playerid, NICERED,"** VAS NALOG ** {FFFFFF}/rules(pravila) /stats /kupilevel /upgrade");
			SendClientMessage(playerid, NICERED,"** GENERALNO ** {FFFFFF}/pay /charity /time /kupi /unrentcar /pice /pokazidozvole /kupiodjecu /fuel /v");
			SendClientMessage(playerid, NICERED,"** GENERALNO ** {FFFFFF}/resetupgrades(100k) /oruzje /lock /skill /portable /dozvole /spawnchange /mo");
			SendClientMessage(playerid, NICERED,"** GENERALNO ** {FFFFFF}/report /cancel /prihvati /eject /usedrugs /contract /fill /fillcar /clear /service /pl");
	  		SendClientMessage(playerid, NICERED,"** CHAT ** {FFFFFF}(/w)hisper (/o)oc (/s)hout (/c)lose (/l)ocal (/b) (/ad)vertise (/f)amily /me /le");
			SendClientMessage(playerid, NICERED,"** BANKA ** {FFFFFF}/balance /withdraw /deposit /wiretransfer");
			if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
			{
   				SendClientMessage(playerid, ZELENKASTA, "*** LSPD *** {FFFFFF}(/r)adio (/d)epartments (/m)egaphone (/su)spect /mdc /uhapsi /duznost /osumnjiceni /cuff /uncuff /undercover");
				SendClientMessage(playerid, ZELENKASTA, "*** LSPD *** {FFFFFF}/bk /bkc /pretresi /oduzmi /kazna /gov /area51 /provali /ubaci /odvezipolicajca /pokaziznacku");
				SendClientMessage(playerid, ZELENKASTA, "*** LSPD *** {FFFFFF}/tazeron /tazeroff /sirenon /sirenoff /tracelastcall(/tlc) /weplicense");
				SendClientMessage(playerid, ZELENKASTA, "*** LSPD *** {FFFFFF}/otvori /zatvori /dooropen /doorclose /pdo /pdz /roadblock(/rb) /roadunblock(/rrb) /roadunblockall(/rrball)");
   			}
   			if(PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2)
			{
   				SendClientMessage(playerid, ZELENKASTA, "*** FBI *** {FFFFFF}(/r)adio (/d)epartments (/m)egaphone (/su)spect /mdc /uhapsi /duznost /osumnjiceni /cuff /uncuff /agent /pokazifbi");
				SendClientMessage(playerid, ZELENKASTA, "*** FBI *** {FFFFFF}/tazeron /tazeroff /pretresi /pretresinv /oduzmi /kazna (/gov)ernment /area51 /provali /ubaci /odvezipolicajca");
				SendClientMessage(playerid, ZELENKASTA, "*** FBI *** {FFFFFF}/otvori /zatvori /fbio /fbiz /dooropen /doorclose /sirenon /sirenoff");
   			}
   			if(PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 3)
			{
   				SendClientMessage(playerid, ZELENKASTA, "*** SWAT *** {FFFFFF}(/r)adio (/d)epartments (/m)egaphone (/su)spect /mdc /uhapsi /duznost /osumnjiceni /cuff /uncuff /tazer");
				SendClientMessage(playerid, ZELENKASTA, "*** SWAT *** {FFFFFF}/pretresi /pretresinv /oduzmi /kazna (/gov)ernment /area51 /provali /ubaci /odvezipolicajca");
				SendClientMessage(playerid, ZELENKASTA, "*** SWAT *** {FFFFFF}/dooropen /doorclose /tazeron /tazeroff /sirenon /sireno");
   			}
            if(PlayerInfo[playerid][pJob] == 1) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/trazi"); }
		    else if(PlayerInfo[playerid][pJob] == 2) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/free"); }
		    else if(PlayerInfo[playerid][pJob] == 3) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/sex"); }
		    else if(PlayerInfo[playerid][pJob] == 4) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/selldrugs /get drugs (samo na Crnom Trzistu)!"); }
		    else if(PlayerInfo[playerid][pJob] == 5) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/dropcar"); }
		    else if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** POSAO *** {FFFFFF}/paper /papers /live /news [text]"); }
		    else if(PlayerInfo[playerid][pJob] == 7) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/repair /refill /duty /automehanicar"); }
		    else if(PlayerInfo[playerid][pJob] == 8) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/guard"); }
		    else if(PlayerInfo[playerid][pJob] == 9) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/sellgun"); }
		    else if(PlayerInfo[playerid][pJob] == 10) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/oranje /vrsenje /mlijeko"); }
		    else if(PlayerInfo[playerid][pJob] == 11) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/prevoz"); }
		    else if(PlayerInfo[playerid][pJob] == 12) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/fight /boxstats"); }
		    else if(PlayerInfo[playerid][pJob] == 14) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/fare /bus"); }
		    else if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/fare"); }
		    else if(PlayerInfo[playerid][pJob] == 15) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/papers /bring /deliver"); }
		    else if(PlayerInfo[playerid][pJob] == 16) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/buyprods /sellprods /load /dostavljac"); }
		    else if(PlayerInfo[playerid][pJob] == 17) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/duty /sellpizza"); }
		    else if(PlayerInfo[playerid][pJob] == 18) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/kosenje /zavrsiposao"); }
		    else if(PlayerInfo[playerid][pJob] == 19) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** /startdrugharvest /stopdrugharvest"); }
		    else if(PlayerInfo[playerid][pJob] == 20) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/smuggledrugs"); }
		    else if(PlayerInfo[playerid][pJob] == 21) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/cisti /zaustaviciscenje /kupismece /ponisti"); }
		    else if(PlayerInfo[playerid][pJob] == 22) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/smugglemats"); }
		    else if(PlayerInfo[playerid][pJob] == 23) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/creategun /buymats"); }
            else if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** HITMAN *** {FFFFFF}/portable"); }
		    else if(PlayerInfo[playerid][pJob] == 25) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/posta"); }
            else if(PlayerInfo[playerid][pJob] == 26) {
		    SendClientMessage(playerid,COLOR_YELLOW2,"*** Posao *** {FFFFFF}/vlak"); }
		    
			if (gTeam[playerid] == 1 || PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
			{
				SendClientMessage(playerid, COLOR_YELLOW2, "*** Hitna Pomoc *** {FFFFFF}(/r)adio (/d)epartments /heal /duznost");
			}
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				SendClientMessage(playerid, ZELENKASTA, "*** ADMIN *** {FFFFFF}(/a)dmin (/ah)elp");
			}
			if (PlayerInfo[playerid][pGameSage] >= 1)
			{
				SendClientMessage(playerid, ZELENKASTA, "*** GameSage *** {FFFFFF}(/g)amesage (/gsh)elp");
			}
			SendClientMessage(playerid, ZELENKASTA,"*** OSTALO *** {FFFFFF}/cellphonehelp /kuca /renthelp /firma /leaderhelp /bankomat");
		}
		return 1;
	}
Can somebody give me an example?
Reply
#2

pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Help", "HELP COMMANDS HERE"/* Using '/n' will make it a new line.*/, "Ok", "Ok");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(response || !response) return 1;
    }
    return 1;
}
Reply
#3

pawn Код:
new string[128];
strcat(string,"Line 1\nLine2\nLine3\nLine4\nLine5\nLine6\nLine7\nand so on");
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_MSGBOX,"Commands",string,"Close","");
EDIT:

Dubya why are you using the callback OnDialogResponse when it's just showing a message it's not responding to anything.
Reply
#4

Quote:
Originally Posted by Kitten
Посмотреть сообщение
pawn Код:
new string[128];
strcat(string,"Line 1\nLine2\nLine3\nLine4\nLine5\nLine6\nLine7\nand so on");
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_MSGBOX,"Commands",string,"Close","");
EDIT:

Dubya why are you using the callback OnDialogResponse when it's just showing a message it's not responding to anything.
I did like you said and i got this warning:
Код:
E:\WaLLa\Toxic Gaming v1.0.0\gamemodes\CLRP.pwn(51884) : warning 219: local variable "string" shadows a variable at a preceding level
Here is my command:
Код:
if(strcmp(cmd, "/hhhelp", true) == 0 || strcmp(cmd, "/kkkkomande", true) == 0)
    {
	    if(IsPlayerConnected(playerid))
	    {
	        new string[256];
			strcat(string,"-VAS NALOG- /rules(pravila) /stats /kupilevel /upgrade\n-GENERALNO- /pay /charity /time /kupi /unrentcar /pice /pokazidozvole /kupiodjecu /fuel /v\n-GENERALNO- /resetupgrades(100k) /oruzje /lock /skill /portable /dozvole /spawnchange /mo\n-GENERALNO- /report /cancel /prihvati /eject /usedrugs /contract /fill /fillcar /clear /service /pl /le\n-CHAT- (/w)hisper (/o)oc (/s)hout (/c)lose (/l)ocal (/b) (/ad)vertise (/f)amily /me\n-BANKA- /balance /withdraw /deposit /wiretransfer");
			ShowPlayerDialog(playerid,1061,DIALOG_STYLE_MSGBOX,"KOMANDE SERVERA",string,"Izlaz","");
	    }
	    return 1;
	}
Reply
#5

Rename string to stringtwo or whatever you'd like to since string is a global variable created via your gamemode.
Reply
#6

Quote:
Originally Posted by Kitten
Посмотреть сообщение
Rename string to stringtwo or whatever you'd like to since string is a global variable created via your gamemode.
Now i don't have error... But it didn't printed all the text, only first 3-4 rows...

Reply
#7

Try
pawn Код:
new stringtwo[256];
strcat(stringtwo,"-VAS NALOG- /rules(pravila) /stats /kupilevel /upgrade\n-GENERALNO- /pay /charity /time /kupi /unrentcar /pice /pokazidozvole /kupiodjecu\n",sizeof(stringtwo));
strcat(stringtwo,"/fuel /v\n-GENERALNO- /resetupgrades(100k) /oruzje /lock /skill /portable /dozvole /spawnchange /mo\n-GENERALNO- /report /cancel /prihvati /eject /usedrugs\n",sizeof(stringtwo));
strcat(stringtwo,"/contract /fill /fillcar /clear /service /pl /le\n-CHAT- (/w)hisper (/o)oc (/s)hout (/c)lose (/l)ocal (/b) (/ad)vertise (/f)amily /me\n-BANKA- /balance\n",sizeof(stringtwo));
strcat(stringtwo,"/withdraw /deposit /wiretransfer\n",sizeof(stringtwo));
ShowPlayerDialog(playerid,1061,DIALOG_STYLE_MSGBOX,"KOMANDE SERVERA",string,"Izlaz","");
Reply
#8

again it's not showing all text
http://i.imgur.com/RpBPw.jpg
Reply
#9

Quote:
Originally Posted by fury14
Посмотреть сообщение
again it's not showing all text
http://i.imgur.com/RpBPw.jpg
Increase your string size.
Reply
#10

by Kitten

pawn Код:
new stringtwo[1024];
strcat(stringtwo,"-VAS NALOG- /rules(pravila) /stats /kupilevel /upgrade\n-GENERALNO- /pay /charity /time /kupi /unrentcar /pice /pokazidozvole /kupiodjecu\n",sizeof(stringtwo));
strcat(stringtwo,"/fuel /v\n-GENERALNO- /resetupgrades(100k) /oruzje /lock /skill /portable /dozvole /spawnchange /mo\n-GENERALNO- /report /cancel /prihvati /eject /usedrugs\n",sizeof(stringtwo));
strcat(stringtwo,"/contract /fill /fillcar /clear /service /pl /le\n-CHAT- (/w)hisper (/o)oc (/s)hout (/c)lose (/l)ocal (/b) (/ad)vertise (/f)amily /me\n-BANKA- /balance\n",sizeof(stringtwo));
strcat(stringtwo,"/withdraw /deposit /wiretransfer\n",sizeof(stringtwo));
ShowPlayerDialog(playerid,1061,DIALOG_STYLE_MSGBOX,"KOMANDE SERVERA",string,"Izlaz","");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)