error 017: undefined symbol "dcmd"
#6

pawn Код:
// Put this define in the very top of your script right under your includes.

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1


// Then go to OnPlayerCommandText:

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(register, 8, cmdtext); // Just this here.

}


// Then put the command in the bottom of the script, outside any code.

dcmd_register(playerid, params[])
{
    new file[128], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(file, sizeof(file), "\\Users\\%s.ini", pname);
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_DORANGE, "[USAGE]: /register [PASSWORD]");
    if(dini_Exists(file)) return SendClientMessage(playerid, COLOR_DORANGE, "[SYSTEM]: This account is already registered in our database!");
    dini_Create(file);
    dini_IntSet(file, "hashPW", udb_hash(params));
    dini_Set(file, "password", params);
    dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0);
    dini_IntSet(file, "score", PlayerInfo[playerid][score] = 0);
    dini_IntSet(file, "money", PlayerInfo[playerid][cash] = 500);
    new string[128];
    format(string, 128, "[SYSTEM]: You succesfully registered the nickname %s with password %s", pname, params);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    logged[playerid] = 1;
    SendClientMessage(playerid, COLOR_YELLOW, "[SYSTEM]: You have been automatically logged in!");
    return 1;
}
Does this help?
Reply


Messages In This Thread
error 017: undefined symbol "dcmd" - by Crayon - 09.10.2010, 01:06
Re: error 017: undefined symbol "dcmd" - by CrucixTM - 09.10.2010, 01:09
Re: error 017: undefined symbol "dcmd" - by Crayon - 09.10.2010, 01:11
Re: error 017: undefined symbol "dcmd" - by CrucixTM - 09.10.2010, 01:12
Re: error 017: undefined symbol "dcmd" - by Crayon - 09.10.2010, 01:13
Re: error 017: undefined symbol "dcmd" - by CrucixTM - 09.10.2010, 01:18
Re: error 017: undefined symbol "dcmd" - by Retardedwolf - 09.10.2010, 01:19
Re: error 017: undefined symbol "dcmd" - by CrucixTM - 09.10.2010, 01:20
Re: error 017: undefined symbol "dcmd" - by Crayon - 09.10.2010, 01:23
Re: error 017: undefined symbol "dcmd" - by CrucixTM - 09.10.2010, 01:32

Forum Jump:


Users browsing this thread: 1 Guest(s)