Dialog Problem
#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


Messages In This Thread
Dialog Problem - by Uvais - 24.06.2018, 16:40
Re: Dialog Problem - by Verc - 24.06.2018, 16:47
Re: Dialog Problem - by Zeth - 24.06.2018, 16:55
Re: Dialog Problem - by Uvais - 24.06.2018, 16:57
Re: Dialog Problem - by Exhibit - 24.06.2018, 17:00
Re: Dialog Problem - by Lokii - 24.06.2018, 17:02
Re: Dialog Problem - by Logic_ - 24.06.2018, 19:46
Re: Dialog Problem - by Uvais - 24.06.2018, 22:55
Re: Dialog Problem - by Sew_Sumi - 24.06.2018, 23:03
Re: Dialog Problem - by taktaz - 25.06.2018, 14:22

Forum Jump:


Users browsing this thread: 1 Guest(s)