3 error's
#1

pawn Код:
// Real Europian RolePlay has been made by Eric_Graventein
// Version : RERP V1.0
// CopyRight Real Europian RolePlay V1.0 2012
// Scripters : Eric Graventein ( Derek_Westbrook ) : e.graventein@hotmail.nl
// Mappers : Eric Graventein ( Derek_Westbrook ) : e.graventein@hotmail.nl
// Thanks to ******* Tutorial video's! They helped me alot.

//includes
#include <a_samp>
#include <core>
#include <float>
#include <dini>
#include <YSI\y_ini>
//defines
#define BLUE 0xFF0000FF
#define GREY 0xAFAFAFAA
#define GREEN 0x33AA33AA
#define RED 0xAA3333AA
#define YELLOW 0xFFFF00AA
#define WHITE 0xFFFFFFAA
#define Register 0
#define Logged 1
//variables
new players = 0;
new Login[MAX_PLAYERS];
new PlayerRank[MAX_PLAYERS];
new Float: PosX[ MAX_PLAYERS ],
    Float: PosY[ MAX_PLAYERS ],
    Float: PosZ[ MAX_PLAYERS ],
    Float: Angle[ MAX_PLAYERS ],
    Interior[ MAX_PLAYERS ],
    VirtualWorld[ MAX_PLAYERS ]
;

stock user_ini_file(playerid)
{
    new
        string[ 128 ],
        user_name[ MAX_PLAYER_NAME ]
    ;

    GetPlayerName( playerid, user_name, MAX_PLAYER_NAME );
    format( string, sizeof ( string ), "%s.ini", user_name );
    /* scriptfiles directory */
    return
        string;
}

forward @load_user_position( playerid, name[], value[] );

@load_user_position( playerid, name[], value[] )
{
    INI_Float( "PositionX", PosX[ playerid ] );
    INI_Float( "PositionY", PosY[ playerid ] );
    INI_Float( "PositionZ", PosZ[ playerid ] );
    INI_Float( "Angle", Angle[ playerid ] );
    INI_Int( "Interior", Interior[ playerid ] );
    INI_Int( "VirtualWorld", VirtualWorld[ playerid ] );
    return ( 1 );
}

//=======================================================================================================================================================
// Game Mode

main()
{
    print("\n------------------------");
    print(" Real Europian RolePlay ");
    print("------------------------\n");
    print(" All CopyRights by RERP ");
}

public OnGameModeInit()
{
    print("The Game mode was initiated!");
    SetGameModeText("RERP V1.0");
    AddPlayerClass(299, 5, 5, 5, 360, -1, -1, -1, -1, -1, -1);
    return 1;
}

public OnGameModeExit()
{
    print("The Game mode was exited");
    return 1;
}
//=======================================================================================================================================================
// Login/Register/position save

public OnPlayerConnect(playerid)
{
   SendClientMessage(playerid, WHITE, "Welcome to Real Europian RolePlay");
   SendClientMessageToAll(WHITE, "A player joined the server!");
   Login[playerid] = 0;
   new nombre[MAX_PLAYER_NAME], archivo[256];
   GetPlayerName(playerid, nombre, sizeof(nombre));
   format(archivo, sizeof(archivo), "/Users/%s.ini", nombre);
   if (!dini_Exists(archivo))
   {
       ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Please enter a password:", "Okay", "Back");
   }
   else
   {
      ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
   }
   PosX[ playerid ] = 0;
   PosY[ playerid ] = 0;
   PosZ[ playerid ] = 0;
   Angle[ playerid ] = 0;
   Interior[ playerid ] = 0;
   VirtualWorld[ playerid ] = 0;
   INI_ParseFile(user_ini_file(playerid), "load_user_%s", .bExtra = true, .extra = playerid);
   return 1;
}
//=======================================================================================================================================================
// Position save
public OnPlayerDisconnect(playerid, reason)
{
    GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
    GetPlayerFacingAngle( playerid, Angle[ playerid ] );

    new INI:File = INI_Open( user_ini_file( playerid ) );
    INI_SetTag( File, "position" );
    INI_WriteFloat( File, "PositionX", PosX[ playerid ] );
    INI_WriteFloat( File, "PositionY", PosY[ playerid ] );
    INI_WriteFloat( File, "PositionZ", PosZ[ playerid ] );
    INI_WriteFloat( File, "Angle", Angle[ playerid ] );
    INI_WriteInt( File, "Interior", GetPlayerInterior( playerid ) );
    INI_WriteInt( File, "VirtualWorld", GetPlayerVirtualWorld( playerid ) );
    INI_Close( File );
    return ( 1 );
}

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

