Alberto_Johnson
Компетентный
Доброго времени суток дамы и господа.
Я начал писать new.pwn.
Когда я получаю 2 лвл он даёться я выхожу он сохранился захожу на сервер и после спавна он воозращает на 1 лвл.
В чем может быть проблемма?
Я начал писать new.pwn.
Когда я получаю 2 лвл он даёться я выхожу он сохранился захожу на сервер и после спавна он воозращает на 1 лвл.
В чем может быть проблемма?
PHP:
public OnPlayerSpawn(playerid)
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы были кикнуты с сервера, Причина: Необходимо авторизоваться!");
Kick(playerid);
return true;
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if (dostup[playerid] != true) return ShowPlayerDialog(playerid,9922,DIALOG_STYLE_PASSWORD,"Админ-панель.","{E3BE88}Введите админ-пароль для доступа к администрированию.","Далее","Отмена");
}
SetPlayerSpawn(playerid);
SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
return 1;
}
PHP:
stock SetPlayerSpawn(playerid)
{
if(PlayerInfo[playerid][pBanned] == 1)
{
SetPlayerInterior(playerid,0);
SetPlayerFacingAngle(playerid, 179.5547);
SetPlayerCameraPos(playerid,-1817.0808,1112.9937,235.4244);
SetPlayerCameraLookAt(playerid,-1816.5471,949.6590,235.4244);
ShowPlayerDialog(playerid, 52, DIALOG_STYLE_MSGBOX, "{ff2400}Информация", "{ff2400}Этот аккаунт заблокирован\n{F74848}» Введите{FFFFFF}: /q(uit) для выхода", "Закрыть.", "");
Kick(playerid);
return true;
}
if(PlayerInfo[playerid][pTuts] == 0)
{
SetPlayerPos(playerid,1125.3031,5.3819,1002.0859);
SetPlayerFacingAngle(playerid, 179.5547);
SetPlayerCameraPos(playerid,-1817.0808,1112.9937,235.4244);
SetPlayerCameraLookAt(playerid,-1816.5471,949.6590,235.4244);
ShowPlayerDialog(playerid,7,DIALOG_STYLE_MSGBOX,"Выбор пола","Какого пола будет ваш персонаж?","Мужчина","Женщина");
TogglePlayerControllable(playerid, 0);
}
else
{
if(PlayerInfo[playerid][pLevel] >= 0)
{
SetPlayerPos(playerid, 1221.2908,-1813.4840,16.5938);
SetPlayerFacingAngle(playerid, 241.5923);
SetPlayerInterior(playerid,0);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid, 0);
}
}
return 1;
}
PHP:
public OnPlayerUpdateRL(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
new string3[512];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "players/%s.ini", playername3);
new File = ini_openFile(string3);
if(!File)
{
iniSetInt(File,"Level",PlayerInfo[playerid][pLevel]);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
iniSetInt(File,"Exp",PlayerInfo[playerid][pExp]);
iniSetInt(File,"Rang",PlayerInfo[playerid][pRang]);
iniSetInt(File,"Member",PlayerInfo[playerid][pMember]);
iniSetInt(File,"Leader",PlayerInfo[playerid][pLeader]);
iniSetInt(File,"Admin", PlayerInfo[playerid][pAdmin]);
iniSetInt(File,"Sex",PlayerInfo[playerid][pSex]);
iniSetInt(File,"Local",PlayerInfo[playerid][pLocal]);
iniSetInt(File,"Money",PlayerInfo[playerid][pCash]);
iniSetInt(File,"rules",PlayerInfo[playerid][pTuts]);
iniSetInt(File,"Friend",PlayerInfo[playerid][pDrug]);
iniSetInt(File,"Friend",PlayerInfo[playerid][pModel]);
iniSetInt(File,"Email",PlayerInfo[playerid][pEmail]);
iniSetInt(File,"Local",PlayerInfo[playerid][pLocal]);
iniSetInt(File,"Number",PlayerInfo[playerid][pPnumber]);
iniSetInt(File,"Int",PlayerInfo[playerid][pInt]);
iniSetInt(File,"Registr",PlayerInfo[playerid][pReg]);
iniSetInt(File,"Char",PlayerInfo[playerid][pChar]);
iniSetInt(File,"Team",PlayerInfo[playerid][pTeam]);
GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
iniSetFloat(File,"Health",PlayerInfo[playerid][pHealth]);
iniSetInt(File,"Bank",PlayerInfo[playerid][pBank]);
iniSetFloat(File,"Pos_x",PlayerInfo[playerid][pPos_x]);
iniSetFloat(File,"Pos_y",PlayerInfo[playerid][pPos_y]);
iniSetInt(File, "AdminPass", PlayerInfo[playerid][pDostup]);
iniSetInt(File,"Local",PlayerInfo[playerid][pLocal]);
iniSetInt(File, "AdminKick", PlayerInfo[playerid][pDostup1]);
iniSetFloat(File,"Pos_z",PlayerInfo[playerid][pPos_z]);
iniClose(File);
if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
{
PlayerInfo[playerid][pPos_x] = 1684.9;
PlayerInfo[playerid][pPos_y] = -2244.5;
PlayerInfo[playerid][pPos_z] = 13.5;
}
if(Spectate[playerid] != 255)
{
PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
}
iniSetInt(File,"Banned",PlayerInfo[playerid][pBanned]);
}
}
}
return true;
}
PHP:
public OnPlayerLogin(playerid,password[])
{
new pass[64];
new tmp2[128];
new string[256];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string, sizeof(string), "players/%s.ini", playername2);
new File = iniOpen(string);
if(!File)
{
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
iniGet(File,"password",pass);
iniGetInt(File,"Level",PlayerInfo[playerid][pLevel]);
iniGetInt(File,"Exp",PlayerInfo[playerid][pExp]);
iniGetInt(File,"Rang",PlayerInfo[playerid][pRang]);
iniGetInt(File,"Member",PlayerInfo[playerid][pMember]);
iniGetInt(File,"Leader",PlayerInfo[playerid][pLeader]);
iniGetInt(File,"Sex",PlayerInfo[playerid][pSex]);
iniGetInt(File,"Admin", PlayerInfo[playerid][pAdmin]);
iniGetInt(File,"rules",PlayerInfo[playerid][pTuts]);
iniSetInt(File,"Bank",PlayerInfo[playerid][pBank]);
iniSetInt(File,"Friend",PlayerInfo[playerid][pDrug]);
iniSetInt(File,"Friend",PlayerInfo[playerid][pModel]);
iniSetInt(File,"Team",PlayerInfo[playerid][pTeam]);
iniGetInt(File,"Local",PlayerInfo[playerid][pLocal]);
iniGetInt(File,"Deaths", PlayerInfo[playerid][pDeaths]);
iniGetInt(File,"Kills", PlayerInfo[playerid][pKills]);
iniGetInt(File,"Email",PlayerInfo[playerid][pEmail]);
iniSetInt(File,"Registr",PlayerInfo[playerid][pReg]);
iniGetFloat(File,"Health",PlayerInfo[playerid][pHealth]);
iniGetInt(File,"Char",PlayerInfo[playerid][pChar]);
iniSetInt(File,"Money",PlayerInfo[playerid][pCash]);
iniSetInt(File, "AdminPass", PlayerInfo[playerid][pDostup]);
iniGetFloat(File,"Pos_x",PlayerInfo[playerid][pPos_x]);
iniSetFloat(File,"Pos_y",PlayerInfo[playerid][pPos_y]);
iniSetFloat(File,"Pos_z",PlayerInfo[playerid][pPos_z]);
iniSetInt(File,"Int",PlayerInfo[playerid][pInt]);
iniGetInt(File,"Banned",PlayerInfo[playerid][pBanned]);
iniGetInt(File,"Local",PlayerInfo[playerid][pLocal]);
iniSetInt(File, "AdminKick", PlayerInfo[playerid][pDostup1]);
ini_closeFile(File);
}
SetPlayerCash(playerid,PlayerInfo[playerid][pCash]);
if(PlayerInfo[playerid][pReg] == 0)
{
PlayerInfo[playerid][pLevel] = 1;
PlayerInfo[playerid][pHealth] = 100.0;
PlayerInfo[playerid][pPos_x] = 1221.2908;
PlayerInfo[playerid][pPos_y] = -1813.4840;
PlayerInfo[playerid][pPos_z] = 16.5938;
PlayerInfo[playerid][pLocal] = 255;
PlayerInfo[playerid][pModel] = 78;
PlayerInfo[playerid][pTeam] = 3;
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 255;
new randphone = 100000 + random(899999);
PlayerInfo[playerid][pPnumber] = randphone;
PlayerInfo[playerid][pReg] = 1;
new year, month,day;
new playersip[64];
getdate(year, month, day);
GetPlayerIp(playerid,playersip,sizeof(playersip));
format(string, sizeof(string), "players/%s.ini",PlayerInfo[playerid][pName]);
new file = ini_openFile(string);
if(file < 0) print("нету файла");
else
{
new strstre[100];
format(strstre,sizeof(strstre),"%d/%d/%d",day,month,year);
ini_setString(File,"DataReg",strstre);
ini_setString(File,"IpReg",playersip);
ini_closeFile(File);
}
}
SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~b~ %s", playername2);
gPlayerLogged[playerid] = true;
GameTextForPlayer(playerid, tmp2, 5000, 1);
SpawnPlayer(playerid);
return true;
}
PHP:
stock SavePlayer(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid])
{
new string3[32];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "players/%s.ini", playername3);
new File = iniOpen(string3);
if(!File)
{
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
iniSetInt(File,"Level",PlayerInfo[playerid][pLevel]);
iniSetInt(File,"Rang",PlayerInfo[playerid][pRang]);
iniSetInt(File,"Member",PlayerInfo[playerid][pMember]);
iniSetInt(File,"Leader",PlayerInfo[playerid][pLeader]);
iniSetInt(File,"Password",PlayerInfo[playerid][pPassword]);
iniSetInt(File,"Exp",PlayerInfo[playerid][pExp]);
iniSetInt(File,"Friend",PlayerInfo[playerid][pDrug]);
iniSetInt(File,"Local",PlayerInfo[playerid][pLocal]);
iniSetInt(File,"rules",PlayerInfo[playerid][pTuts]);
iniSetInt(File,"Sex",PlayerInfo[playerid][pSex]);
iniSetInt(File,"Team",PlayerInfo[playerid][pTeam]);
iniSetInt(File,"Registr",PlayerInfo[playerid][pReg]);
GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
iniSetInt(File,"Money",PlayerInfo[playerid][pCash]);
iniSetFloat(File,"Health",PlayerInfo[playerid][pHealth]);
iniSetInt(File, "AdminKick", PlayerInfo[playerid][pDostup1]);
iniSetInt(File,"Bank",PlayerInfo[playerid][pBank]);
iniSetFloat(File,"Pos_x",PlayerInfo[playerid][pPos_x]);
iniSetFloat(File,"Pos_y",PlayerInfo[playerid][pPos_y]);
iniGetInt(File,"Deaths", PlayerInfo[playerid][pDeaths]);
iniSetInt(File,"Char",PlayerInfo[playerid][pChar]);
iniGetInt(File,"Kills", PlayerInfo[playerid][pKills]);
iniGetInt(File,"Int",PlayerInfo[playerid][pInt]);
iniSetInt(File,"Local",PlayerInfo[playerid][pLocal]);
iniSetFloat(File,"Pos_z",PlayerInfo[playerid][pPos_z]);
iniSetInt(File,"Friend",PlayerInfo[playerid][pModel]);
iniSetInt(File,"Admin", PlayerInfo[playerid][pAdmin]);
iniSetInt(File, "AdminPass", PlayerInfo[playerid][pDostup]);
ini_closeFile(File);
if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
{
PlayerInfo[playerid][pPos_x] = 1684.9;
PlayerInfo[playerid][pPos_y] = -2244.5;
PlayerInfo[playerid][pPos_z] = 13.5;
}
if(Spectate[playerid] != 255)
{
PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
}
iniSetInt(File,"Banned",PlayerInfo[playerid][pBanned]);
}
}
}
return true;
}
PHP:
stock OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[32];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "players/%s.ini", playername3);
new File = iniOpen(string3);
if(!File)
{
iniSet(File,"password",MD5_Hash(password));
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
iniSetInt(File,"Level",PlayerInfo[playerid][pLevel]);
iniSetInt(File,"Exp",PlayerInfo[playerid][pExp]);
iniSetInt(File,"Rang",PlayerInfo[playerid][pRang]);
iniSetInt(File,"Member",PlayerInfo[playerid][pMember]);
iniSetInt(File,"Leader",PlayerInfo[playerid][pLeader]);
iniSetInt(File,"Admin", PlayerInfo[playerid][pAdmin]);
iniSetInt(File,"Email",PlayerInfo[playerid][pEmail]);
iniSetInt(File,"Sex",PlayerInfo[playerid][pSex]);
iniSetInt(File,"Friend",PlayerInfo[playerid][pDrug]);
iniSetInt(File,"Money",PlayerInfo[playerid][pCash]);
iniSetInt(File,"Team",PlayerInfo[playerid][pTeam]);
iniSetInt(File,"Local",PlayerInfo[playerid][pLocal]);
iniSetInt(File,"Registr",PlayerInfo[playerid][pReg]);
iniSetInt(File,"Number",PlayerInfo[playerid][pPnumber]);
iniSetInt(File, "AdminKick", PlayerInfo[playerid][pDostup1]);
iniSetInt(File,"Bank",PlayerInfo[playerid][pBank]);
GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
iniSetFloat(File,"Health",PlayerInfo[playerid][pHealth]);
iniSetFloat(File,"Pos_x",PlayerInfo[playerid][pPos_x]);
iniGetInt(File,"Deaths", PlayerInfo[playerid][pDeaths]);
iniSetInt(File,"Char",PlayerInfo[playerid][pChar]);
iniGetInt(File,"Kills", PlayerInfo[playerid][pKills]);
iniSetFloat(File,"Pos_y",PlayerInfo[playerid][pPos_y]);
iniSetInt(File, "AdminPass", PlayerInfo[playerid][pDostup]);
iniSetFloat(File,"Pos_z",PlayerInfo[playerid][pPos_z]);
iniSetInt(File,"Local",PlayerInfo[playerid][pLocal]);
iniSetInt(File,"rules",PlayerInfo[playerid][pTuts]);
iniGetInt(File,"Int",PlayerInfo[playerid][pInt]);
iniSetInt(File,"Friend",PlayerInfo[playerid][pModel]);
iniSetInt(File,"Local",PlayerInfo[playerid][pLocal]);
ini_closeFile(File);
if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
{
PlayerInfo[playerid][pPos_x] = 1684.9;
PlayerInfo[playerid][pPos_y] = -2244.5;
PlayerInfo[playerid][pPos_z] = 13.5;
}
if(Spectate[playerid] != 255)
{
PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
}
iniSetInt(File,"Banned",PlayerInfo[playerid][pBanned]);
}
}
return 1;
}
Последнее редактирование:
