ok ok is much code for that but I stick here
Onplayerconnect
pawn Код:
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
}
return 1;
}
Onplayerdisconnect
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
SetPlayerScore (playerid, Playerinfo[playerid][pLevel]);
GetPlayerPos( playerid,Playerinfo[playerid][pPos_x], Playerinfo[playerid][pPos_y], Playerinfo[playerid][pPos_z]);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Tutorial",Playerinfo[playerid][pTutorial]);
INI_WriteInt(File,"Admin",Playerinfo[playerid][pAdmin]);
INI_WriteInt(File,"Sex",Playerinfo[playerid][pSex]);
INI_WriteInt(File,"Age",Playerinfo[playerid][pAge]);
INI_WriteInt(File,"Facc",Playerinfo[playerid][pFaccn]);
INI_WriteInt(File,"Level",Playerinfo[playerid][pLevel]);
INI_WriteInt(File,"Origin",Playerinfo[playerid][pOrigin]);
INI_WriteInt(File,"skin",Playerinfo[playerid][pChar]);
INI_WriteInt(File,"Leader",Playerinfo[playerid][pLeader]);
INI_WriteInt(File,"Rank",Playerinfo[playerid][pRank]);
INI_WriteInt(File,"TRadio",Playerinfo[playerid][pWalkie]);
INI_WriteInt(File,"Phone",Playerinfo[playerid][pPnumber]);
INI_WriteInt(File,"Baned",Playerinfo[playerid][pBaned]);
INI_WriteFloat(File,"Posx",Playerinfo[playerid][pPos_x]);
INI_WriteFloat(File,"Posy",Playerinfo[playerid][pPos_y]);
INI_WriteInt( File, "Interior", GetPlayerInterior( playerid ) );
INI_WriteInt( File, "VirtualWorld", GetPlayerVirtualWorld( playerid ) );
INI_WriteInt(File,"Premium",Playerinfo[playerid][pPremium]);
INI_WriteInt(File,"Drugs",Playerinfo[playerid][pDrugs]);
INI_WriteInt(File,"Materials",Playerinfo[playerid][pMaterials]);
INI_WriteInt(File,"Speed",Playerinfo[playerid][pSpeed]);
//Y_INI
INI_Close(File);
return 1;
}
Ongamemodeinit
pawn Код:
public OnGameModeInit()
{
new string[MAX_PLAYER_NAME];
new string1[MAX_PLAYER_NAME];
for(new c=0;c<CAR_AMOUNT;c++)
{
Gas[c] = GasMax;
}
LoadCar();
CreateFoodMenus();
CreateGuideMenus();
LoadProperty();
LoadBizz();
LoadSBizz();
LoadBoxer();
LoadStuff();
LoadIRC();
LoadFamilies();
LoadCK();
LoadTurfs();
LoadPapers();
LoadDrugSystem();
LoadMatsSystem();
LoadHQLocks();
LoadTrunk();
IRCInfo[0][iPlayers] = 0; IRCInfo[1][iPlayers] = 0; IRCInfo[2][iPlayers] = 0;
IRCInfo[3][iPlayers] = 0; IRCInfo[4][iPlayers] = 0; IRCInfo[5][iPlayers] = 0;
IRCInfo[6][iPlayers] = 0; IRCInfo[7][iPlayers] = 0; IRCInfo[8][iPlayers] = 0;
IRCInfo[9][iPlayers] = 0;
News[hTaken1] = 0; News[hTaken2] = 0; News[hTaken3] = 0; News[hTaken4] = 0; News[hTaken5] = 0;
format(string, sizeof(string), "Nothing");
strmid(News[hAdd1], string, 0, strlen(string), 255);
strmid(News[hAdd2], string, 0, strlen(string), 255);
strmid(News[hAdd3], string, 0, strlen(string), 255);
strmid(News[hAdd4], string, 0, strlen(string), 255);
strmid(News[hAdd5], string, 0, strlen(string), 255);
format(string1, sizeof(string1), "No-one");
strmid(News[hContact1], string1, 0, strlen(string1), 255);
strmid(News[hContact2], string1, 0, strlen(string1), 255);
strmid(News[hContact3], string1, 0, strlen(string1), 255);
strmid(News[hContact4], string1, 0, strlen(string1), 255);
strmid(News[hContact5], string1, 0, strlen(string1), 255);
PlayerHaul[108][pCapasity] = 100;
PlayerHaul[109][pCapasity] = 100;
PlayerHaul[110][pCapasity] = 50;
PlayerHaul[111][pCapasity] = 50;
SetGameModeText("Los Angeles RP 0.3");
// SendRconCommand("mapname Los Angeles");
// SendRconCommand("weburl ");
format(objstore, sizeof(objstore), "MOLE: I got nothing, check back with me later.");
format(cbjstore, sizeof(cbjstore), "HQ: There is nothing in your Vicinity, Out.");
format(motd, sizeof(motd), "Welcome to the Los Angeles Roleplay server.");
gettime(ghour, gminute, gsecond);
FixHour(ghour);
ghour = shifthour;
if(!realtime)
{
SetWorldTime(wtime);
}
AllowInteriorWeapons(1);
UsePlayerPedAnims(); //Unique walk
DisableInteriorEnterExits();
EnableStuntBonusForAll(0);
ManualVehicleEngineAndLights();
//=====[TIMERS]===========//
SetTimer("ChangeName",1000, true);
hackchecktimer = SetTimer("GlobalHackCheck", 1000, 1);
synctimer = SetTimer("SyncUp", 60000, 1);
unjailtimer = SetTimer("SetPlayerUnjail", 1000, 1);
othtimer = SetTimer("OtherTimer", 1000, 1);
cartimer = SetTimer("CarCheck", 30000, 1);
pickuptimer = SetTimer("CustomPickups", 1000, 1);
spectatetimer = SetTimer("Spectator", 2000, 1);
idletimer = SetTimer("IdleKick", idletime, 1);
productiontimer = SetTimer("Production", 300000, 1); //5 mins (300000)
//accountstimer = SetTimer("SaveAccounts", 900000, 1); //15 mins every account saved
checkgastimer = SetTimer("CheckGas", RunOutTime, 1);
stoppedvehtimer = SetTimer("StoppedVehicle", RunOutTime, 1);
LifeTimer = SetTimer("CheckVida", 1500, 1);
checkcarhealthtimer = SetTimer("CheckCarHealth", 10000, 1);
burgertimer = SetTimer("UpdateBurgerPositions", 1000, 1);
chickentimer = SetTimer("UpdateChickenPositions", 1000, 1);
tracetimer = SetTimer("TraceLastCall", 300000, 1);
return 1;
}
Response
pawn Код:
if (dialogid == Register)
{
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "{00FF00}Role Play ", "{FFFFFF}Please, Register new account", "Register", "exit");//
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,"Tutorial",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Sex",0);
INI_WriteInt(File,"Age",0);
INI_WriteInt(File,"Facc",0);
INI_WriteInt(File,"Level",1);
INI_WriteInt(File,"Origin",0);
INI_WriteInt(File, "Skin", PlayerInfo[playerid][pChar] = 23);
INI_WriteInt(File,"Leader",0);
INI_WriteInt(File,"rank",0);
INI_WriteInt(File,"TRadio",0);
INI_WriteInt(File,"phone",0);
INI_WriteInt(File,"baned",0);
INI_WriteFloat(File,"Posx",1612.3240);
INI_WriteFloat(File,"Posy",-2330.1670);
INI_WriteFloat(File,"Posz",13.5469);
INI_WriteInt(File,"Premium",0);
INI_WriteInt(File,"Speed",0);
//Y_INI
INI_Close(File);
if (!response) return Kick(playerid);
PlayerLogued[playerid] = 1;
SetSpawnInfo(playerid, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
}
if (dialogid == Login)
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pContra])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SafeGivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
PlayerLogued[playerid] = 1;
SetSpawnInfo(playerid, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
else
{
ShowPlayerDialog(playerid, 25, DIALOG_STYLE_MSGBOX, "{FFFFFF} Role Play {FFFFFF}|", "{FF0000}Incorrect Password!", "ok", "");
}
return 1;
}
}