public OnPlayerSpawn( playerid )
{
    if ( PosX[ playerid ] != 0 && PosY[ playerid ] != 0 && PosZ[ playerid ] != 0 )
    {
        SetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
        SetPlayerFacingAngle( playerid, Angle[ playerid ] );
        SetPlayerInterior( playerid, Interior[ playerid ] );
        SetPlayerVirtualWorld( playerid, VirtualWorld[ playerid ] );
        SendClientMessage( playerid, -1, "welcome to your last position" );
    }
    return ( 1 );
}

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

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

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}

//=======================================================================================================================================================
// Login/Register System

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == Register)
{
    new nombrejugador[MAX_PLAYER_NAME], archivo[256];
    if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Enter the desired password", "Okay", "Back");
    if (!response) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Enter the desired password", "Okay", "Back");
    GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
    format(archivo, sizeof(archivo), "/Users/%s.ini", nombrejugador);
    dini_Create(archivo);
    dini_Set(archivo, "User", nombrejugador);
    dini_Set(archivo, "Password", inputtext);
    ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password ", "Login", "Cancel");
}
if (dialogid == Logged)
{
    new nombrejugador[MAX_PLAYER_NAME], archivo[256], comprobante[256];
    if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Enter your password", "Login", "Back");
    if (!response) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
    GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
    format(archivo, sizeof(archivo), "/Users/%s.ini", nombrejugador);
    format(comprobante, sizeof(comprobante), "%s", dini_Get(archivo, "Password"));
    if (!strcmp (inputtext, comprobante))
    {
        Login[playerid] = 1;
    }
    else
    {
        ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
    }
}
return 1;
}

//=======================================================================================================================================================
errors :

RERP.pwn(186) : warning 202: number of arguments does not match definition
RERP.pwn(204) : warning 203: symbol is never used: "PlayerRank"
RERP.pwn(204) : warning 203: symbol is never used: "players"

i got the login/register script from internet and the save last position from internet to, i am a real noob in scripting so if anywan can make me a login/register and last position save script i would be very happy ! because its a RP script i would also want a /stats command wit level money etc....

please help/advice!
Reply
#2

Show us the lines on the script
Reply
#3

Here it is.
pawn Код:
// Real Europian RolePlay has been made by Eric_Graventein
// Version : RERP V1.0
// CopyRight Real Europian RolePlay V1.0 2012
// Scripters : Eric Graventein ( Derek_Westbrook ) : e.graventein@hotmail.nl
// Mappers : Eric Graventein ( Derek_Westbrook ) : e.graventein@hotmail.nl
// Thanks to ******* Tutorial video's! They helped me alot.

//includes
#include <a_samp>
#include <core>
#include <float>
#include <dini>
#include <YSI\y_ini>
//defines
#define BLUE 0xFF0000FF
#define GREY 0xAFAFAFAA
#define GREEN 0x33AA33AA
#define RED 0xAA3333AA
#define YELLOW 0xFFFF00AA
#define WHITE 0xFFFFFFAA
#define Register 0
#define Logged 1
//variables
new Login[MAX_PLAYERS];
new Float: PosX[ MAX_PLAYERS ],
    Float: PosY[ MAX_PLAYERS ],
    Float: PosZ[ MAX_PLAYERS ],
    Float: Angle[ MAX_PLAYERS ],
    Interior[ MAX_PLAYERS ],
    VirtualWorld[ MAX_PLAYERS ]
