forward LoadPlayerData(playerid, l_step);
public LoadPlayerData(playerid, l_step)
{
new count, string[128], hour, minute, second;
gettime(hour, minute, second);
cache_get_row_count(count);
switch(l_step)
{
case 1:
{
if(count)
{
LoginScreen(playerid,0);
gPlayerAccount[playerid] = 1;
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Coming Soon", "Willkommen auf Coming Soon\n\nDein Account wurde in der Datenbank gefunden.\nGib dein Passwort niemals weiter. Auch nicht an Admins oder Supporter!\nDu kannst dich nun einloggen. Bitte gib dein Passwort ein:","OK"," ");
LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid);
TogglePlayerControllable(playerid,0);
return 1;
}
else
{
if(hour < 7)
{
LoginScreen(playerid,0);
ShowPlayerDialog(playerid,636,DIALOG_STYLE_MSGBOX,"Coming Soon","Die Registration ist von 0:00 - 07:00 Uhr geschlossen.\nFalls du bereits einen Account besitzt, kannst du dich dennoch einloggen.\nWeitere Infomationen findest du im Forum unter www.coming-soon.de","Abbrechen","");
SetTimerEx("ConnectKick", 700,0,"i",playerid);
LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid);
return 1;
}
gPlayerAccount[playerid] = 0;
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_MSGBOX,"Coming Soon","Willkommen auf Coming Soon\n\nEs wurde kein Account unter diesen Namen gefunden.\nGib dein Passwort niemals weiter. Auch nicht an Admins oder Supporter!","OK","");
LoginScreen(playerid,0);
LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid);
return 1;
}
}
case 2:
{
if(count)
{
new query[64+MAX_PLAYER_NAME+1];
mysql_format(handle, query, sizeof(query), "SELECT * FROM `users` WHERE `Name` = '%s'", SpielerName(playerid));
mysql_pquery(handle, query, "LoadPlayerData", "dd", playerid, 3);
}
else
{
pPassAttempt[playerid] ++;
if(pPassAttempt[playerid] >= 3)
{
SendClientMessage(playerid, COLOR_WHITE, "{9AB3D0}Du wurdest vom Server gekickt, da du dein Passwort zu oft falsch eingegeben hast.");
Kick(playerid);
return 1;
}
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Coming Soon", "{FFEE00}Falsches Passwort\n\n{FFFFFF}Willkommen auf Coming Soon\n\nDein Account wurde in der Datenbank gefunden.\nGib dein Passwort niemals weiter. Auch nicht an Admins oder Supporter!\nDu kannst dich nun einloggen. Bitte gib dein Passwort ein:","OK"," ");
return 1;
}
}
case 3:
{
gPlayerLogged[playerid] = 1;
TextDrawShowForPlayer(playerid, UhrzeitStundeMinute);
TextDrawShowForPlayer(playerid, DatumTagMonat);
CancelSelectTextDraw(playerid);
StopAudioStreamForPlayer(playerid);
getdate(Jahr, Monat, Tag);
gettime(Stunde, Minute, Sekunde);
cache_get_value_name_int(0,"Level", PlayerInfo[playerid][pLevel]);
cache_get_value_name_int(0,"AdminLevel",PlayerInfo[playerid][pAdmin]);
cache_get_value_name_int(0,"Checkpoint", CCP[playerid]);
cache_get_value_name_int(0,"CPrison", xPrison[playerid]);
cache_get_value_name_int(0,"RunningCP", RunningCP[playerid]);
cache_get_value_name_int(0,"BNDRadar", BNDRadar[playerid]);
cache_get_value_name_int(0,"TeamRadar", TeamRadar[playerid]);
cache_get_value_name_int(0,"Rolex", PlayerInfo[playerid][pRolex]);
cache_get_value_name_int(0,"Swissonic", PlayerInfo[playerid][pSwissonic]);
cache_get_value_name_int(0,"Casio", PlayerInfo[playerid][pCasio]);
cache_get_value_name_int(0,"Breitling", PlayerInfo[playerid][pBreitling]);
cache_get_value_name_int(0,"Nixon", PlayerInfo[playerid][pNixon]);
cache_get_value_name_int(0,"IceWatch", PlayerInfo[playerid][pIceWatch]);
cache_get_value_name_int(0,"StartCoints", PlayerInfo[playerid][pStartCoints]);
cache_get_value_name_int(0,"Coints", PlayerInfo[playerid][pCoints]);
cache_get_value_name_int(0,"SpawnhealZeit", PlayerInfo[playerid][pSpawnhealZeit]);
cache_get_value_name_int(0,"DeaglespawnZeit", PlayerInfo[playerid][pDeaglespawnZeit]);
cache_get_value_name_int(0,"M4SpawnZeit", PlayerInfo[playerid][pM4SpawnZeit]);
cache_get_value_name_int(0,"MP5SpawnZeit", PlayerInfo[playerid][pMP5SpawnZeit]);
cache_get_value_name_int(0,"MehrZinsenZeit", PlayerInfo[playerid][pMehrZinsenZeit]);
cache_get_value_name_int(0,"Medickit", PlayerInfo[playerid][pMedickit]);
cache_get_value_name_int(0,"Kreditkarte", PlayerInfo[playerid][pKreditkarte]);
cache_get_value_name_int(0,"KreditkarteBenutzung", PlayerInfo[playerid][pKreditkartebenutzen]);
cache_get_value_name_int(0,"Personalausweis", PlayerInfo[playerid][pPersonalausweis]);
cache_get_value_name_int(0,"Namechange", PlayerInfo[playerid][pSchongeandert]);
cache_get_value_name_int(0,"DonateRank", PlayerInfo[playerid][pDonatorRank]);
cache_get_value_name_int(0,"UpgradePoints", PlayerInfo[playerid][gPupgrade]);
cache_get_value_name_int(0,"ConnectedTime", PlayerInfo[playerid][pConnectTime]);
cache_get_value_name_int(0,"Registered", PlayerInfo[playerid][pReg]);
cache_get_value_name_int(0,"Sex", PlayerInfo[playerid][pSex]);
cache_get_value_name_int(0,"Age", PlayerInfo[playerid][pAlter]);
cache_get_value_name_int(0,"Origin", PlayerInfo[playerid][pOrigin]);
cache_get_value_name_int(0,"Muted", PlayerInfo[playerid][pMuted]);
cache_get_value_name_int(0,"Respect", PlayerInfo[playerid][pRespekt]);
cache_get_value_name_int(0,"Gehalt", PlayerInfo[playerid][pGehalt]);
cache_get_value_name_int(0,"Money", PlayerInfo[playerid][pCash]);
cache_get_value_name_int(0,"Bank", PlayerInfo[playerid][pBank]);
cache_get_value_name_int(0,"Jobgeld", PlayerInfo[playerid][pJobLohn]);
cache_get_value_name_int(0,"Crimes", PlayerInfo[playerid][pCrimes]);
cache_get_value_name_int(0,"Kills", PlayerInfo[playerid][pKills]);
cache_get_value_name_int(0,"sKills", PlayerInfo[playerid][psKills]);
cache_get_value_name_int(0,"Deaths", PlayerInfo[playerid][pDeaths]);
cache_get_value_name_int(0,"Arrested", PlayerInfo[playerid][pArrested]);
cache_get_value_name_int(0,"ArrestTime", PlayerInfo[playerid][pArrestTime]);
cache_get_value_name_int(0,"PhoneBook", PlayerInfo[playerid][pPhoneBook]);
cache_get_value_name_int(0,"LottoNr", PlayerInfo[playerid][pLottoNr]);
cache_get_value_name_int(0,"Fishes", PlayerInfo[playerid][pFishes]);
cache_get_value_name_int(0,"BiggestFish", PlayerInfo[playerid][pBiggestFish]);
cache_get_value_name_int(0,"Job", PlayerInfo[playerid][pJob]);
cache_get_value_name_int(0,"House", PlayerInfo[playerid][pHaus]);
cache_get_value_name_int(0,"Mieten", PlayerInfo[playerid][pMieten]);
cache_get_value_name_int(0,"HealPaket", PlayerInfo[playerid][pHealPaket]);
cache_get_value_name_int(0,"ArmourPaket", PlayerInfo[playerid][pArmourPaket]);
cache_get_value_name_int(0,"WaffenPaket", PlayerInfo[playerid][pWaffenPaket]);
cache_get_value_name_int(0,"OverHealPaket", PlayerInfo[playerid][pOverHealPaket]);
cache_get_value_name_int(0,"HeadValue", PlayerInfo[playerid][pHeadValue]);
cache_get_value_name_int(0,"Jailed", PlayerInfo[playerid][pJailed]);
cache_get_value_name_int(0,"JailTime", PlayerInfo[playerid][pJailTime]);
cache_get_value_name_int(0,"Leader", PlayerInfo[playerid][pLeader]);
cache_get_value_name_int(0,"Member", PlayerInfo[playerid][pMember]);
cache_get_value_name_int(0,"Rank", PlayerInfo[playerid][pRank]);
cache_get_value_name_int(0,"Skin", PlayerInfo[playerid][pChar]);
cache_get_value_name_int(0,"Vertragszeit", PlayerInfo[playerid][pVertragszeit]);
cache_get_value_name_int(0,"NewsSkill", PlayerInfo[playerid][pNewsSkill]);
cache_get_value_name_int(0,"FishSkill", PlayerInfo[playerid][pFishSkill]);
cache_get_value_name_int(0,"MechSkill", PlayerInfo[playerid][pMechSkill]);
cache_get_value_name_float(0,"pSHealth", PlayerInfo[playerid][pSHealth]);
cache_get_value_name_int(0,"PhoneNr", PlayerInfo[playerid][pNummer]);
cache_get_value_name_int(0,"Hotel", PlayerInfo[playerid][pPhotelkey]);
cache_get_value_name_int(0,"Biz", PlayerInfo[playerid][pBizKey]);
cache_get_value_name_int(0,"CarLic", PlayerInfo[playerid][pCarLic]);
cache_get_value_name_int(0,"FlyLic", PlayerInfo[playerid][pFlyLic]);
cache_get_value_name_int(0,"BoatLic", PlayerInfo[playerid][pBoatLic]);
cache_get_value_name_int(0,"FishLic", PlayerInfo[playerid][pFishLic]);
cache_get_value_name_int(0,"GunLic", PlayerInfo[playerid][pGunLic]);
cache_get_value_name_int(0,"Zollpass", PlayerInfo[playerid][pZollpass]);
cache_get_value_name_int(0,"Gun1", PlayerInfo[playerid][pGun1]);
cache_get_value_name_int(0,"Gun2", PlayerInfo[playerid][pGun2]);
cache_get_value_name_int(0,"Gun3", PlayerInfo[playerid][pGun3]);
cache_get_value_name_int(0,"Gun4", PlayerInfo[playerid][pGun4]);
cache_get_value_name_int(0,"Ammo1", PlayerInfo[playerid][pAmmo1]);
cache_get_value_name_int(0,"Ammo2", PlayerInfo[playerid][pAmmo2]);
cache_get_value_name_int(0,"Ammo3", PlayerInfo[playerid][pAmmo3]);
cache_get_value_name_int(0,"Ammo4", PlayerInfo[playerid][pAmmo4]);
cache_get_value_name_int(0,"CarTime", PlayerInfo[playerid][pCarTime]);
cache_get_value_name_int(0,"PayDay", PlayerInfo[playerid][pPayDay]);
cache_get_value_name_int(0,"PayDayHad", PlayerInfo[playerid][pPayDayHad]);
cache_get_value_name_int(0,"CDPlayer", PlayerInfo[playerid][pCDPlayer]);
cache_get_value_name_int(0,"AlcoholPerk", PlayerInfo[playerid][pAlcoholPerk]);
cache_get_value_name_int(0,"DrugPerk", PlayerInfo[playerid][pDrugPerk]);
cache_get_value_name_int(0,"MiserPerk", PlayerInfo[playerid][pMiserPerk]);
cache_get_value_name_int(0,"TraderPerk", PlayerInfo[playerid][pTraderPerk]);
cache_get_value_name_int(0,"PainKillerPerk", PlayerInfo[playerid][pPainKillerPerk]);
cache_get_value_name_int(0,"PistolSkill", PlayerInfo[playerid][pPistolSkill]);
cache_get_value_name_int(0,"MaschinePistolSkill", PlayerInfo[playerid][pMaschinePistolSkill]);
cache_get_value_name_int(0,"SturmgewehrPistolSkill", PlayerInfo[playerid][pSturmgewehrPistolSkill]);
cache_get_value_name_int(0,"ShotGunSkill", PlayerInfo[playerid][pShotGunSkill]);
cache_get_value_name_int(0,"Tutorial", PlayerInfo[playerid][pTut]);
cache_get_value_name_int(0,"Cptut", PlayerInfo[playerid][pCPTUT]);
cache_get_value_name_int(0,"kh", PlayerInfo[playerid][pKHTIME]);
cache_get_value_name_int(0,"Warnings", PlayerInfo[playerid][pWarns]);
cache_get_value_name_int(0,"Fuel", PlayerInfo[playerid][pFuel]);
cache_get_value_name_int(0,"Married", PlayerInfo[playerid][pMarried]);
cache_get_value_name_int(0,"MarriedTo", PlayerInfo[playerid][pMarriedTo]);
cache_get_value_name_int(0,"WantedLevel", PlayerInfo[playerid][pWantedLevel]);
cache_get_value_name_int(0,"Spawn", PlayerInfo[playerid][pSpawn]);
cache_get_value_name_int(0,"SavedMaterials", PlayerInfo[playerid][pSaveMats]);
cache_get_value_name_int(0,"SavedDrugs", PlayerInfo[playerid][pSaveDrugs]);
cache_get_value_name_int(0,"BikeLic", PlayerInfo[playerid][pBikeLic]);
cache_get_value_name_int(0,"LKWLic", PlayerInfo[playerid][pLKWLic]);
cache_get_value_name_int(0,"DonatorTime", PlayerInfo[playerid][pDonatorZeit]);
cache_get_value_name_int(0,"WerberName", PlayerInfo[playerid][pWerberName]);
cache_get_value_name_int(0,"FightingStyle", PlayerInfo[playerid][pFightingStyle]);
cache_get_value_name_int(0,"Handy", PlayerInfo[playerid][pHandy]);
cache_get_value_name_int(0,"OnDutySkin", PlayerInfo[playerid][pOnDutySkin]);
cache_get_value_name_int(0,"CarLicPoints", PlayerInfo[playerid][pCarLicPoints]);
cache_get_value_name_int(0,"BikeLicPoints", PlayerInfo[playerid][pBikeLicPoints]);
cache_get_value_name_int(0,"InviteSperre", PlayerInfo[playerid][pInviteSperre]);
cache_get_value_name_int(0,"warntime1", PlayerInfo[playerid][pWarnTime1]);
cache_get_value_name_int(0,"warntime2", PlayerInfo[playerid][pWarnTime2]);
cache_get_value_name_int(0,"Ticketsopen", PlayerInfo[playerid][pTicketsopen]);
cache_get_value_name_int(0,"OldName", PlayerInfo[playerid][pOldName]);
cache_get_value_name_int(0,"OrgMember", PlayerInfo[playerid][pOrgaID]);
cache_get_value_name_int(0,"OrgLeader", PlayerInfo[playerid][pOrgaLeader]);
cache_get_value_name_int(0,"OrgManager", PlayerInfo[playerid][pOrgaManager]);
cache_get_value_name_int(0,"OrgName", PlayerInfo[playerid][pOrgaName]);
cache_get_value_name_int(0,"SQLid", PlayerInfo[playerid][pSQLID]);
if(PlayerInfo[playerid][pLevel] < 0)
{
PlayerInfo[playerid][pLevel] = 1;
SetPlayerScore(playerid, 1);
}
new DeleteDate = 15778463 + gettime();
mysql_format(handle, string, sizeof(string), "UPDATE `users` SET `DeleteDatum`=%d, `LastLoginDatum`=%d WHERE `Name`='%s'", DeleteDate, gettime(), SpielerName(playerid));
mysql_pquery(handle, string);
if(PlayerInfo[playerid][pDonatorRank] >= 1)
{
MaxVeh[playerid] = 6;
}
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
if(PlayerInfo[playerid][pMarried] == 0)
{
ClearMarriage(playerid);
}
if(PlayerInfo[playerid][pOrigin] == 0) { PlayerInfo[playerid][pOrigin] = 1; }
if(PlayerInfo[playerid][pLeader] != -1)
{
PlayerInfo[playerid][pTeam] = PlayerInfo[playerid][pLeader];
}
else if(PlayerInfo[playerid][pMember] != -1)
{
PlayerInfo[playerid][pTeam] = PlayerInfo[playerid][pMember];
}
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pCPTUT] == 0 && PlayerInfo[playerid][pTut] == 1)
{
SendClientMessage(playerid, COLOR_ERRORTEXT, "________________________________________________________________________");
SendClientMessage(playerid,COLOR_GREY,"");
SendClientMessage(playerid, COLOR_TUTORIAL, "Du hast das Tutorial noch nicht fertig!");
SendClientMessage(playerid, COLOR_TUTORIAL, "Hole dir einen Roller per /rentroller und Spiele das Tutorial durch!");
SendClientMessage(playerid, COLOR_ERRORTEXT, "________________________________________________________________________");
}
if(PlayerInfo[playerid][pJailed] == 2){
SetTimerEx("ImPrisonarsch", 2000,0,"i",playerid);
}
if(xPrison[playerid] == 1){
SetTimerEx("ImCPPrisonarsch", 2000,0,"i",playerid);
}
PlayerCarConnect(playerid);
if(PlayerInfo[playerid][pTut] == 1)
{
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
RemovePlayerAttachedObject(playerid, i);
}
}
TogglePlayerSpectating(playerid,false);
KillTimer(LoginTimer[playerid]);
LoginTimer[playerid] = -1;
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
strmid(PlayerInfo[playerid][pForceName], "Niemand", 0, strlen("Niemand"), 255);
CheckTime(playerid);
PlayerPlaySound(playerid, 1098, 0.0, 0.0, 0.0);
SetPVarInt(playerid, "PVTeam", PlayerInfo[playerid][pTeam]);
SetPVarInt(playerid, "PVAdmin", PlayerInfo[playerid][pAdmin]);
SetPVarInt(playerid, "PVJob", PlayerInfo[playerid][pJob]);
LoadUberweisungen(playerid);
printf("%s hat sich eingeloggt. [ID: %d]", SpielerName(playerid),playerid);
format(string,sizeof(string),"AdmWarn: Spieler %s hat sich mit der IP: %s eingeloggt!", SpielerName(playerid),PlayerInfo[playerid][pUserIP]);
EnterToLog("Login",string);
if(PlayerInfo[playerid][pDonatorRank] == 1)
{
SendClientMessage(playerid, COLOR_WHITE,"SERVER: Du hast einen Premiumaccount. Vielen Dank, dass du unseren Server unterstützt.");
}
if(PlayerInfo[playerid][pDonatorRank] == 2)
{
SendClientMessage(playerid, COLOR_WHITE,"SERVER: Du hast einen Spendenaccount(Donator). Vielen Dank, dass du unseren Server unterstützt.");
}
if(PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "SERVER: Du hast dich als Adminlevel %d eingeloggt.", PlayerInfo[playerid][pAdmin]);
SendClientMessage(playerid, COLOR_WHITE, string);
TextDrawShowForPlayer(playerid,TicketsTextdraw);
}
//-------------------- Waffen Skills --------------------
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 999);
if(PlayerInfo[playerid][pChar] != -1)
{
new UseSkin = PlayerInfo[playerid][pChar];
SetSpawnInfo(playerid, 0, UseSkin,0.0,0.0,0.0,0,0,0,0,0,0,0);
}
TextDrawHideForPlayer(playerid, Text:NODMZoneTextdraw);
MedicBill[playerid] = 0;
FirstSpawnAfterLogin[playerid] = 1;
Logintime[playerid] = 1;
gPlayerLogged[playerid] = 1;
StuffInfo[sLoggins] += 1;
start_screen{playerid} = false;
SetCameraBehindPlayer(playerid);
if(AdminIPClose == 0 || TogAdminMessage[playerid] == 0)
{
new noIP[256];
format(string, sizeof(string), "AdmWarn: Spieler %s hat sich mit der IP: %s eingeloggt!", SpielerName(playerid),PlayerInfo[playerid][pUserIP]);
format(noIP, sizeof(noIP), "AdmWarn: Spieler %s hat sich eingeloggt!", SpielerName(playerid));
ForAllPlayers(i)
{
new adminlv = PlayerInfo[i][pAdmin];
if(!IsPlayerConnected(i) || adminlv <= 0) continue;
if(adminlv >= 1338)
SendClientMessage(i, COLOR_LIGHTRED, string);
else
SendClientMessage(i, COLOR_LIGHTRED, noIP);
}
}
if(PlayerInfo[playerid][pWarns] > 0){
format(string, sizeof(string), "Achtung: Du hast schon %d von 3 Verwarnungen. Bei 3 Verwarnungen wirst du gebannt.", PlayerInfo[playerid][pWarns]);
SendClientMessage(playerid, COLOR_RED, string);
}
if(PlayerInfo[playerid][pTut] == 0)
{
SetPlayerPos(playerid, 1784.8639,-1943.3843,13.5528);
InterpolateCameraPos(playerid, 1794.888427, -1918.687866, 65.714218, 1796.820068, -1904.459472, 96.568595, 8000);
InterpolateCameraLookAt(playerid, 1795.196044, -1918.379150, 60.733245, 1796.392944, -1904.545654, 91.587623, 8000);
TogglePlayerControllable(playerid, 1);
ShowPlayerDialog(playerid, tutorialdialog, DIALOG_STYLE_MSGBOX, "Westbound Reallife", "{FFFFFF}Herzlich Willkommen auf {00AAFF}Westbound-Reallife{FFFFFF}\nBei uns musst du dir ein Tutorial ansehen.\nWir haben zwei verschiedene Versionen.\nWelche möchtest du sehen?\nEmpfehlung: Die Normale", "Normal", "Kurz");
}
if(PlayerInfo[playerid][pTut] == 1)
{
SpawnPlayer(playerid);
}
if(PlayerInfo[playerid][pTeam] != -1)
{
new Team = PlayerInfo[playerid][pTeam], stringnachricht[256], stringnachricht1[256];
strmid(stringnachricht, (KassenInfo[Team][GangMotd]), 0, strlen(KassenInfo[Team][GangMotd]), 255);
format(stringnachricht1, sizeof(stringnachricht1), "{990000}Fraktionsnachricht: {FFFFFF}%s", stringnachricht);
SendClientMessage(playerid, COLOR_GRAD2, stringnachricht1);
}
return 1;
}
default:
{
Kick(playerid);
return 1;
}
}
return 1;
}
Alles anzeigen