Help admin script
#1

i know im asking for alot but im new at making admin scripts lol
im using https://sampforum.blast.hk/showthread.php?tid=174575 its a bit hard
i have this code
Код:
dcmd_register(playerid,params[])
{
    new file[256],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.txt",n);
    if(dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are already registered!");
    if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
    if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,ORANGE,"You are already registered, /login");
    dini_Create(file);
            dini_Set(file,"Password",params);
            dini_IntSet(file,"Regged",1);
            dini_IntSet(file,"Logged",0);
            dini_IntSet(file,"Level",0);
            SendClientMessage(playerid,LIGHTBLUE,"Congratulations, you have just registered, please /login");
            PInfo[playerid][Regged] = 1;
            return 1;
        }
    else // error line
    {
        SendClientMessage(playerid,GREY,"USAGE: /register <Password>");
    }
    return 1; //error line
}
Quote:

C:\Users\james\Desktop\server2\filterscripts\fadmi n.pwn(264) : warning 217: loose indentation
C:\Users\james\Desktop\server2\filterscripts\fadmi n.pwn(272) : error 010: invalid function or declaration
C:\Users\james\Desktop\server2\filterscripts\fadmi n.pwn(276) : error 010: invalid function or declaration
2 Errors.

help me out
Reply
#2

shouldnt u ask it there?
the topic is still active i thought
whats line 255 btw?
Reply
#3

i fixed first one now i cant fix this
Reply
#4

Quote:
Originally Posted by FireCat
Посмотреть сообщение
i fixed first one now i cant fix this
You have a bracket that closes but no fitting bracket that opens.

There is one if-statement missing after
pawn Код:
if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,ORANGE,"You are already registered, /login");
Reply
#5

Quote:
Originally Posted by DeathOnaStick
Посмотреть сообщение
You have a bracket that closes but no fitting bracket that opens.

There is one if-statement missing after
pawn Код:
if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,ORANGE,"You are already registered, /login");
whaaa? i didnt understand
Reply
#6

pawn Код:
dcmd_register(playerid,params[])
{
    new file[256],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.txt",n);
    if(dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are already registered!");
    if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
    if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,ORANGE,"You are already registered, /login");
    {
        dini_Create(file);
        dini_Set(file,"Password",params);
        dini_IntSet(file,"Regged",1);
        dini_IntSet(file,"Logged",0);
        dini_IntSet(file,"Level",0);
        SendClientMessage(playerid,LIGHTBLUE,"Congratulations, you have just registered, please /login");
        PInfo[playerid][Regged] = 1;
        return 1;
    }
    else SendClientMessage(playerid,GREY,"USAGE: /register <Password>");
    return 1;
}
Try to do it by your self next time...
Reply
#7

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
pawn Код:
dcmd_register(playerid,params[])
{
    new file[256],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"MyAdmin/Users/%s.txt",n);
    if(dini_Exists(file)) return SendClientMessage(playerid,YELLOW,"You are already registered!");
    if(PInfo[playerid][Regged] == 1) return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
    if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,ORANGE,"You are already registered, /login");    
{
dini_Create(file);
            dini_Set(file,"Password",params);
            dini_IntSet(file,"Regged",1);
            dini_IntSet(file,"Logged",0);
            dini_IntSet(file,"Level",0);
            SendClientMessage(playerid,LIGHTBLUE,"Congratulations, you have just registered, please /login");
            PInfo[playerid][Regged] = 1;
            return 1;
        }
    else // error line
    {
        SendClientMessage(playerid,GREY,"USAGE: /register <Password>");
    }
    return 1; //error line
}
Try to do it by your self next time...
mabe'z i did try stuff but
Quote:

C:\Users\james\Desktop\server2\filterscripts\fadmi n.pwn(263) : warning 217: loose indentation
C:\Users\james\Desktop\server2\filterscripts\fadmi n.pwn(265) : warning 217: loose indentation
C:\Users\james\Desktop\server2\filterscripts\fadmi n.pwn(273) : warning 225: unreachable code
C:\Users\james\Desktop\server2\filterscripts\fadmi n.pwn(273) : warning 217: loose indentation
C:\Users\james\Desktop\server2\filterscripts\fadmi n.pwn(273) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Reply
#8

#pragma tabsize 0 for loose indentation unreachable code i dont know :/
Reply
#9

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
#pragma tabsize 0 for loose indentation unreachable code i dont know :/
k but i get a error to
Reply
#10

so what is line 273?


This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds.
you kidding me>? lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)