;

stock user_ini_file(playerid)
{
    new
        string[ 128 ],
        user_name[ MAX_PLAYER_NAME ]
    ;

    GetPlayerName( playerid, user_name, MAX_PLAYER_NAME );
    format( string, sizeof ( string ), "%s.ini", user_name );
    /* scriptfiles directory */
    return
        string;
}

forward @load_user_position( playerid, name[], value[] );

@load_user_position( playerid, name[], value[] )
{
    INI_Float( "PositionX", PosX[ playerid ] );
    INI_Float( "PositionY", PosY[ playerid ] );
    INI_Float( "PositionZ", PosZ[ playerid ] );
    INI_Float( "Angle", Angle[ playerid ] );
    INI_Int( "Interior", Interior[ playerid ] );
    INI_Int( "VirtualWorld", VirtualWorld[ playerid ] );
    return ( 1 );
}

//=======================================================================================================================================================
// Game Mode

main()
{
    print("\n------------------------");
    print(" Real Europian RolePlay ");
    print("------------------------\n");
    print(" All CopyRights by RERP ");
}

public OnGameModeInit()
{
    print("The Game mode was initiated!");
    SetGameModeText("RERP V1.0");
    AddPlayerClass(299, 5, 5, 5, 360, -1, -1, -1, -1, -1, -1);
    return 1;
}

public OnGameModeExit()
{
    print("The Game mode was exited");
    return 1;
}
//=======================================================================================================================================================
// Login/Register/position save

public OnPlayerConnect(playerid)
{
   SendClientMessage(playerid, WHITE, "Welcome to Real Europian RolePlay");
   SendClientMessageToAll(WHITE, "A player joined the server!");
   Login[playerid] = 0;
   new nombre[MAX_PLAYER_NAME], archivo[256];
   GetPlayerName(playerid, nombre, sizeof(nombre));
   format(archivo, sizeof(archivo), "/Users/%s.ini", nombre);
   if (!dini_Exists(archivo))
   {
       ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Please enter a password:", "Okay", "Back");
   }
   else
   {
      ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
   }
   PosX[ playerid ] = 0;
   PosY[ playerid ] = 0;
   PosZ[ playerid ] = 0;
   Angle[ playerid ] = 0;
   Interior[ playerid ] = 0;
   VirtualWorld[ playerid ] = 0;
   INI_ParseFile(user_ini_file(playerid), "load_user_%s", .bExtra = true, .extra = playerid);
   return 1;
}
//=======================================================================================================================================================
// Position save
public OnPlayerDisconnect(playerid, reason)
{
    GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
    GetPlayerFacingAngle( playerid, Angle[ playerid ] );

    new INI:File = INI_Open( user_ini_file( playerid ) );
    INI_SetTag( File, "position" );
    INI_WriteFloat( File, "PositionX", PosX[ playerid ] );
    INI_WriteFloat( File, "PositionY", PosY[ playerid ] );
    INI_WriteFloat( File, "PositionZ", PosZ[ playerid ] );
    INI_WriteFloat( File, "Angle", Angle[ playerid ] );
    INI_WriteInt( File, "Interior", GetPlayerInterior( playerid ) );
    INI_WriteInt( File, "VirtualWorld", GetPlayerVirtualWorld( playerid ) );
    INI_Close( File );
    return ( 1 );
}

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

public OnPlayerSpawn( playerid )
{
    if ( PosX[ playerid ] != 0 && PosY[ playerid ] != 0 && PosZ[ playerid ] != 0 )
    {
        SetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
        SetPlayerFacingAngle( playerid, Angle[ playerid ] );
        SetPlayerInterior( playerid, Interior[ playerid ] );
        SetPlayerVirtualWorld( playerid, VirtualWorld[ playerid ] );
        SendClientMessage( playerid, -1, "welcome to your last position" );
    }
    return ( 1 );
}

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

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

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}

