Dialog Problem
#1

PHP код:
COMMAND:acmds(playeridparams[])
{
    new 
string[1028];
    if(
Player[playerid][Level] < 1) return SendClientMessage(playeridCOLOR_RED"ERROR: {FFFFFF}You do not have the permission to use this command!");
    
////////////////////////////////////////////////////////////////////////
    
if(Player[playerid][Level] == 1)
    {
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 1","/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn","Close""");
    }
    
    if(
Player[playerid][Level] == 2)
    {
        
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n");
        
format(stringsizeof(string), "/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n");
        
format(stringsizeof(string), "/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail\n");
        
format(stringsizeof(string), "/aheal, /aarmour, /forcerules, /playerbank, /get, /permban(acc), /explode, /unjail\n");
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 2",string"Close");
    }
    
    if(
Player[playerid][Level] == 3)
    {
        
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n");
        
format(stringsizeof(string), "/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n");
        
format(stringsizeof(string), "/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n");
        
format(stringsizeof(string), "/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n");
        
format(stringsizeof(string), "/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n");
        
format(stringsizeof(string), "/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n");
        
format(stringsizeof(string), "/slay, /disarm, /giveweapon, /unban\n");
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 3",string"Close");
    }
    
    if(
Player[playerid][Level] == 4)
    {
        
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n");
        
format(stringsizeof(string), "/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n");
        
format(stringsizeof(string), "/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n");
        
format(stringsizeof(string), "/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n");
        
format(stringsizeof(string), "/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n");
        
format(stringsizeof(string), "/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n");
        
format(stringsizeof(string), "/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n");
        
format(stringsizeof(string), "/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n");
        
format(stringsizeof(string), "/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer\n");
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 4",string"Close");
    }
    
    if(
Player[playerid][Level] == 5)
    {
        
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n");
        
format(stringsizeof(string), "/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n");
        
format(stringsizeof(string), "/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n");
        
format(stringsizeof(string), "/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n");
        
format(stringsizeof(string), "/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n");
        
format(stringsizeof(string), "/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n");
        
format(stringsizeof(string), "/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n");
        
format(stringsizeof(string), "/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n");
        
format(stringsizeof(string), "/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer, /setmoney\n");
        
format(stringsizeof(string), "/setxp, /silvervip, /basicvip, /goldvip, /givetoken, /kickall\n");
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 5",string"Close");
    }
    
    if(
Player[playerid][Level] >= 6)
    {
        
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n");
        
format(stringsizeof(string), "/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n");
        
format(stringsizeof(string), "/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n");
        
format(stringsizeof(string), "/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n");
        
format(stringsizeof(string), "/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n");
        
format(stringsizeof(string), "/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n");
        
format(stringsizeof(string), "/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n");
        
format(stringsizeof(string), "/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n");
        
format(stringsizeof(string), "/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer, /setmoney\n");
        
format(stringsizeof(string), "/setxp, /silvervip, /basicvip, /goldvip, /givetoken, /kickall\n\n");
        
format(stringsizeof(string), "{FF0000}/setlevel, /(promote/remove)bouncer, /(promote/remove)helper\n");
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 6 - 7",string"Close");
    }
    return 
1;

I'm trying use "format" for the admin commands dialog but only the last line appears when an admin uses /acmds.
For example: A level 4 admin using /acmds will only see this line:

Код:
format(string, sizeof(string), "/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer\n");
Reply
#2

You don't need to format them.
Correct me if I'm wrong,but if you still want it,use strcat.
https://sampforum.blast.hk/showthread.php?tid=336102
Reply
#3

use strcat or if you want to use format it can done in this way
PHP код:
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp"); //line 1
        
format(stringsizeof(string), "%s\n/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn"string);//line 2
        
format(stringsizeof(string), "%s\n/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail"string);//line 3
        
format(stringsizeof(string), "%s\n/aheal, /aarmour, /forcerules, /playerbank, /get, /permban(acc), /explode, /unjail"string);//line 4
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 2",string"Close"); 
Reply
#4

Thanks everyone!
Reply
#5

Here you go
PHP код:
COMMAND:acmds(playeridparams[]) 

    new 
string[1028]; 
    if(
Player[playerid][Level] < 1) return SendClientMessage(playeridCOLOR_RED"ERROR: {FFFFFF}You do not have the permission to use this command!"); 
    
//////////////////////////////////////////////////////////////////////// 
    
if(Player[playerid][Level] == 1
    { 
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 1","/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn","Close"""); 
    } 
     
    if(
Player[playerid][Level] == 2
    { 
        
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"); 
        
format(stringsizeof(string), "%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"string); 
        
format(stringsizeof(string), "%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail\n"string); 
        
format(stringsizeof(string), "%s/aheal, /aarmour, /forcerules, /playerbank, /get, /permban(acc), /explode, /unjail\n"string); 
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 2",string"Close"); 
    } 
     
    if(
Player[playerid][Level] == 3
    { 
        
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"); 
        
format(stringsizeof(string), "%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"string); 
        
format(stringsizeof(string), "%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"string); 
        
format(stringsizeof(string), "%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"string); 
        
format(stringsizeof(string), "%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"string); 
        
format(stringsizeof(string), "%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"string); 
        
format(stringsizeof(string), "%s/slay, /disarm, /giveweapon, /unban\n"string); 
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 3",string"Close"); 
    } 
     
    if(
Player[playerid][Level] == 4
    { 
        
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"); 
        
format(stringsizeof(string), "%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"string); 
        
format(stringsizeof(string), "%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"string); 
        
format(stringsizeof(string), "%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"string); 
        
format(stringsizeof(string), "%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"string); 
        
format(stringsizeof(string), "%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"string); 
        
format(stringsizeof(string), "%s/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n"string); 
        
format(stringsizeof(string), "%s/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n"string); 
        
format(stringsizeof(string), "%s/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer\n"string); 
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 4",string"Close"); 
    } 
     
    if(
Player[playerid][Level] == 5
    { 
        
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"); 
        
format(stringsizeof(string), "%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"string); 
        
format(stringsizeof(string), "%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"string); 
        
format(stringsizeof(string), "%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"string); 
        
format(stringsizeof(string), "%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"string); 
        
format(stringsizeof(string), "%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"string); 
        
format(stringsizeof(string), "%s/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n"string); 
        
format(stringsizeof(string), "%s/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n"string); 
        
format(stringsizeof(string), "%s/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer, /setmoney\n"string); 
        
format(stringsizeof(string), "%s/setxp, /silvervip, /basicvip, /goldvip, /givetoken, /kickall\n"string); 
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 5",string"Close"); 
    } 
     
    if(
Player[playerid][Level] >= 6
    { 
        
format(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"); 
        
format(stringsizeof(string), "%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"string); 
        
format(stringsizeof(string), "%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"string); 
        
format(stringsizeof(string), "%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"string); 
        
format(stringsizeof(string), "%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"string); 
        
format(stringsizeof(string), "%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"string); 
        
format(stringsizeof(string), "%s/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n"string); 
        
format(stringsizeof(string), "%s/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n"string); 
        
format(stringsizeof(string), "%s/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer, /setmoney\n"string); 
        
format(stringsizeof(string), "%s/setxp, /silvervip, /basicvip, /goldvip, /givetoken, /kickall\n\n"string); 
        
format(stringsizeof(string), "%s{FF0000}/setlevel, /(promote/remove)bouncer, /(promote/remove)helper\n"string); 
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 6 - 7",string"Close"); 
    } 
    return 
1

Edit: lol sorry, someone already replied while I was typing :P
Reply
#6

THERE IS NO NEED TO FORMAT!

you dont need format here

use strcat



PHP код:
new str[1000];
strcat(str"Item1 Item2 Item3 Item4\n"); 
strcat(str"Item5 Item6 Item7 Item8");
//etc... 
Reply
#7

Format is slower than Strcat because format is not made for copying/ concatenating strings.
Reply
#8

PHP код:
COMMAND:acmds(playeridparams[])
{
    new 
string[2068];
    if(
Player[playerid][Level] < 1) return SendClientMessage(playeridCOLOR_RED"ERROR: {FFFFFF}You do not have the permission to use this command!");

    
////////////////////////////////////////////////////////////////////////
    
if(Player[playerid][Level] == 1)
    {
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 1","/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn","Close""");
    }

    if(
Player[playerid][Level] == 2)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"sizeof(string));
        
strcat(string"%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"sizeof(string));
        
strcat(string"%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail\n"sizeof(string));
        
strcat(string"%s/aheal, /aarmour, /forcerules, /playerbank, /get, /permban(acc), /explode, /unjail\n"sizeof(string));
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 2",string"Close");
    }

    if(
Player[playerid][Level] == 3)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"sizeof(string));
        
strcat(string"%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"sizeof(string));
        
strcat(string"%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"sizeof(string));
        
strcat(string"%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"sizeof(string));
        
strcat(string"%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"sizeof(string));
        
strcat(string"%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"sizeof(string));
        
strcat(string"%s/slay, /disarm, /giveweapon, /unban\n"string);
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 3",string"Close");
    }

    if(
Player[playerid][Level] == 4)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"sizeof(string));
        
strcat(string"%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"sizeof(string));
        
strcat(string"%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"sizeof(string));
        
strcat(string"%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"sizeof(string));
        
strcat(string"%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"sizeof(string));
        
strcat(string"%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"sizeof(string));
        
strcat(string"%s/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n"sizeof(string));
        
strcat(string"%s/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n"sizeof(string));
        
strcat(string"%s/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer\n"sizeof(string));
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 4",string"Close");
    }

    if(
Player[playerid][Level] == 5)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"sizeof(string));
        
strcat(string"%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"sizeof(string));
        
strcat(string"%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"sizeof(string));
        
strcat(string"%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"sizeof(string));
        
strcat(string"%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"sizeof(string));
        
strcat(string"%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"sizeof(string));
        
strcat(string"%s/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n"sizeof(string));
        
strcat(string"%s/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n"sizeof(string));
        
strcat(string"%s/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer, /setmoney\n"sizeof(string));
        
strcat(string"%s/setxp, /silvervip, /basicvip, /goldvip, /givetoken, /kickall\n"sizeof(string));
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 5",string"Close");
    }

    if(
Player[playerid][Level] >= 6)
    {
        
strcat(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer, /setmoney\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/setxp, /silvervip, /basicvip, /goldvip, /givetoken, /kickall\n\n"sizeof(string));
        
strcat(stringsizeof(string), "%s{FF0000}/setlevel, /(promote/remove)bouncer, /(promote/remove)helper\n"sizeof(string));
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 6 - 7",string"Close");
    }
    return 
1;

Crashes the server..
Reply
#9

You've just copy-pasted and now you have 2 sizeofs on each line... Under if(Player[playerid][Level] >= 6)...

How that even compiled without an error coming up, is beyond me.
Reply
#10

Quote:
Originally Posted by Uvais
Посмотреть сообщение
PHP код:
COMMAND:acmds(playeridparams[])
{
    new 
string[2068];
    if(
Player[playerid][Level] < 1) return SendClientMessage(playeridCOLOR_RED"ERROR: {FFFFFF}You do not have the permission to use this command!");
    
////////////////////////////////////////////////////////////////////////
    
if(Player[playerid][Level] == 1)
    {
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 1","/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn","Close""");
    }
    if(
Player[playerid][Level] == 2)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"sizeof(string));
        
strcat(string"%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"sizeof(string));
        
strcat(string"%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail\n"sizeof(string));
        
strcat(string"%s/aheal, /aarmour, /forcerules, /playerbank, /get, /permban(acc), /explode, /unjail\n"sizeof(string));
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 2",string"Close");
    }
    if(
Player[playerid][Level] == 3)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"sizeof(string));
        
strcat(string"%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"sizeof(string));
        
strcat(string"%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"sizeof(string));
        
strcat(string"%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"sizeof(string));
        
strcat(string"%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"sizeof(string));
        
strcat(string"%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"sizeof(string));
        
strcat(string"%s/slay, /disarm, /giveweapon, /unban\n"string);
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 3",string"Close");
    }
    if(
Player[playerid][Level] == 4)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"sizeof(string));
        
strcat(string"%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"sizeof(string));
        
strcat(string"%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"sizeof(string));
        
strcat(string"%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"sizeof(string));
        
strcat(string"%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"sizeof(string));
        
strcat(string"%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"sizeof(string));
        
strcat(string"%s/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n"sizeof(string));
        
strcat(string"%s/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n"sizeof(string));
        
strcat(string"%s/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer\n"sizeof(string));
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 4",string"Close");
    }
    if(
Player[playerid][Level] == 5)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"sizeof(string));
        
strcat(string"%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"sizeof(string));
        
strcat(string"%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"sizeof(string));
        
strcat(string"%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"sizeof(string));
        
strcat(string"%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"sizeof(string));
        
strcat(string"%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"sizeof(string));
        
strcat(string"%s/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n"sizeof(string));
        
strcat(string"%s/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n"sizeof(string));
        
strcat(string"%s/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer, /setmoney\n"sizeof(string));
        
strcat(string"%s/setxp, /silvervip, /basicvip, /goldvip, /givetoken, /kickall\n"sizeof(string));
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 5",string"Close");
    }
    if(
Player[playerid][Level] >= 6)
    {
        
strcat(stringsizeof(string), "/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer, /setmoney\n"sizeof(string));
        
strcat(stringsizeof(string), "%s/setxp, /silvervip, /basicvip, /goldvip, /givetoken, /kickall\n\n"sizeof(string));
        
strcat(stringsizeof(string), "%s{FF0000}/setlevel, /(promote/remove)bouncer, /(promote/remove)helper\n"sizeof(string));
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 6 - 7",string"Close");
    }
    return 
1;

Crashes the server..
Simply change new string[2068]; to new string[950]; and remove %s and remove all sizeof
it should be like this:

PHP код:
COMMAND:acmds(playeridparams[])
{
    new 
string[950];
    if(
Player[playerid][Level] < 1) return SendClientMessage(playeridCOLOR_RED"ERROR: {FFFFFF}You do not have the permission to use this command!");
    
////////////////////////////////////////////////////////////////////////
    
if(Player[playerid][Level] == 1)
    {
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 1","/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn","Close""");
    }
    if(
Player[playerid][Level] == 2)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n");
        
strcat(string"/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n");
        
strcat(string"/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail\n");
        
strcat(string"/aheal, /aarmour, /forcerules, /playerbank, /get, /permban(acc), /explode, /unjail\n");
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 2",string"Close");
    }
    if(
Player[playerid][Level] == 3)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n");
        
strcat(string"/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n");
        
strcat(string"/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n");
        
strcat(string"/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n");
        
strcat(string"/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n");
        
strcat(string"/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n");
        
strcat(string"/slay, /disarm, /giveweapon, /unban\n"string);
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 3",string"Close");
    }
    if(
Player[playerid][Level] == 4)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n");
        
strcat(string"/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n");
        
strcat(string"/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n");
        
strcat(string"/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n");
        
strcat(string"/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n");
        
strcat(string"/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n");
        
strcat(string"/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n");
        
strcat(string"/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n");
        
strcat(string"/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer\n");
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 4",string"Close");
    }
    if(
Player[playerid][Level] == 5)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n");
        
strcat(string"/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n");
        
strcat(string"/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n");
        
strcat(string"/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n");
        
strcat(string"/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n");
        
strcat(string"/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n");
        
strcat(string"/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n");
        
strcat(string"/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n");
        
strcat(string"/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer, /setmoney\n");
        
strcat(string"/setxp, /silvervip, /basicvip, /goldvip, /givetoken, /kickall\n");
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 5",string"Close");
    }
    if(
Player[playerid][Level] >= 6)
    {
        
strcat(string"/getip, /vfix, /accolor, /vnitro, /vrespawn, /aod, /ans(wer), /jaillist, /arules, /ahelp\n");
        
strcat(string"/asay, /mute, /unmute, /warn, /goto, /clearchat, /tempban, /kick, /spawn\n");
        
strcat(string"/teleport, /vc, /vdestroy, /respawnalluv, /destroyallav, /tempname, /removename, /jail, /unjail\n");
        
strcat(string"/aheal, /aarmour, /forcerules, /playerbank, /(un)freeze, /get, /permban(acc), /explode\n");
        
strcat(string"/givemoney, /respawnallv, /setinterior, /setvirtualword, /swapmotd, /settime, /setday, /announce\n");
        
strcat(string"/gotovehicle, /arenas, /playertokens, /playerjob, /acure, /playerjailtime, /blockreport, /blockask\n");
        
strcat(string"/slay, /disarm, /giveweapon, /unban, /setwanted, /givexp, /topdonator, /motd, /alog, /fine, /setskin\n");
        
strcat(string"/astream, /saveallstats, /faketip, /ping, /teleportevent, /(un)copban, /(un)armyban, /giveallweapon\n");
        
strcat(string"/disarmall, /(un)freezeevent, /giveeventweapon, /reseteventweapons, /spawneventplayer, /setmoney\n");
        
strcat(string"/setxp, /silvervip, /basicvip, /goldvip, /givetoken, /kickall\n\n");
        
strcat(string"{FF0000}/setlevel, /(promote/remove)bouncer, /(promote/remove)helper\n");
        
ShowPlayerDialog(playeridDIALOG_UNUSEDDIALOG_STYLE_MSGBOX"Admin Commands Level 6 - 7",string"Close");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)