SA-MP Forums Archive
Trasfering to dialog - 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: Trasfering to dialog (/showthread.php?tid=517111)



Trasfering to dialog - Team_PRO - 03.06.2014

Код:
CMD:ahelp(playerid, params[])
{
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(PlayerInfo[playerid][pAdmin] >= 1) SendClientMessage(playerid, COLOR_YELLOW, "Level 1: {FFFFFF}/a /aname /aduty /apm /kick /(un)ban(reason/ip) /(s)check /slap /spec /ar /dr /(n)mute /stopfire");
	if(PlayerInfo[playerid][pAdmin] >= 1) SendClientMessage(playerid, COLOR_YELLOW, "Level 1: {FFFFFF}/goto(loc) /gethere /revive /refund /ipcheck /ch /freeze /unfreeze /fa /ufa /healnear /startfire");
	if(PlayerInfo[playerid][pAdmin] >= 1) SendClientMessage(playerid, COLOR_YELLOW, "Level 1: {FFFFFF}/setvw /setint /makevip /disarm /gotoveh /getveh /sendtols /tuteject /forcetut /listen /lastseen");
	if(PlayerInfo[playerid][pAdmin] >= 1) SendClientMessage(playerid, COLOR_YELLOW, "Level 1: {FFFFFF}/setskin /banaccount /prison(account) /approve /deny /prisoners /contracts /clearcontract");
	if(PlayerInfo[playerid][pAdmin] >= 1) SendClientMessage(playerid, COLOR_YELLOW, "Level 1: {FFFFFF}/clearwanted /respawn(radius) /gotopos /sendtoid /veh /interiors /pfine /fine /listguns");
	if(PlayerInfo[playerid][pAdmin] >= 1) SendClientMessage(playerid, COLOR_YELLOW, "Level 1: {FFFFFF}/(show/clear)flag(s) /reportmute /(clear)warn(s) /refuel /givecookie /tog /tabbed /afk");
	if(PlayerInfo[playerid][pAdmin] >= 2) SendClientMessage(playerid, COLOR_LIME, "Level 2: {FFFFFF}/****** /infotoall /interiors /mark /time /jetpack /sethp /setarmor /listmasked");
	if(PlayerInfo[playerid][pAdmin] >= 2) SendClientMessage(playerid, COLOR_LIME, "Level 2: {FFFFFF}/hoseject /lastads /clearchat /whitelist /givenos /sendtoid /speedhack /setfightstyle");
	if(PlayerInfo[playerid][pAdmin] >= 2) SendClientMessage(playerid, COLOR_LIME, "Level 2: {FFFFFF}/veh /setname /vehname /rangeban /editdrugs /cnnn /clearads /online /editpoint /setstat");
	if(PlayerInfo[playerid][pAdmin] >= 3) SendClientMessage(playerid, COLOR_VIP, "Level 3: {FFFFFF}/weatherall /(set/give)(all)money /setarmorall /sethpall /fixveh(all) /poll /givegun");
	if(PlayerInfo[playerid][pAdmin] >= 3) SendClientMessage(playerid, COLOR_VIP, "Level 3: {FFFFFF}/forcepaycheck /givecookieall /arrestpoint /music /(take/remove/give)nameonoff /setreferrals");
	if(PlayerInfo[playerid][pAdmin] >= 3) SendClientMessage(playerid, COLOR_VIP, "Level 3: {FFFFFF}/setoocmode /say /customvehicle /goldrims /eventhelp /bowners /maketester /setaccent");
	if(PlayerInfo[playerid][pAdmin] >= 4) SendClientMessage(playerid, COLOR_LIGHTBLUE, "Level 4: {FFFFFF}/bugs /kill /ideas /acolor /bans /deleteaccount /motd /setpass /forceduty");
	if(PlayerInfo[playerid][pAdmin] >= 4) SendClientMessage(playerid, COLOR_LIGHTBLUE, "Level 4: {FFFFFF}/make(helper/banappealer/gang/fac)(mod) /make(temp)admin /firehell /oremove(helper/admin)");
	if(PlayerInfo[playerid][pAdmin] >= 4) SendClientMessage(playerid, COLOR_LIGHTBLUE, "Level 4: {FFFFFF}/unloyal /lockserver /saveserver /savebizhouses /delete(bug/idea) /removeban /makeleader");
	if(PlayerInfo[playerid][pAdmin] >= 4) SendClientMessage(playerid, COLOR_LIGHTBLUE, "Level 4: {FFFFFF}/makegateowner /dynamics /familieshelp /make(door/house/biz)mod /makegameaffairs");
	if(PlayerInfo[playerid][pAdmin] >= 5) SendClientMessage(playerid, COLOR_BLUE, "Level 5: {FFFFFF}/(g)gmx");
	if(PlayerInfo[playerid][pGangMod]) SendClientMessage(playerid, COLOR_ORANGE, "GANG MOD: {FFFFFF}/fcreate /fdelete /fedit /fstrike /fstrikes /switchfam");
	if(PlayerInfo[playerid][pFacMod]) SendClientMessage(playerid, COLOR_ORANGE, "FACTION MOD: {FFFFFF}/makeleader /fackick /switchfac");
	if(PlayerInfo[playerid][pBanAppealer]) SendClientMessage(playerid, COLOR_ORANGE, "BAN APPEALER: {FFFFFF}/unban /unbanip");
	if(PlayerInfo[playerid][pDoorMod]) SendClientMessage(playerid, COLOR_ORANGE, "DOOR MOD: {FFFFFF}/createdoor /deletedoor /gotodoor /dedit /dused");
	if(PlayerInfo[playerid][pBizMod]) SendClientMessage(playerid, COLOR_ORANGE, "BIZ MOD: {FFFFFF}/createbiz /deletebiz /gotobiz /asellbiz /bedit /bused");
	if(PlayerInfo[playerid][pHouseMod]) SendClientMessage(playerid, COLOR_ORANGE, "HOUSE MOD: {FFFFFF}/createhouse /deletehouse /gotohouse /asellhouse /hedit /hused");
	if(PlayerInfo[playerid][pGameAffairs]) SendClientMessage(playerid, COLOR_ORANGE, "Game Affairs: {FFFFFF}/make(door/house/biz/gang/fac)mod");
	return 1;
}