//=======================================================================================================================================================
// Login/Register System

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == Register)
{
    new nombrejugador[MAX_PLAYER_NAME], archivo[256];
    if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Enter the desired password", "Okay", "Back");
    if (!response) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Enter the desired password", "Okay", "Back");
    GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
    format(archivo, sizeof(archivo), "/Users/%s.ini", nombrejugador);
    dini_Create(archivo);
    dini_Set(archivo, "User", nombrejugador);
    dini_Set(archivo, "Password", inputtext);
    ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password ", "Login", "Cancel");
}
if (dialogid == Logged)
{
    new nombrejugador[MAX_PLAYER_NAME], archivo[256], comprobante[256];
    if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
    if (!response) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
    GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
    format(archivo, sizeof(archivo), "/Users/%s.ini", nombrejugador);
    format(comprobante, sizeof(comprobante), "%s", dini_Get(archivo, "Password"));
    if (!strcmp (inputtext, comprobante))
    {
        Login[playerid] = 1;
    }
    else
    {
        ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
    }
}
return 1;
}
Reply
#4

Quote:
Originally Posted by Trawltrawl
Посмотреть сообщение
Show us the lines on the script
pawn Код:
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Enter your password", "Login", "Back");
this is 186
line 204 doesn't even excist in my script but still pawno says error...
Reply
#5

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
Here it is.
pawn Код:
// Real Europian RolePlay has been made by Eric_Graventein
// Version : RERP V1.0
// CopyRight Real Europian RolePlay V1.0 2012
// Scripters : Eric Graventein ( Derek_Westbrook ) : e.graventein@hotmail.nl
// Mappers : Eric Graventein ( Derek_Westbrook ) : e.graventein@hotmail.nl
// Thanks to ******* Tutorial video's! They helped me alot.

//includes
#include <a_samp>
#include <core>
#include <float>
#include <dini>
#include <YSI\y_ini>
//defines
#define BLUE 0xFF0000FF
#define GREY 0xAFAFAFAA
#define GREEN 0x33AA33AA
#define RED 0xAA3333AA
#define YELLOW 0xFFFF00AA
#define WHITE 0xFFFFFFAA
#define Register 0
#define Logged 1
//variables
new Login[MAX_PLAYERS];
new Float: PosX[ MAX_PLAYERS ],
    Float: PosY[ MAX_PLAYERS ],
    Float: PosZ[ MAX_PLAYERS ],
    Float: Angle[ MAX_PLAYERS ],
    Interior[ MAX_PLAYERS ],
    VirtualWorld[ MAX_PLAYERS ]
;

stock user_ini_file(playerid)
{
    new
        string[ 128 ],
        user_name[ MAX_PLAYER_NAME ]
    ;

    GetPlayerName( playerid, user_name, MAX_PLAYER_NAME );
    format( string, sizeof ( string ), "%s.ini", user_name );
    /* scriptfiles directory */
    return
        string;
}

forward @load_user_position( playerid, name[], value[] );

@load_user_position( playerid, name[], value[] )
{
    INI_Float( "PositionX", PosX[ playerid ] );
    INI_Float( "PositionY", PosY[ playerid ] );
    INI_Float( "PositionZ", PosZ[ playerid ] );
    INI_Float( "Angle", Angle[ playerid ] );
    INI_Int( "Interior", Interior[ playerid ] );
    INI_Int( "VirtualWorld", VirtualWorld[ playerid ] );
    return ( 1 );
}

//=======================================================================================================================================================
// Game Mode

main()
{
    print("\n------------------------");
    print(" Real Europian RolePlay ");
    print("------------------------\n");
    print(" All CopyRights by RERP ");
}

