Fix my errors :(
#1

Код:
#include <a_samp>
#include <a_players>
#include <dini>

#define DIALOG_RULES 0
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2

main()
{
	print("\n----------------------------------");
	print(" Freeroam by Stunter");
	print("----------------------------------\n");
}


public OnGameModeInit()
{
	SetGameModeText("Freeroam");
	AddPlayerClass(23,1943.9281,-1383.6829,18.5781,145.8178,24,200,27,500,30,500); // Stunter
	AddStaticVehicle(522,1926.8888,-1415.0078,13.1452,3.9353,6,126); // stunter bikes
	AddStaticVehicle(522,1922.1050,-1414.4047,13.1421,7.9576,6,126); // stunter bikes
	AddStaticVehicle(522,1915.5049,-1415.3289,13.1489,8.5629,6,126); // stunter bikes
	AddStaticVehicle(522,1908.9871,-1415.2377,13.1436,4.8548,6,126); // stunter bikes
	AddStaticVehicle(522,1948.2291,-1377.4291,18.1489,149.6639,6,126); // stunter bikes
	AddStaticVehicle(522,1884.8481,-1371.0393,13.1280,235.3797,6,126); // stunter bikes
	
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1950.6169,-1382.0916,24.1484);
	SetPlayerFacingAngle(playerid, 312.7043);
	SetPlayerCameraPos(playerid, 1954.4738,-1378.3209,24.1484);
	SetPlayerCameraLookAt(playerid, 1950.6169,-1382.0916,24.1484);
	return 1;
}