Re: Trasfering to dialog - ikkentim - 03.06.2014

Most people ask a question and don't post their code. You seem to do the opposite. What's the problem?

Edit: I just now saw the title

Код:
	new info[2048];
	format(info, 2048, "Commands:\n");


	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");

	if(PlayerInfo[playerid][pAdmin] >= 1) format(info, 2048, "%sline 1\n", info);
	if(PlayerInfo[playerid][pAdmin] >= 1) format(info, 2048, "%sline 2\n", info);
	if(PlayerInfo[playerid][pAdmin] >= 1) format(info, 2048, "%setc\n", info);
	if(PlayerInfo[playerid][pAdmin] >= 1) format(info, 2048, "%setc\n", info);
	//Add all the commands yourself.

ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_MSGBOX, "Help", info, "Close", "");



Re: Trasfering to dialog - Threshold - 03.06.2014

pawn Код:
CMD:ahelp(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    new string[2715];
    strcat(string, "{FFFFFF}Level 1: /a /aname /aduty /apm /kick /(un)ban(reason/ip) /(s)check /slap /spec /ar /dr /(n)mute /stopfire\n");
    strcat(string, "Level 1: /goto(loc) /gethere /revive /refund /ipcheck /ch /freeze /unfreeze /fa /ufa /healnear /startfire\n");
    strcat(string, "Level 1: /setvw /setint /makevip /disarm /gotoveh /getveh /sendtols /tuteject /forcetut /listen /lastseen\n");
    strcat(string, "Level 1: /setskin /banaccount /prison(account) /approve /deny /prisoners /contracts /clearcontract\n");
    strcat(string, "Level 1: /clearwanted /respawn(radius) /gotopos /sendtoid /veh /interiors /pfine /fine /listguns\n");
    strcat(string, "Level 1: /(show/clear)flag(s) /reportmute /(clear)warn(s) /refuel /givecookie /tog /tabbed /afk\n\n");
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        strcat(string, "Level 2: /****** /infotoall /interiors /mark /time /jetpack /sethp /setarmor /listmasked\n");
        strcat(string, "Level 2: /hoseject /lastads /clearchat /whitelist /givenos /sendtoid /speedhack /setfightstyle\n");
        strcat(string, "Level 2: /veh /setname /vehname /rangeban /editdrugs /cnnn /clearads /online /editpoint /setstat\n\n");
    }
    if(PlayerInfo[playerid][pAdmin] >= 3)
    {
        strcat(string, "Level 3: /weatherall /(set/give)(all)money /setarmorall /sethpall /fixveh(all) /poll /givegun\n");
        strcat(string, "Level 3: /forcepaycheck /givecookieall /arrestpoint /music /(take/remove/give)nameonoff /setreferrals\n");
        strcat(string, "Level 3: /setoocmode /say /customvehicle /goldrims /eventhelp /bowners /maketester /setaccent\n\n");
    }
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        strcat(string, "Level 4: /bugs /kill /ideas /acolor /bans /deleteaccount /motd /setpass /forceduty\n");
        strcat(string, "Level 4: /make(helper/banappealer/gang/fac)(mod) /make(temp)admin /firehell /oremove(helper/admin)\n");
        strcat(string, "Level 4: /unloyal /lockserver /saveserver /savebizhouses /delete(bug/idea) /removeban /makeleader\n");
        strcat(string, "Level 4: /makegateowner /dynamics /familieshelp /make(door/house/biz)mod /makegameaffairs\n\n");
    }
    if(PlayerInfo[playerid][pAdmin] >= 5) strcat(string, "Level 5: /(g)gmx\n\n");
    if(PlayerInfo[playerid][pGangMod]) strcat(string, "GANG MOD: /fcreate /fdelete /fedit /fstrike /fstrikes /switchfam\n");
    if(PlayerInfo[playerid][pFacMod]) strcat(string, "FACTION MOD: /makeleader /fackick /switchfac\n");
    if(PlayerInfo[playerid][pBanAppealer]) strcat(string, "BAN APPEALER: /unban /unbanip\n");
    if(PlayerInfo[playerid][pDoorMod]) strcat(string, "DOOR MOD: /createdoor /deletedoor /gotodoor /dedit /dused\n");
    if(PlayerInfo[playerid][pBizMod]) strcat(string, "BIZ MOD: /createbiz /deletebiz /gotobiz /asellbiz /bedit /bused\n");
    if(PlayerInfo[playerid][pHouseMod]) strcat(string, "HOUSE MOD: /createhouse /deletehouse /gotohouse /asellhouse /hedit /hused\n");
    if(PlayerInfo[playerid][pGameAffairs]) strcat(string, "Game Affairs: /make(door/house/biz/gang/fac)mod");
    ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_MSGBOX, "Admin Help", string, "Okay", "");
    //Replace 'DIALOG_ID' with the ID that you would like to use.
    return 1;
}
That's a BIG dialog.