Register Sys
#1

Quote:

C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(1 : error 021: symbol already defined: "PlayerInfo"
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(69) : error 055: start of function body without function header
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(70) : error 010: invalid function or declaration
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(75) : error 055: start of function body without function header
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(76) : error 010: invalid function or declaration
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(105) : error 001: expected token: ";", but found "new"
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(106) : error 010: invalid function or declaration
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(107) : error 010: invalid function or declaration
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(110) : error 010: invalid function or declaration
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(112) : error 010: invalid function or declaration
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(114) : error 010: invalid function or declaration
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(116) : error 021: symbol already defined: "dini_Create"
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(117) : error 021: symbol already defined: "dini_IntSet"
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(117) : error 010: invalid function or declaration
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(117 -- 11 : error 021: symbol already defined: "dini_IntSet"
C:\Documents and Settings\Dean\Desktop\Other servers\gamemodes\boom.pwn(117 -- 11 : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Heres the code the problem is?
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <dini>
#include <dudb>
new IsLogged[MAX_PLAYERS];enum pInfo
{

}
new PlayerInfo[MAX_PLAYERS][pInfo];
enum pInfo
{
	AdminLevel,
     Cash,
}
new PlayerInfo[MAX_PLAYERS][pInfo];

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerConnect(playerid)
IsLogged[playerid] = 0;
}
	return 1;


public OnPlayerDisconnect(playerid, reason)
IsLogged[playerid] = 0;
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText
new cmd[256], idx, file[128], tmp[256], tmp2[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/register", true) == 0)
	{
	  new name[MAX_PLAYER_NAME];
	  tmp = strtok(cmdtext, idx);
	  GetPlayerName(playerid, name, sizeof(name));
	  if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /register [password]");
	  format(file,sizeof(file),"%s.ini",name);
	  if(!fexist(file))
			{
			  dini_Create(file);
			  dini_IntSet(file, "Password", udb_hash(tmp));
			  dini_IntSet(file,"AdminLevel", 0);
			  dini_IntSet(file,"Cash", 0);
			  SendClientMessage(playerid, eadmin, "[System]: Account Created!");
			  PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
			  GetPlayerName(playerid, name, sizeof(name));
			  printf("%s has registered a account!", name);
			}
			else
			{
			  SendClientMessage(playerid, COLOR, " Account Already Found In Database");
                PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
			}
		return 1;
	}
	return 0;
}
	if(strcmp(cmd, "/login", true) == 0)
	{
	  new PlayerName[24];
	  tmp = strtok(cmdtext, idx);
	  if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /login [password]");
		new name[MAX_PLAYER_NAME];
		if(IsLogged[playerid] == 1)
		{
			SendClientMessage(playerid, COLOR, "You already are logged in!");
			return 1;
		}
		else
		{
			GetPlayerName(playerid, name, sizeof(name));
			format(file,sizeof(file),"%s.ini",name);
			if(fexist(file))
			{
		  	tmp2 = dini_Get(file, "Password");
			 	if(udb_hash(tmp) != strval(tmp2))
				{
				  SendClientMessage(playerid, COLOR, "Login Failed!");
	 			  GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
	 			  printf("%s has failed to login", name);
				}
				else
				{
				 	IsLogged[playerid] = 1;
				 	SetPlayerMoney(playerid, dini_Int(file, "Cash"));
					PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
					SendClientMessage(playerid, COLOR, "[System]: Account Logged into!");
				}
			}
		}
		return 1;
	}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
Reply
#2

You have tried to Deamx the code..
Reply
#3

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <dini>
#include <dudb>

#define COLOR_WHITE 0xFFFFFFAA

#pragma unused ret_memcpy
#pragma tabsize 0

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

enum pInfo
{
    AdminLevel,
    Cash
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new IsLogged[MAX_PLAYERS];

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    IsLogged[playerid] = 0;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    IsLogged[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx, file[128], tmp[256], tmp2[256];
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/register", true) == 0)
    {
        new name[MAX_PLAYER_NAME];
        tmp = strtok(cmdtext, idx);
        GetPlayerName(playerid, name, sizeof(name));
        if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /register [password]");
        format(file,sizeof(file),"Users/%s.ini",name);
        if(!fexist(file))
        {
            dini_Create(file);
            dini_IntSet(file, "Password", udb_hash(tmp));
            dini_IntSet(file,"AdminLevel", 0);
            dini_IntSet(file,"Cash", 0);
            SendClientMessage(playerid, COLOR_WHITE, "[System]: Account Created!");
            PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
            GetPlayerName(playerid, name, sizeof(name));
            printf("%s has registered a account!", name);
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, " Account Already Found In Database");
            PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        }
        return 1;
    }
    if(strcmp(cmd, "/login", true) == 0)
    {
        new PlayerName[24];
        tmp = strtok(cmdtext, idx);
        if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /login [password]");
        new name[MAX_PLAYER_NAME];
        if(IsLogged[playerid] == 1)
        {
            SendClientMessage(playerid, COLOR_WHITE, "You already are logged in!");
            return 1;
        }
        else
        {
            GetPlayerName(playerid, name, sizeof(name));
            format(file,sizeof(file),"%s.ini",name);
            if(fexist(file))
            {
            tmp2 = dini_Get(file, "Password");
                if(udb_hash(tmp) != strval(tmp2))
                {
                  SendClientMessage(playerid, COLOR_WHITE, "Login Failed!");
                  GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
                  printf("%s has failed to login", name);
                }
                else
                {
                    IsLogged[playerid] = 1;
                    SetPlayerMoney(playerid, dini_Int(file, "Cash"));
                    PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
                    SendClientMessage(playerid, COLOR_WHITE, "[System]: Account Logged into!");
                }
            }
        }
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Redone.
Reply
#4

Just remove the strtok part and it will work fine.
Reply
#5

Quote:
Originally Posted by Adil
Посмотреть сообщение
Just remove the strtok part and it will work fine.
Remove the strtok, you will receive errors...
Reply
#6

Quote:
Originally Posted by Kush
Посмотреть сообщение
Remove the strtok, you will receive errors...
strtok is already defined in dutils which is needed to start either dini or dudb.
Reply
#7

He's not using the dutils include. And the account registers fine into the Users folder. I'm not fond of Dini and it's resources, but I've tested it and seems fine to me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)