public OnGameModeInit()
{
    print("The Game mode was initiated!");
    SetGameModeText("RERP V1.0");
    AddPlayerClass(299, 5, 5, 5, 360, -1, -1, -1, -1, -1, -1);
    return 1;
}

public OnGameModeExit()
{
    print("The Game mode was exited");
    return 1;
}
//=======================================================================================================================================================
// Login/Register/position save

public OnPlayerConnect(playerid)
{
   SendClientMessage(playerid, WHITE, "Welcome to Real Europian RolePlay");
   SendClientMessageToAll(WHITE, "A player joined the server!");
   Login[playerid] = 0;
   new nombre[MAX_PLAYER_NAME], archivo[256];
   GetPlayerName(playerid, nombre, sizeof(nombre));
   format(archivo, sizeof(archivo), "/Users/%s.ini", nombre);
   if (!dini_Exists(archivo))
   {
       ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Please enter a password:", "Okay", "Back");
   }
   else
   {
      ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
   }
   PosX[ playerid ] = 0;
   PosY[ playerid ] = 0;
   PosZ[ playerid ] = 0;
   Angle[ playerid ] = 0;
   Interior[ playerid ] = 0;
   VirtualWorld[ playerid ] = 0;
   INI_ParseFile(user_ini_file(playerid), "load_user_%s", .bExtra = true, .extra = playerid);
   return 1;
}
//=======================================================================================================================================================
// Position save
public OnPlayerDisconnect(playerid, reason)
{
    GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
    GetPlayerFacingAngle( playerid, Angle[ playerid ] );

    new INI:File = INI_Open( user_ini_file( playerid ) );
    INI_SetTag( File, "position" );
    INI_WriteFloat( File, "PositionX", PosX[ playerid ] );
    INI_WriteFloat( File, "PositionY", PosY[ playerid ] );
    INI_WriteFloat( File, "PositionZ", PosZ[ playerid ] );
    INI_WriteFloat( File, "Angle", Angle[ playerid ] );
    INI_WriteInt( File, "Interior", GetPlayerInterior( playerid ) );
    INI_WriteInt( File, "VirtualWorld", GetPlayerVirtualWorld( playerid ) );
    INI_Close( File );
    return ( 1 );
}

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

public OnPlayerSpawn( playerid )
{
    if ( PosX[ playerid ] != 0 && PosY[ playerid ] != 0 && PosZ[ playerid ] != 0 )
    {
        SetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
        SetPlayerFacingAngle( playerid, Angle[ playerid ] );
        SetPlayerInterior( playerid, Interior[ playerid ] );
        SetPlayerVirtualWorld( playerid, VirtualWorld[ playerid ] );
        SendClientMessage( playerid, -1, "welcome to your last position" );
    }
    return ( 1 );
}

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

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

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}

//=======================================================================================================================================================
// Login/Register System

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == Register)
{
    new nombrejugador[MAX_PLAYER_NAME], archivo[256];
    if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Enter the desired password", "Okay", "Back");
    if (!response) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Enter the desired password", "Okay", "Back");
    GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
    format(archivo, sizeof(archivo), "/Users/%s.ini", nombrejugador);
    dini_Create(archivo);
    dini_Set(archivo, "User", nombrejugador);
    dini_Set(archivo, "Password", inputtext);
    ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password ", "Login", "Cancel");
}
if (dialogid == Logged)
{
    new nombrejugador[MAX_PLAYER_NAME], archivo[256], comprobante[256];
    if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
    if (!response) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
    GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
    format(archivo, sizeof(archivo), "/Users/%s.ini", nombrejugador);
    format(comprobante, sizeof(comprobante), "%s", dini_Get(archivo, "Password"));
    if (!strcmp (inputtext, comprobante))
    {
        Login[playerid] = 1;
    }
    else
    {
        ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Login", "Enter your password", "Login", "Back");
    }
}
return 1;
}
holy hizz balls it works !thanks you so much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)