4 Errors help please. -
And i did the same as he did.
I got 4 errors i don't know how to fix it.
pawn Code:
/*
Flatron Gamemode [0.3c] 1.0 Loaded!
*/
#include <a_samp>
#include <SII>
//Register & Login Dialogs.
#define DIALOG_REGISTER 2000
#define DIALOG_LOGIN 2001
#if defined FILTERSCRIPT
//Colors
#define WHITE "{FFFFFF}"
#define SERVERCOL "{C35617}"
#define RED "{F81414}"
/*------------------------------.------------------------------*/
new gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
/*------------------------------.Enums.------------------------------*/
enum pInfo
{
pPass,
pScore,
pCash,
pAdmin,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
//Stock
stock getINI(playerid)
{
new account[64];
format(account,30,"Users/%s.ini",gPlayerName[playerid]);
return account;
}
main()
{
print("\n--------------------------------------");
print(" Flatron Gamemode [0.3c] 1.0 Loaded!");
print("--------------------------------------\n");
}
#endif
public OnGameModeInit()
{
//GameMode Text.
SetGameModeText("San Andreas");
return 1;
}
public OnPlayerConnect(playerid)
{
//Connect Message.
new string[64], jName[MAX_PLAYER_NAME];
GetPlayerName(playerid,jName,MAX_PLAYER_NAME);
format(string,sizeof string,"{C35617}%s (ID %d) has joined the server.",jName,playerid);
SendClientMessageToAll(0xFFFFFFAA,string);
//Register & Login Dialogs.
GetPlayerName(playerid, gPlayerName[playerid], MAX_PLAYER_NAME);
if (fexist(getINI(playerid)))
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login Dialog.",""SERVERCOL"Type your password below to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""WHITE"Register Dialog.",""SERVERCOL"Type your password below to register a new account.","Register","Quit");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(INI_Open(getINI(playerid))) {
INI_WriteInt("Score",PlayerInfo[playerid][pScore]);
INI_WriteInt("Cash",PlayerInfo[playerid][pCash]);
INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]);
INI_Save();
INI_Close();
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if (response)
{
if(!strlen(inputtext)) {
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""WHITE"Register Dialog.",""RED"You have entered an invalid password.\n"SERVERCOL"Type your password below to register a new account.","Register","Quit");
}
if(INI_Open(getINI(playerid))) {
INI_WriteString("Password",inputtext);
INI_WriteInt("Score",1);
INI_WriteInt("Cash",5000);
INI_WriteInt("Admin",0);
INI_Save();
INI_Close();
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login Dialog.",""RED"You have entered an incorrect password.\n"SERVERCOL"Type your password below to login.","Login","Quit");
}
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(!strlen(inputtext)) {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login Dialog.",""RED"You have entered an invalid password.\n"SERVERCOL"Type your password below to login.","Login","Quit");
}
if(INI_Open(getINI(playerid))) {
INI_ReadString(PlayerInfo[playerid][pPass],"Password",20);
if(strcmp(inputtext,PlayerInfo[playerid][pPass],false)) {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login Dialog.",""RED"You have entered an incorrect password.\n"SERVERCOL"Type your password below to login.","Login","Quit");
}
PlayerInfo[playerid][pScore] = INI_ReadInt("Score");
GivePlayerMoney(playerid, INI_ReadInt("Cash"));
PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
INI_Close();
}
}
}
}
return 1;
}
Re: 4 Errors help please. -
Re: 4 Errors help please. -
Both would work.
EDIT: [HiC]TheKiller was faster. ^^
Re: 4 Errors help please. -