help in /admins dailog
#1

how to make this in dialog please help
Код:
CMD:admins(playerid,params[])
{
    new Count, string[128],n[MAX_PLAYER_NAME];
    SendClientMessage(playerid, COLOR_GREEN, "__________|Admins|__________");
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] >=1) {
            GetPlayerName(i,n,sizeof(n));
            format(string,sizeof(string),"     %s  ",n);
            SendClientMessage(playerid,COLOR_GREEN,string);
            Count++;
        }
    }
    if(Count == 0) SendClientMessage(playerid, COLOR_GREEN, "     Server Level:1337   ");
    SendClientMessage(playerid, COLOR_GREEN, "____________________________");
    return 1;
}
Reply
#2

If you mean a dialog that displays all online admins:

Код:
CMD:admins(playerid,params[])
{
    new Count, string[128], n[MAX_PLAYER_NAME];
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] >=1) {
            GetPlayerName(i,n,sizeof(n));
            format(string, sizeof(string), "%s\n%s", string, n);
            Count++;
        }
    }
    ShowPlayerDialog(playerid, admins, DIALOG_STYLE_LIST, "Online Admins", string, "Select", "Cancel");

    if(Count == 0)
    {
        SendClientMessage(playerid, COLOR_GREEN, "     Server Level:1337   ");
        SendClientMessage(playerid, COLOR_GREEN, "____________________________");
        return 1;
    }
}
Reply
#3

Quote:
Originally Posted by PeanutButter
Посмотреть сообщение
If you mean a dialog that displays all online admins:

Код:
CMD:admins(playerid,params[])
{
    new Count, string[128], n[MAX_PLAYER_NAME];
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] >=1) {
            GetPlayerName(i,n,sizeof(n));
            format(string, sizeof(string), "%s\n%s", string, n);
            Count++;
        }
    }
    ShowPlayerDialog(playerid, admins, DIALOG_STYLE_LIST, "Online Admins", string, "Select", "Cancel");

    if(Count == 0)
    {
        SendClientMessage(playerid, COLOR_GREEN, "     Server Level:1337   ");
        SendClientMessage(playerid, COLOR_GREEN, "____________________________");
        return 1;
    }
}
Код:
C:\Users\ninja\Desktop\Server Package\gamemodes\mecom.pwn(2162) : warning 217: loose indentation
C:\Users\ninja\Desktop\Server Package\gamemodes\mecom.pwn(3698) : error 017: undefined symbol "admins"
C:\Users\ninja\Desktop\Server Package\gamemodes\mecom.pwn(3706) : warning 209: function "cmd_admins" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Please help errors coming
Reply
#4

Put #pragma tabsize 0 on top of your script to remove the warning.
You should replace the admins with the dialog id that you want.

If you don't want to deal with dialog id's I recommend EasyDialog

Код:
CMD:admins(playerid,params[])
{
    new Count, string[128], n[MAX_PLAYER_NAME];
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] >=1) {
            GetPlayerName(i,n,sizeof(n));
            format(string, sizeof(string), "%s\n%s", string, n);
            Count++;
        }
    }
    ShowPlayerDialog(playerid, admins, DIALOG_STYLE_LIST, "Online Admins", string, "Select", "Cancel");

    if(Count == 0)
    {
        SendClientMessage(playerid, COLOR_GREEN, "     Server Level:1337   ");
        SendClientMessage(playerid, COLOR_GREEN, "____________________________");
    }
return 1; //THIS SHOULD BE HERE
}
Reply
#5

Quote:
Originally Posted by PeanutButter
Посмотреть сообщение
Put #pragma tabsize 0 on top of your script to remove the warning.
You should replace the admins with the dialog id that you want.

If you don't want to deal with dialog id's I recommend EasyDialog
Thank you for helping but Easydialog download links are not working
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=475838
Reply
#7

Quote:
Originally Posted by PeanutButter
Посмотреть сообщение
Put #pragma tabsize 0 on top of your script to remove the warning.
You should replace the admins with the dialog id that you want.
Don't use pragma tabsize, this is worst way to learn to script..
Reply
#8

Quote:
Originally Posted by PeanutButter
Посмотреть сообщение
Put #pragma tabsize 0 on top of your script to remove the warning.
You should replace the admins with the dialog id that you want.
Please dont spread the misuse of that pragma if you actually dont know what its for. Using them for masking indentation warning will only lead to a future that have messy scripts.
Reply
#9

Quote:
Originally Posted by Sumit4
Посмотреть сообщение
Thank you for helping but Easydialog download links are not working
If you don't want to use #pragma tabsize 0 show me the code on line 2162.
Reply
#10

Edit : now 2161 Error Coming
Код:
DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon4")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon5")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon6")); DeletePVar(playerid, "Status"); DestroyObject(GetPVarInt(playerid, "neon7"));
this is code of 2161
please help and that your easydialog box that was no longer download avalibal
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)