SA-MP Forums Archive
"cannot read from file: "YSI\y_ini" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: "cannot read from file: "YSI\y_ini" (/showthread.php?tid=389069)



"cannot read from file: "YSI\y_ini" - Er@x3r - 31.10.2012

#define FILTERSCRIPT
#include <a_samp>
#include <YSI\y_ini>
#if defined FILTERSCRIPT

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4

#define PATH "/Users/%s.ini"

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"

enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
return 1;
}

stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playernam e));
format(string,sizeof(string),PATH,playername);
return string;
}
stock udb_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}

#include <a_samp>

#define TEAM_GROVE 1
#define TEAM_BALLA 2
#define TEAM_VAGO 3
#define TEAM_GROVE_COLOR 0x00FF00AA
#define TEAM_BALLA_COLOR 0xFF00FFAA


#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_SPAWN 0xFF8C55FF
#define COLOR_LIGHTBLUE 0x6DC5F3FF
#define COLOR_ADMIN 0xFF0000FF
#define COLOR_SAY 0x2986CEFF
#define COLOR_SYSGREY 0xC6BEBDFF
#define COLOR_BLACK 0x000000FF
#define COLOR_JOIN 0x74E80099
#define COLOR_WARN 0xBE615099
#define COLOR_RACE 0x00BBBB99
#define COLOR_KRED 0xFF0000FF


new KillingSpree [MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
KillingSpree[killerid] ++;
KillingSpree[playerid] = 0;

if(KillingSpree[killerid] == 3)
{
new string[200];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,200,"%s Good job! reward:5000$ and 5 Score",name);
SendClientMessageToAll(COLOR_ORANGE,string);
SetPlayerScore(playerid,5);
GivePlayerMoney(playerid,5000);
}
if(KillingSpree[killerid] == 6)
{
new string[200];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,200,"%s Monster kill! reward: 10000$ and 10 Score",name);
SendClientMessageToAll(COLOR_ORANGE,string);
SetPlayerScore(playerid,10);
GivePlayerMoney(playerid,10000);
}
if(KillingSpree[killerid] == 9)
{
new string[200];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,200,"%s Dominate! reward: 15000$ 15 Score",name);
SendClientMessageToAll(COLOR_ORANGE,string);
SetPlayerScore(playerid,15);
GivePlayerMoney(playerid,15000);
}
if(KillingSpree[killerid] == 12)
{
new string[200];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,200,"%s Champion! reward: 20000$ 20 Score",name);
SendClientMessageToAll(COLOR_ORANGE,string);
SetPlayerScore(playerid,20);
GivePlayerMoney(playerid,20000);
}
return 1;
}

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by Er@x3r");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by Er@x3r");
print("----------------------------------\n");
}
#endif

public OnGameModeInit()
{

SetGameModeText("Gangwar");

AddPlayerClass(105,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(106,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(107,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(6,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(271,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(270,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(269,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(207,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(103,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(102,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(104,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(296,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(13,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(108,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(109,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(110,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(91,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(114,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(115,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(116,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(292,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(173,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(174,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(175,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(176,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(177,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(156,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(41,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(294,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(228,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(227,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(224,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(208,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(169,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(141,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(120,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(118,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(117,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(163,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(164,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(165,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(166,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(172,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(171,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(192,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(298,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(124,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(125,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(111,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(194,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(100,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(247,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(248,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(181,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(131,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,30,300);
AddPlayerClass(265,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,31,300);
AddPlayerClass(266,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,31,300);
AddPlayerClass(267,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,31,300);
AddPlayerClass(280,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,31,300);
AddPlayerClass(281,1579.8540,-1502.4775,13.5557,50.3949,22,200,25,125,31,300);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
SetPlayerFacingAngle(playerid,0.0);
SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
return 1;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,0x33AA33AA,"Welcome to the server");
return 1;
}

{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_GREEN"Login",""COLOR_GR EEN"Type your own password to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_GREEN"Register","COLOR_ GREEN"Type your own password to register a new account.","Register","Quit");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid)) ;
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_Close(File);
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
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[])
{
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COLOR_GREEN"Register",""COLOR_RED"You have entered an invalid password.\n"COLOR_WHITE"Type your own password to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_Close(File);

SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GR EEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,"COLOR_YELLOW"Success!",""COLO R_GREEN"You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COLOR_RED" You have entered an incorrect password.\n"COLOR_GREEN"Type your own password to login.","Login","Quit");
}
return 1;
}
}
}
return 1;
}

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




just 1 error but when i delete YSI will be more error's what to do?

please help


AW: "cannot read from file: "YSI\y_ini" - Skimmer - 31.10.2012

Check your pawno\includes\YSI directory and search for y_ini include. When you don't find it, i think he's then hided in \extra


Re: "cannot read from file: "YSI\y_ini" - Er@x3r - 31.10.2012

no y_ini is in the good folder (in YSI)


Re: "cannot read from file: "YSI\y_ini" - CmZxC - 31.10.2012

not .server\YSI, must be .server\pawno\includes\YSI\y_ini

open the pawno.exe from the PAWNO folder with includes\YSI\y_ini, open the script manually, try to compile again


AW: "cannot read from file: "YSI\y_ini" - Skimmer - 31.10.2012

http://uploaded.net/file/d2ec4utz

Download it and move it to your \YSI folder


Re: "cannot read from file: "YSI\y_ini" - Red_Dragon. - 31.10.2012

check the complete YSI folder search for it here on SA-MP forums, it is made by Y_Less

BY THE WAY: USE PAWN TAGS