public OnPlayerConnect(playerid)
{
	new Playerdata(64);
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	format(Playerdata,sizeof(Playerdata),"/Accounts/%s.txt",name);
	if(dini_Exists(Playerdata))
	{
	    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Enter your desired password here to login","Login", "Cancel");
	}
	else
	{
	    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registration", "Write here your desired password:", "Register", "Cancel");
	}
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	ShowPlayerDialog(playerid, DIALOG_RULES,DIALOG_STYLE_MSGBOX,"Rules","No Cheats or hack \n No Racism \n No Adversting others servers website or ip \n Respect players and admins \n Don't insult other players or admins \n Do not Spawnkill or Writekill \n Do not Spam.","Accept","Refuse");
	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[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		// Do something here
		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[])
{
	if(dialogid==DIALOG_LOGIN)
	{
	    if(response=0)
	    {
			Kick(playerid);
			SendClientMessage(playerid, 0x00FFFF0F,"Enter your true password or you get ban");
			return 1;
	    }
	    if(response=1)
	    }
	if(dialogid==DIALOG_REGISTER)
	{
	    if(response=0)
	    {
	        SendClientMessage(playerid, 0x00FFFF0F, "You have to register your account to save your stats");
	        Kick(playerid);
	        return 1;
	    }
	    if(response=1)
	    {
	        if(!strlen(inputtext))
	        {
	            SendClientMessage(playerid, 0xFF0000FF, "The password was not long enough");
            	ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registration", "Write here your desired password:", "Register", "Cancel");
				return 1;
			}
			else
			{
	        Register(playerid,inputtext);
	        return 1;
	        }
	    }
	}
	if(dialogid==DIALOG_RULES)
	{
	    if(response==0)
	    {
	        SendClientMessage(playerid, 0xFFFF00FF,"Have Fun");
	    }
	    if(response==1)
	    {
	        SendClientMessage(playerid, 0xFF00FFF0, "You have to accept server rules");
	        Kick(playerid);
	    }
	}
	return 1;
}

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

stock Register(playerid,key[])
{
	new Playerdata(64);
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	format(Playerdata,sizeof(Playerdata),"/Accounts/%s.txt",name);
	dini_Create(Playerdata);
	dini_Set(Playerdata,"Password",key);
	return 1;
}

stock Login(playerid,key[]=
{

}
	new Playerdata(64);
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	format(Playerdata,sizeof(Playerdata),"/Accounts/%s.txt",name);
	if(!strcmp(key,dini_Set(Playerdata,"Password",false)));
	{
	    SetPlayerScore(playerid,dini_Int(playerdata,"Level"));
	    SendClientMessage(playerid, 0xFF0000FF, "You have login successfully.").
	}
	else
	{
	    SendClientMessage(playerid, 0x00FFFF00, "Wrong Password");
	}
	return 1;
}
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(47) : error 001: expected token: ";", but found "("
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(47) : warning 215: expression has no effect
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(50) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(50) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(51) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(47) : warning 203: symbol is never used: "Playerdata"
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(232) : warning 211: possibly unintended assignment
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(23 : warning 211: possibly unintended assignment
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(239) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(239 -- 240) : warning 215: expression has no effect
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(240) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(242) : warning 211: possibly unintended assignment
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(24 : warning 211: possibly unintended assignment
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(25 : error 017: undefined symbol "Register"
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(27 : error 029: invalid expression, assumed zero
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(27 : error 004: function "OnPlayerClickPlayer" is not implemented
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(283) : warning 225: unreachable code
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(283) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(283) : error 017: undefined symbol "Register"
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(285) : error 001: expected token: ";", but found "("
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(285) : warning 215: expression has no effect
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(28 : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(28 : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(289) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(290) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(285) : warning 203: symbol is never used: "Playerdata"
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(285 -- 294) : warning 225: unreachable code
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(294) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(294) : error 017: undefined symbol "Login"
C:\Documents and Settings\Sanaв.SANA-CHRIDEQ\Bureau\SAMP Server\gamemodes\Freeroam.pwn(294) : fatal error 107: too many error messages on one line

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


19 Errors.

Please someone fix the errors
Reply
#2

Please someone
Reply
#3

pawn Код:
#include <a_samp>
#include <a_players>
#include <dini>

#define DIALOG_RULES 0
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2

main()
{
    print("\n----------------------------------");
    print(" Freeroam by Stunter");
    print("----------------------------------\n");
}


public OnGameModeInit()
{
    SetGameModeText("Freeroam");
    AddPlayerClass(23,1943.9281,-1383.6829,18.5781,145.8178,24,200,27,500,30,500); // Stunter
    AddStaticVehicle(522,1926.8888,-1415.0078,13.1452,3.9353,6,126); // stunter bikes
    AddStaticVehicle(522,1922.1050,-1414.4047,13.1421,7.9576,6,126); // stunter bikes
    AddStaticVehicle(522,1915.5049,-1415.3289,13.1489,8.5629,6,126); // stunter bikes
    AddStaticVehicle(522,1908.9871,-1415.2377,13.1436,4.8548,6,126); // stunter bikes
    AddStaticVehicle(522,1948.2291,-1377.4291,18.1489,149.6639,6,126); // stunter bikes
    AddStaticVehicle(522,1884.8481,-1371.0393,13.1280,235.3797,6,126); // stunter bikes

    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1950.6169,-1382.0916,24.1484);
    SetPlayerFacingAngle(playerid, 312.7043);
    SetPlayerCameraPos(playerid, 1954.4738,-1378.3209,24.1484);
    SetPlayerCameraLookAt(playerid, 1950.6169,-1382.0916,24.1484);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new Playerdata[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Playerdata,sizeof(Playerdata),"/Accounts/%s.txt",name);
    if(dini_Exists(Playerdata))
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Enter your desired password here to login","Login", "Cancel");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registration", "Write here your desired password:", "Register", "Cancel");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    ShowPlayerDialog(playerid, DIALOG_RULES,DIALOG_STYLE_MSGBOX,"Rules","No Cheats or hack \n No Racism \n No Adversting others servers website or ip \n Respect players and admins \n Don't insult other players or admins \n Do not Spawnkill or Writekill \n Do not Spam.","Accept","Refuse");
    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[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        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[])
{
    if(dialogid == DIALOG_LOGIN)
    {
        if(response == 0)
        {
            Kick(playerid);
            SendClientMessage(playerid, 0x00FFFF0F,"Enter your true password or you get ban");
            return 1;
        }
   }
    if(dialogid == DIALOG_REGISTER)
    {
        if(response == 0)
        {
            SendClientMessage(playerid, 0x00FFFF0F, "You have to register your account to save your stats");
            Kick(playerid);
            return 1;
        }
        if(response == 1)
        {
            if(!strlen(inputtext))
            {
                SendClientMessage(playerid, 0xFF0000FF, "The password was not long enough");
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registration", "Write here your desired password:", "Register", "Cancel");
                return 1;
            }
            else
            {
            Register(playerid,inputtext);
            return 1;
            }
        }
    }
    if(dialogid == DIALOG_RULES)
    {
        if(response==0)
        {
            SendClientMessage(playerid, 0xFFFF00FF,"Have Fun");
        }
        if(response==1)
        {
            SendClientMessage(playerid, 0xFF00FFF0, "You have to accept server rules");
            Kick(playerid);
        }
    }
    return 1;
}

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

stock Register(playerid,key[])
{
    new Playerdata[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Playerdata,sizeof(Playerdata),"/Accounts/%s.txt",name);
    dini_Create(Playerdata);
    dini_Set(Playerdata,"Password",key);
    return 1;
}

stock Login(playerid,key[])
{
    new Playerdata(64);
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Playerdata,sizeof(Playerdata),"/Accounts/%s.txt",name);
    if(!strcmp(key,dini_Set(Playerdata,"Password",false)));
    {
        SetPlayerScore(playerid,dini_Int(playerdata,"Level"));
        SendClientMessage(playerid, 0xFF0000FF, "You have login successfully.").
    }
    else
    {
        SendClientMessage(playerid, 0x00FFFF00, "Wrong Password");
    }
    return 1;
}
Reply
#4

That was really easy! Goodjob Clive!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)