Admin on~off duty
#1

Hi,if anyone could create a filterscript on which admin can be on and off duty,i need it for my server as quickly as possible,my server is running on 0.2x
Reply
#2

Hi Johny_James,

A pretty simple function really

Код:
//Top of script
new AdminDuty[MAX_PLAYERS];

//OnPlayerConnect
AdminDuty[playerid] = 0;

//OnPlayerCommand
if(strcmp(cmdtext,"/adminduty",true) == 0)
{

    if(IsPlayerAdmin(playerid))
    {
        
        if(AdminDuty[playerid] == 0)
        {
             AdminDuty[playerid] = 1;
             SetPlayerColor(playerid,CUSTOM_COLOR);
             return 1;
         }
         else
         {
             AdminDuty[playerid] = 0;
             SetPlayerColour(playerid,DEFAULT_COLOUR);
             return 1;
         }

    }
    else
    {
        SendClientMessage(playerid,COLOUR_WARNING,"You are not an administrator!");
        return 1;
     }

}
Hope this helped out!

Cheers,

TJ
Reply
#3

man,i'm not very much pro on this scripting thing,but i've opened pawno and copied it with #include <a_samp> saved and compiled and it made 11 errors,so could you maybe give me complete or correct one?And download link would be awesome
Reply
#4

Please show us your errors. Also the lines where the compiler says the errors are.
Reply
#5

if(strcmp("/adminduty",cmdtext,true) == 0 )
OnPlayerConnect
AdminDuty[playerid]= 1
if(IsPlayerAdmin(playerid))
if(AdminDuty[playerid]) == 1)
AdminDuty[Playerid] == 1
Setplayercolor(playerid,COLOR_YOU_WANT);


done , if you got any problem i will repair
Reply
#6

Quote:
Originally Posted by DJDhan
Посмотреть сообщение
Please show us your errors. Also the lines where the compiler says the errors are.
C:\Users\Uros\Desktop\test.pwn(7) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(10) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(13) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(16) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(20) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(22) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(26) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(29) : error 054: unmatched closing brace ("}")
C:\Users\Uros\Desktop\test.pwn(30) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(33) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(36) : error 054: unmatched closing brace ("}")
C:\Users\Uros\Desktop\test.pwn(37) : warning 203: symbol is never used: "AdminDuty"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


11 Errors.

__________________________________________________ ______________________________________________


Quote:

if(strcmp("/adminduty",cmdtext,true) == 0 )
OnPlayerConnect
AdminDuty[playerid]= 1
if(IsPlayerAdmin(playerid))
if(AdminDuty[playerid]) == 1)
AdminDuty[Playerid] == 1
Setplayercolor(playerid,COLOR_YOU_WANT);


done , if you got any problem i will repair

3 errors my friend

C:\Users\Uros\Desktop\test.pwn(3) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(6) : error 010: invalid function or declaration
C:\Users\Uros\Desktop\test.pwn(7) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.


i'm gonna say again,if you could just give me download links from amx and pwn.That would be really nice!
Reply
#7

So i'm still waiting if someone could help me?
Reply
#8

Did you change "COLOR_YOU_WANT"??

setplayercolor(playerid,COLOR_YOU_WANT)
Reply
#9

i told everyone,i'm not such good scripter,just give me pwn!
Reply
#10

Quote:
Originally Posted by Johny_James
Посмотреть сообщение
i told everyone,i'm not such good scripter,just give me pwn!
You didn't answer my question? Did you change it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)