18.07.2012, 03:40
my whole code is
i dont know if its right
pawn Code:
public OnPlayerConnect(playerid)
{
new pName[MAX_PLAYER_NAME], file[64];
GetPlayerName(playerid, pName, sizeof(pName));
format(file, sizeof(file), "Players/%s.ini", pName);
if(!dini_Exists(file)) gTeam[playerid] = TEAM_CIV;
else gTeam[playerid] = dini_Int(file, "Teams");
wanted = dini_Int(file, "Wanted");
positionx = dini_Int(file, "PositionX");
positiony = dini_Int(file, "PositionY");
positionz = dini_Int(file, "PositionZ");
skin = dini_Int(file, "skin");
public OnPlayerDisconnect(playerid, reason)
{
new Float:x;
new Float:y;
new Float:z;
GetPlayerPos(playerid,x,y,z);
skin = GetPlayerSkin(playerid);
positionx = x;
positiony = y;
positionz = z;
wanted = GetPlayerWantedLevel(playerid);
new pName[MAX_PLAYER_NAME], file[64];
GetPlayerName(playerid, pName, sizeof(pName));
format(file, sizeof(file), "Players/%s.ini", pName);
if(!dini_Exists(file)) dini_Create(file);
dini_IntSet(file, "Teams", gTeam[playerid]);
dini_IntSet(file, "Wanted",wanted);
dini_IntSet(file, "PositionX", floatround(positionx));
dini_IntSet(file, "PositionY", floatround(positiony));
dini_IntSet(file, "PositionZ", floatround(positionz));
dini_IntSet(file, "Skin", (skin));
return 1;
}
public OnPlayerSpawn(playerid)
{
if (!dini_Exists(file)) {
SetPlayerPos(playerid,1647.1093,-2308.5242,14.5156);
}
else
{
SetPlayerPos(playerid, positionx,positiony,positionz);
SetPlayerSkin(playerid,skin);
}
return 1;
}