SA-MP Forums Archive
I'm need a help in command, please. - 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: I'm need a help in command, please. (/showthread.php?tid=377734)



I'm need a help in command, please. - Userpwon - 15.09.2012

Hello, I'm have a command "admins" and it writes me "error"
can someone to do?
I'm need a command 'admins' to see admins online.
my function in admin mod:
GetPVarInt > Level
CMD:admins(playerid,params[])
thanks you..


AW: I'm need a help in command, please. - BiosMarcel - 15.09.2012

Код HTML:
if(strcmp("/admins",cmdtext,true,10) == 0)
{
SCM(playerid,-1,"Admins:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(GetPVarInt(i,"Level")>0)
        {
        new adminslist[128];
        format(adminslist,sizeof(adminslist),"%s",SpielerName(i));
        SCM(playerid,-1,adminslist);
        }
    }
}
}



Re: AW: I'm need a help in command, please. - Userpwon - 15.09.2012

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
Код HTML:
if(strcmp("/admins",cmdtext,true,10) == 0)
{
SCM(playerid,-1,"Admins:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(GetPVarInt(i,"Level")>0)
        {
        new adminslist[128];
        format(adminslist,sizeof(adminslist),"%s",SpielerName(i));
        SCM(playerid,-1,adminslist);
        }
    }
}
}
Error, dude.
(654) : error 017: undefined symbol "SCM"
Line 654: SCM(playerid,-1,"Admins:");


AW: I'm need a help in command, please. - BiosMarcel - 15.09.2012

SRy SendClientMessage not SCM i have shortcuted this in my script


Re: AW: I'm need a help in command, please. - VladCanarez - 15.09.2012

Quote:
Originally Posted by Userpwon
Посмотреть сообщение
Error, dude.
(654) : error 017: undefined symbol "SCM"
Line 654: SCM(playerid,-1,"Admins:");
Just do this at the top of your script..

pawn Код:
#Define SCM SendClientMessage



Re: AW: I'm need a help in command, please. - Userpwon - 15.09.2012

Quote:
Originally Posted by VladCanarez
Посмотреть сообщение
Just do this at the top of your script..

pawn Код:
#Define SCM SendClientMessage
its not working for me, give me something other please please.


AW: I'm need a help in command, please. - BiosMarcel - 15.09.2012

no no no define only change the SCM to SendClientMessage

Код HTML:
if(strcmp("/admins",cmdtext,true,10) == 0)
{
SendClientMessage(playerid,-1,"Admins:");
new name[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(GetPVarInt(i,"Level")>0)
        {
        new adminslist[128];
        format(adminslist,sizeof(adminslist),"%s",GetPlayerName(i,name,sizeof(name)));
        SendClientMessage(playerid,-1,adminslist);
        }
    }
}
}



Re: AW: I'm need a help in command, please. - Userpwon - 15.09.2012

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
no no no define only change the SCM to SendClientMessage

Код HTML:
if(strcmp("/admins",cmdtext,true,10) == 0)
{
SCM(playerid,-1,"Admins:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(GetPVarInt(i,"Level")>0)
        {
        new adminslist[128];
        format(adminslist,sizeof(adminslist),"%s",SpielerName(i));
        SendClientMessage(playerid,-1,adminslist);
        }
    }
}
}
Why I write in chat "/admins" Its writes twice name in chat


AW: I'm need a help in command, please. - BiosMarcel - 15.09.2012

Sry the code is a littlebit false edited! (In my Mode it only writes the name one time)


Re: I'm need a help in command, please. - Sig Hansen - 15.09.2012

Well Try To Use THis Its Better

PHP код:
if (strcmp(cmd"/admins"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
SendClientMessage(playeridCOLOR_GREEN"|____ PUT YOU'RE GAMING NAME HERE Online Administration Team ____|"); // Dont Forget To Change THe Name There!
            
for(new 0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
PlayerInfo[i][pAdmin] >= && PlayerInfo[i][pAdmin] <= 1339 || PlayerInfo[i][pTester] >= 1)
                    {
                        new 
admtext[64];
                        if(
PlayerInfo[i][pAppearList] == 1)
                        {
                             if(
PlayerInfo[i][pAdmin] == 1339) { admtext "Owner"; }
                             else if(
PlayerInfo[i][pAdmin] == 1338) { admtext "Co-Owner"; }
                            else if(
PlayerInfo[i][pAdmin] == 1337) { admtext "Elite Admin"; }
                            else if(
PlayerInfo[i][pAdmin] == 6)    { admtext "Server Developer"; }
                            else if(
PlayerInfo[i][pAdmin] == 5) { admtext "Main Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 4) { admtext "Senior Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 3) { admtext "Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 2)    { admtext "Global Moderator"; }
                            else if(
PlayerInfo[i][pAdmin] == 1) { admtext "Moderator"; } // Also YOu Can Edit Here The Names.
                            
else if(PlayerInfo[i][pTester] == 3) { admtext "Lead Tester"; }
                            else if(
PlayerInfo[i][pTester] == 2) { admtext "Tester"; }
                            else if(
PlayerInfo[i][pTester] == 1) { admtext "Trial Tester"; }
                            else { 
admtext "Unknown Rank"; }
                        }
                        
GetPlayerName(isendernamesizeof(sendername));
                        if(
PlayerInfo[i][pAdminDuty] == && PlayerInfo[i][pAppearList] == 1)
                        {
                            
format(stringsizeof(string), "%s - %s"admtextsendername);
                            
SendClientMessage(playeridCOLOR_WHITEstring);
                        }
                        else if(
PlayerInfo[i][pAdminDuty] == && PlayerInfo[i][pAppearList] == 1)
                        {
                            
format(stringsizeof(string), "%s - %s (On Duty)"admtextsendername);
                            
SendClientMessage(playeridTEAM_VAGOS_COLORstring);
                        }
                    }
                }
            }
        }
        return 
1;
    }