22.12.2010, 05:57
Just to clarify, Pawno is the program you are using to code the PAWN language in. So you are new to PAWN.
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Positions\\%s.ini", pname);//leader the name of your folder in scriptfiles
if(!dini_Exists(file))
dini_Create(file);
new Float:x, Float:y, Float:z;
dini_FloatSet( file, "PosX", x );
dini_FloatSet( file, "PosY", y );
dini_FloatSet( file, "PosZ", z );
return 1;
}
public OnPlayerSpawn(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Positions\\%s.ini", pname);//leader the name of your folder in scriptfiles
if( !dini_Exists( file ) ) return 0; // file doesn't exist, don't set their pos.
SetPlayerPos(playerid, dini_Int(file, "Pos"));
return 1;
}