Kurze Frage.
Wie kann ich auslesen das er MD5 hat?
Kenne nur die Funktion wie man die schreibt aber die neue nicht.
forward SpielerMD5(playerid);
public SpielerMD5(playerid)
{
GotMD5[playerid] = cache_get_field_content_int(0, "GotMD5");
return 1;
}
Kurze Frage.
Wie kann ich auslesen das er MD5 hat?
Kenne nur die Funktion wie man die schreibt aber die neue nicht.
forward SpielerMD5(playerid);
public SpielerMD5(playerid)
{
GotMD5[playerid] = cache_get_field_content_int(0, "GotMD5");
return 1;
}
Die Wiki Seite solltest du doch inzwischen kennen. Dort findest du alle Funktionen und Beispiele dazu.
http://wiki.sa-mp.com/wiki/MySQL/R40
Damit würdest du auch sofort auf die Lösung kommen.
cache_get_value_name_int(0, "GotMD5", GotMD5[playerid]);
weiß ich bereits,
Aber finde nichts passendes dafür.
//E:
cache_get_value_name_int(0, "GotMD5", GotMD5[playerid]);
Habe was gefunden hoffe so stimmts
//E:
Kurze Frage warum kommt nicht das Login/Register Fenster sondern direkt das Tutorial?
Er Sollte normalerweiße erst alles abchecken darum diese Login Camara.
Macht er scheinbar nicht und läd gleich die Spieler Daten.
SetTimerEx("OnLoginCamera", 500, 0, "i", playerid); // Unter OnPlayerRequestClass
forward OnLoginCamera(playerid);
public OnLoginCamera(playerid)
{
if(IsPlayerConnected(playerid))
{
new query[256];
PlayerPlaySound(playerid,1185,0.0,0.0,0.0);
mysql_format(handle, query, sizeof(query), "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = '%s'", SpielerName(playerid));
mysql_pquery(handle, query, "LoadPlayerData", "dd", playerid, 3);
mysql_format(handle, query, sizeof(query), "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = '%s'", SpielerName(playerid));
mysql_pquery(handle, query, "PlayerHaveMD5", "d", playerid);
}
return 1;
}
Alles anzeigen
Ob der Spieler MD5 als Passwort hat.
forward PlayerHaveMD5(playerid);
public PlayerHaveMD5(playerid)
{
cache_get_value_name_int(0, "GotMD5", GotMD5[playerid]);
return 1;
}
Hier Werden alle Daten geladen vom Spieler.
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
Die Wiki Seite solltest du doch inzwischen kennen. Dort findest du alle Funktionen und Beispiele dazu.
http://wiki.sa-mp.com/wiki/MySQL/R40
Damit würdest du auch sofort auf die Lösung kommen.
cache_get_field_content_int(0, "GotMD5", GotMD5[playerid]);
//E:
"cache_get_field_content_int"
gibt es ja bei MySQL R41-4 nicht mehr. @Jeffry
cache_get_value_name_int @Dr. Frauenarzt
gibt es ja bei MySQL R41-4 nicht mehr. @Jeffry
Ich könnte ja sagen, ich wollte schauen, ob du auch wirklich ins Wiki schaust
War ein Copy/Paste Fehler, hatte noch die alte Funktion im Zwischenspeicher, sorry. Gut, dass du es trotzdem selbst herausgefunden hast.
Habe nun mal geschaut was passiert wen man Connectet.
Das einzige was er nimmt sind die 2 Sachen am Anfang.
PlayerHaveMD5 Überprüft er und danach LoadPlayerData.
Und scheinbar kann er irgendwas nicht lesen und schmeisst mir 2 Fehler her.
[17:03:54] [ERROR] cache_get_row_count: no active cache17:03:57] [ERROR] cache_get_value_name_int: invalid row index '0' (number of rows: '0')
Das Sind die 2 Was geladen werden.
Also:
Und eben das LoadPlayerData:
[spoiler]
public LoadPlayerData(playerid, l_step)
{
new string[128], hour, minute, second;
gettime(hour, minute, second);
switch(l_step)
{
case 1:
{
new count = cache_get_row_count(count);
if(count)
{
LoginScreen(playerid,0);
gPlayerAccount[playerid] = 1;
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Coming Soon", "Willkommen auf "SERVER_NAME"\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;
}
LoginScreen(playerid,0);
gPlayerAccount[playerid] = 0;
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_MSGBOX,"Coming Soon","Willkommen auf "SERVER_NAME"\n\nEs wurde kein Account unter diesen Namen 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;
}
}
case 2:
{
new count = cache_get_row_count(count);
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 "SERVER_NAME"\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;
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
[spoiler]
@Kaliber weißt du zufällig eine lösung?
Und scheinbar kann er irgendwas nicht lesen und schmeisst mir 2 Fehler her.
Schalte den Debug Modus an und prüfe, durch welches Query der Fehler ausgegeben wird.
Habe in Plugin nach mysql_debug geschaut die Funktion gibts nicht heißt die jetzt anders?
//E:
Habe es herraus gefunden.
[08:45:42] [DEBUG] mysql_format(1, 0x06A95570, 256, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = '%s'")
[08:45:42] [DEBUG] mysql_format: return value: '69'
[08:45:42] [DEBUG] mysql_pquery(1, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'", "LoadPlayerData", "dd")
[08:45:42] [DEBUG] CCallback::Create(amx=0x4ba30c8, name='LoadPlayerData', format='dd', params=0x6a95554, param_offset=5)
[08:45:42] [DEBUG] CCallback::Create - callback index for 'LoadPlayerData': 169
[08:45:42] [DEBUG] processing specifier 'd' with parameter index 0
[08:45:42] [DEBUG] retrieved and pushed value '8'
[08:45:42] [DEBUG] processing specifier 'd' with parameter index 1
[08:45:42] [DEBUG] retrieved and pushed value '1'
[08:45:42] [INFO] Callback 'LoadPlayerData' set up for delayed execution.
[08:45:42] [DEBUG] created delayed callback with 2 parameters
[08:45:42] [DEBUG] CHandle::Execute(this=0x6c268c8, type=2, query=0x6cd6d28)
[08:45:42] [DEBUG] CConnectionPool::Queue(query=0x6cd6d28, this=0x2729c68)
[08:45:42] [DEBUG] CHandle::Execute - return value: true
[08:45:42] [DEBUG] mysql_pquery: return value: '1'
[08:45:42] [DEBUG] mysql_format(1, 0x06A95570, 256, "SELECT * FROM `users` WHERE `Name`='%s'")
[08:45:42] [DEBUG] CConnection::Execute(query=0x6cd6d28, this=0x6fac020, connection=0x6c7f168)
[08:45:42] [DEBUG] mysql_format: return value: '49'
[08:45:42] [DEBUG] CQuery::Execute(this=0x6cd6d28, connection=0x6c7f168)
[08:45:42] [DEBUG] mysql_pquery(1, "SELECT * FROM `users` WHERE `Name`='James.Gordon'", "PlayerHaveMD5", "d")
[08:45:42] [DEBUG] CCallback::Create(amx=0x4ba30c8, name='PlayerHaveMD5', format='d', params=0x6a95558, param_offset=5)
[08:45:42] [DEBUG] CCallback::Create - callback index for 'PlayerHaveMD5': 240
[08:45:42] [DEBUG] processing specifier 'd' with parameter index 0
[08:45:42] [DEBUG] retrieved and pushed value '8'
[08:45:42] [INFO] Callback 'PlayerHaveMD5' set up for delayed execution.
[08:45:42] [DEBUG] created delayed callback with 1 parameter
[08:45:42] [DEBUG] CHandle::Execute(this=0x6c268c8, type=2, query=0x6cd6dc0)
[08:45:42] [DEBUG] CConnectionPool::Queue(query=0x6cd6dc0, this=0x2729c68)
[08:45:42] [DEBUG] CHandle::Execute - return value: true
[08:45:42] [DEBUG] mysql_pquery: return value: '1'
[08:45:42] [DEBUG] CConnection::Execute(query=0x6cd6dc0, this=0x7172020, connection=0x6c89488)
[08:45:42] [DEBUG] CQuery::Execute(this=0x6cd6dc0, connection=0x6c89488)
[08:45:42] [INFO] query "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'" successfully executed within 1.199 milliseconds
[08:45:42] [DEBUG] CResultSet::Create(connection=0x6c7f168, query_str='SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'')
[08:45:42] [DEBUG] created new resultset '0x6c91de0'
[08:45:42] [DEBUG] fetched MySQL result '0x6ceef68'
[08:45:42] [DEBUG] allocated 20 bytes for PAWN result
[08:45:42] [INFO] query "SELECT * FROM `users` WHERE `Name`='James.Gordon'" successfully executed within 2.434 milliseconds
[08:45:42] [DEBUG] CResultSet::Create(connection=0x6c89488, query_str='SELECT * FROM `users` WHERE `Name`='James.Gordon'')
[08:45:42] [DEBUG] created new resultset '0x6cdf768'
[08:45:42] [DEBUG] fetched MySQL result '0x6c924b0'
[08:45:42] [DEBUG] allocated 0 bytes for PAWN result
[08:45:42] [DEBUG] CCallback::Execute(amx=0x4ba30c8, index=169, num_params=2)
[08:45:42] [INFO] Executing callback 'LoadPlayerData' with 2 parameters...
[08:45:42] [DEBUG] processing internal specifier 'c'
[08:45:42] [DEBUG] pushed value '1' onto AMX stack
[08:45:42] [DEBUG] processing internal specifier 'c'
[08:45:42] [DEBUG] pushed value '8' onto AMX stack
[08:45:42] [DEBUG] executing AMX callback with index '169'
[08:45:42] [DEBUG] cache_get_row_count(0x06A9575C)
[08:45:42] [DEBUG] cache_get_row_count: return value: '1'
[08:45:42] [DEBUG] AMX callback executed with error '0'
[08:45:42] [INFO] Callback successfully executed.
[08:45:42] [DEBUG] CCallback::Execute(amx=0x4ba30c8, index=240, num_params=1)
[08:45:42] [INFO] Executing callback 'PlayerHaveMD5' with 1 parameter...
[08:45:42] [DEBUG] processing internal specifier 'c'
[08:45:42] [DEBUG] pushed value '8' onto AMX stack
[08:45:42] [DEBUG] executing AMX callback with index '240'
[08:45:42] [DEBUG] cache_get_value_name_int(0, "GotMD5", 0x061B458C)
[08:45:42] [ERROR] cache_get_value_name_int: invalid row index '0' (number of rows: '0')
[08:45:42] [DEBUG] AMX callback executed with error '0'
[08:45:42] [INFO] Callback successfully executed.
Alles anzeigen
Die heißt jetzt mysql_log.
Siehe hier: Tipps: Scripting-Probleme richtig erklären Kapitel 1.4
Die heißt jetzt mysql_log.
Siehe hier: Tipps: Scripting-Probleme richtig erklären Kapitel 1.4
Ja habe ich bereits getan habe das schon gefunden und direkt eingebaut und der log sagt mir das:
[08:45:42] [DEBUG] mysql_format(1, 0x06A95570, 256, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = '%s'")
[08:45:42] [DEBUG] mysql_format: return value: '69'
[08:45:42] [DEBUG] mysql_pquery(1, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'", "LoadPlayerData", "dd")
[08:45:42] [DEBUG] CCallback::Create(amx=0x4ba30c8, name='LoadPlayerData', format='dd', params=0x6a95554, param_offset=5)
[08:45:42] [DEBUG] CCallback::Create - callback index for 'LoadPlayerData': 169
[08:45:42] [DEBUG] processing specifier 'd' with parameter index 0
[08:45:42] [DEBUG] retrieved and pushed value '8'
[08:45:42] [DEBUG] processing specifier 'd' with parameter index 1
[08:45:42] [DEBUG] retrieved and pushed value '1'
[08:45:42] [INFO] Callback 'LoadPlayerData' set up for delayed execution.
[08:45:42] [DEBUG] created delayed callback with 2 parameters
[08:45:42] [DEBUG] CHandle::Execute(this=0x6c268c8, type=2, query=0x6cd6d28)
[08:45:42] [DEBUG] CConnectionPool::Queue(query=0x6cd6d28, this=0x2729c68)
[08:45:42] [DEBUG] CHandle::Execute - return value: true
[08:45:42] [DEBUG] mysql_pquery: return value: '1'
[08:45:42] [DEBUG] mysql_format(1, 0x06A95570, 256, "SELECT * FROM `users` WHERE `Name`='%s'")
[08:45:42] [DEBUG] CConnection::Execute(query=0x6cd6d28, this=0x6fac020, connection=0x6c7f168)
[08:45:42] [DEBUG] mysql_format: return value: '49'
[08:45:42] [DEBUG] CQuery::Execute(this=0x6cd6d28, connection=0x6c7f168)
[08:45:42] [DEBUG] mysql_pquery(1, "SELECT * FROM `users` WHERE `Name`='James.Gordon'", "PlayerHaveMD5", "d")
[08:45:42] [DEBUG] CCallback::Create(amx=0x4ba30c8, name='PlayerHaveMD5', format='d', params=0x6a95558, param_offset=5)
[08:45:42] [DEBUG] CCallback::Create - callback index for 'PlayerHaveMD5': 240
[08:45:42] [DEBUG] processing specifier 'd' with parameter index 0
[08:45:42] [DEBUG] retrieved and pushed value '8'
[08:45:42] [INFO] Callback 'PlayerHaveMD5' set up for delayed execution.
[08:45:42] [DEBUG] created delayed callback with 1 parameter
[08:45:42] [DEBUG] CHandle::Execute(this=0x6c268c8, type=2, query=0x6cd6dc0)
[08:45:42] [DEBUG] CConnectionPool::Queue(query=0x6cd6dc0, this=0x2729c68)
[08:45:42] [DEBUG] CHandle::Execute - return value: true
[08:45:42] [DEBUG] mysql_pquery: return value: '1'
[08:45:42] [DEBUG] CConnection::Execute(query=0x6cd6dc0, this=0x7172020, connection=0x6c89488)
[08:45:42] [DEBUG] CQuery::Execute(this=0x6cd6dc0, connection=0x6c89488)
[08:45:42] [INFO] query "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'" successfully executed within 1.199 milliseconds
[08:45:42] [DEBUG] CResultSet::Create(connection=0x6c7f168, query_str='SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'')
[08:45:42] [DEBUG] created new resultset '0x6c91de0'
[08:45:42] [DEBUG] fetched MySQL result '0x6ceef68'
[08:45:42] [DEBUG] allocated 20 bytes for PAWN result
[08:45:42] [INFO] query "SELECT * FROM `users` WHERE `Name`='James.Gordon'" successfully executed within 2.434 milliseconds
[08:45:42] [DEBUG] CResultSet::Create(connection=0x6c89488, query_str='SELECT * FROM `users` WHERE `Name`='James.Gordon'')
[08:45:42] [DEBUG] created new resultset '0x6cdf768'
[08:45:42] [DEBUG] fetched MySQL result '0x6c924b0'
[08:45:42] [DEBUG] allocated 0 bytes for PAWN result
[08:45:42] [DEBUG] CCallback::Execute(amx=0x4ba30c8, index=169, num_params=2)
[08:45:42] [INFO] Executing callback 'LoadPlayerData' with 2 parameters...
[08:45:42] [DEBUG] processing internal specifier 'c'
[08:45:42] [DEBUG] pushed value '1' onto AMX stack
[08:45:42] [DEBUG] processing internal specifier 'c'
[08:45:42] [DEBUG] pushed value '8' onto AMX stack
[08:45:42] [DEBUG] executing AMX callback with index '169'
[08:45:42] [DEBUG] cache_get_row_count(0x06A9575C)
[08:45:42] [DEBUG] cache_get_row_count: return value: '1'
[08:45:42] [DEBUG] AMX callback executed with error '0'
[08:45:42] [INFO] Callback successfully executed.
[08:45:42] [DEBUG] CCallback::Execute(amx=0x4ba30c8, index=240, num_params=1)
[08:45:42] [INFO] Executing callback 'PlayerHaveMD5' with 1 parameter...
[08:45:42] [DEBUG] processing internal specifier 'c'
[08:45:42] [DEBUG] pushed value '8' onto AMX stack
[08:45:42] [DEBUG] executing AMX callback with index '240'
[08:45:42] [DEBUG] cache_get_value_name_int(0, "GotMD5", 0x061B458C)
[08:45:42] [ERROR] cache_get_value_name_int: invalid row index '0' (number of rows: '0')
[08:45:42] [DEBUG] AMX callback executed with error '0'
[08:45:42] [INFO] Callback successfully executed.
Alles anzeigen
Es scheint dann wohl kein "James.Gordon" Eintrag in der Tabelle users zu existieren.
public PlayerHaveMD5(playerid)
{
new rows;
cache_get_row_count(rows);
if(rows)
{
cache_get_value_name_int(0, "GotMD5", GotMD5[playerid]);
}
return 1;
}
Das ist Richtig weil es auch ein Spieler ist.
Indemsinne habe ich das nun so getestet und natürlich den log dabei.
"James.Gordon" ist ein Spieler der connectet also hat das in endeffect mit den Ganzen ja nichts zutun das er bei Users eingetragen ist. eingetragen soll er sein wen er sich regestriert ist auch normal.
[08:56:51] [DEBUG] mysql_format(1, 0x069815B0, 256, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = '%s'")
[08:56:51] [DEBUG] mysql_format: return value: '69'
[08:56:51] [DEBUG] mysql_pquery(1, "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'", "LoadPlayerData", "dd")
[08:56:51] [DEBUG] CCallback::Create(amx=0x4a830c8, name='LoadPlayerData', format='dd', params=0x6981594, param_offset=5)
[08:56:51] [DEBUG] CCallback::Create - callback index for 'LoadPlayerData': 169
[08:56:51] [DEBUG] processing specifier 'd' with parameter index 0
[08:56:51] [DEBUG] retrieved and pushed value '8'
[08:56:51] [DEBUG] processing specifier 'd' with parameter index 1
[08:56:51] [DEBUG] retrieved and pushed value '1'
[08:56:51] [INFO] Callback 'LoadPlayerData' set up for delayed execution.
[08:56:51] [DEBUG] created delayed callback with 2 parameters
[08:56:51] [DEBUG] CHandle::Execute(this=0x6a89410, type=2, query=0x6baaa80)
[08:56:51] [DEBUG] CConnectionPool::Queue(query=0x6baaa80, this=0x25d9d08)
[08:56:51] [DEBUG] CHandle::Execute - return value: true
[08:56:51] [DEBUG] mysql_pquery: return value: '1'
[08:56:51] [DEBUG] mysql_format(1, 0x069815B0, 256, "SELECT * FROM `users` WHERE `Name`='%s'")
[08:56:51] [DEBUG] mysql_format: return value: '49'
[08:56:51] [DEBUG] mysql_pquery(1, "SELECT * FROM `users` WHERE `Name`='James.Gordon'", "PlayerHaveMD5", "d")
[08:56:51] [DEBUG] CConnection::Execute(query=0x6baaa80, this=0x6fa4020, connection=0x6b72698)
[08:56:51] [DEBUG] CCallback::Create(amx=0x4a830c8, name='PlayerHaveMD5', format='d', params=0x6981598, param_offset=5)
[08:56:51] [DEBUG] CQuery::Execute(this=0x6baaa80, connection=0x6b72698)
[08:56:51] [DEBUG] CCallback::Create - callback index for 'PlayerHaveMD5': 240
[08:56:51] [DEBUG] processing specifier 'd' with parameter index 0
[08:56:51] [DEBUG] retrieved and pushed value '8'
[08:56:51] [INFO] Callback 'PlayerHaveMD5' set up for delayed execution.
[08:56:51] [DEBUG] created delayed callback with 1 parameter
[08:56:51] [DEBUG] CHandle::Execute(this=0x6a89410, type=2, query=0x6baa5c0)
[08:56:51] [DEBUG] CConnectionPool::Queue(query=0x6baa5c0, this=0x25d9d08)
[08:56:51] [DEBUG] CConnection::Execute(query=0x6baa5c0, this=0x7171020, connection=0x6b7bf40)
[08:56:51] [DEBUG] CQuery::Execute(this=0x6baa5c0, connection=0x6b7bf40)
[08:56:51] [DEBUG] CHandle::Execute - return value: true
[08:56:51] [DEBUG] mysql_pquery: return value: '1'
[08:56:51] [INFO] query "SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'" successfully executed within 0.388 milliseconds
[08:56:51] [DEBUG] CResultSet::Create(connection=0x6b72698, query_str='SELECT COUNT(*) AS `count` FROM `users` WHERE `Name` = 'James.Gordon'')
[08:56:51] [DEBUG] created new resultset '0x6bb2400'
[08:56:51] [DEBUG] fetched MySQL result '0x6bf8720'
[08:56:51] [DEBUG] allocated 20 bytes for PAWN result
[08:56:51] [INFO] query "SELECT * FROM `users` WHERE `Name`='James.Gordon'" successfully executed within 0.690 milliseconds
[08:56:51] [DEBUG] CResultSet::Create(connection=0x6b7bf40, query_str='SELECT * FROM `users` WHERE `Name`='James.Gordon'')
[08:56:51] [DEBUG] created new resultset '0x6bb22b0'
[08:56:51] [DEBUG] fetched MySQL result '0x25e0940'
[08:56:51] [DEBUG] allocated 0 bytes for PAWN result
[08:56:51] [DEBUG] CCallback::Execute(amx=0x4a830c8, index=169, num_params=2)
[08:56:51] [INFO] Executing callback 'LoadPlayerData' with 2 parameters...
[08:56:51] [DEBUG] processing internal specifier 'c'
[08:56:51] [DEBUG] pushed value '1' onto AMX stack
[08:56:51] [DEBUG] processing internal specifier 'c'
[08:56:51] [DEBUG] pushed value '8' onto AMX stack
[08:56:51] [DEBUG] executing AMX callback with index '169'
[08:56:51] [DEBUG] cache_get_row_count(0x0698179C)
[08:56:51] [DEBUG] cache_get_row_count: return value: '1'
[08:56:51] [DEBUG] AMX callback executed with error '0'
[08:56:51] [INFO] Callback successfully executed.
[08:56:51] [DEBUG] CCallback::Execute(amx=0x4a830c8, index=240, num_params=1)
[08:56:51] [INFO] Executing callback 'PlayerHaveMD5' with 1 parameter...
[08:56:51] [DEBUG] processing internal specifier 'c'
[08:56:51] [DEBUG] pushed value '8' onto AMX stack
[08:56:51] [DEBUG] executing AMX callback with index '240'
[08:56:51] [DEBUG] cache_get_row_count(0x069819AC)
[08:56:51] [DEBUG] cache_get_row_count: return value: '1'
[08:56:51] [DEBUG] AMX callback executed with error '0'
[08:56:51] [INFO] Callback successfully executed.
Alles anzeigen
Indemsinne habe ich das nun so getestet und natürlich den log dabei.
Dann passt es jetzt ja. Wenn du den Debug Modus wieder aus machst, sollte nichts mehr im Log auftauchen.
Das einzige was er mir noch ausgibt ist:
[09:02:40] [ERROR] cache_get_row_count: no active cache
Mehr nicht.
Der eine Fehler ist jetzt weg.
Der müsste dann aber weiter vorne im großen Debug Log stehen. Im obigen Block war der nämlich nicht drin.
[09:09:13] [DEBUG] mysql_format(1, 0x0699BE98, 123, "SELECT * FROM `bannedplayers` WHERE `Name` = '%e'")
[09:09:13] [DEBUG] CHandle::EscapeString(this=0x6a97140, src='James.Gordon')
[09:09:13] [DEBUG] CConnection::EscapeString(src='James.Gordon', this=0x26997b8, connection=0x6b72818)
[09:09:13] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'James.Gordon'
[09:09:13] [DEBUG] mysql_format: return value: '59'
[09:09:13] [DEBUG] mysql_pquery(1, "SELECT * FROM `bannedplayers` WHERE `Name` = 'James.Gordon'", "", "")
[09:09:13] [DEBUG] CCallback::Create(amx=0x4b930c8, name='', format='', params=0x699ba80, param_offset=5)
[09:09:13] [DEBUG] CHandle::Execute(this=0x6a97140, type=2, query=0x6bb54f0)
[09:09:13] [DEBUG] CConnectionPool::Queue(query=0x6bb54f0, this=0x26998f8)
[09:09:13] [DEBUG] CConnection::Execute(query=0x6bb54f0, this=0x7190020, connection=0x6b8b210)
[09:09:13] [DEBUG] CQuery::Execute(this=0x6bb54f0, connection=0x6b8b210)
[09:09:13] [DEBUG] CHandle::Execute - return value: true
[09:09:13] [DEBUG] mysql_pquery: return value: '1'
[09:09:13] [DEBUG] cache_get_row_count(0x0699BA90)
[09:09:13] [ERROR] cache_get_row_count: no active cache
[09:09:13] [INFO] query "SELECT * FROM `bannedplayers` WHERE `Name` = 'James.Gordon'" successfully executed within 0.752 milliseconds
[09:09:13] [DEBUG] CResultSet::Create(connection=0x6b8b210, query_str='SELECT * FROM `bannedplayers` WHERE `Name` = 'James.Gordon'')
[09:09:13] [DEBUG] created new resultset '0x6c23fd0'
[09:09:13] [DEBUG] fetched MySQL result '0x6c04be8'
[09:09:13] [DEBUG] allocated 0 bytes for PAWN result
Alles anzeigen
Habe da nie was verändert hä?
new VAR = 0,TextString[123];
new BanHammer[128], BanReason[128], BPZeit;
SetPlayerColor(playerid, COLOR_GRAD2);
mysql_format(handle, TextString, sizeof(TextString), "SELECT * FROM `bannedplayers` WHERE `Name` = '%e'", playername);
mysql_pquery(handle, TextString, "", "");
new rows;
cache_get_row_count(rows);
for(new i=0;i<rows;i++)
{
cache_get_value_name(i,"Reason", BanReason, MAX_PLAYER_NAME);
cache_get_value_name(i,"Hammer", BanHammer, MAX_PLAYER_NAME);
cache_get_value_name_int(i,"Time", BPZeit);
if(BPZeit != -1)
{
if(BPZeit > Time())
{
VAR = 1;
}
else
{
mysql_format(handle, TextString, sizeof(TextString), "DELETE FROM `bannedplayers` WHERE `Name` = '%e'", playername);
mysql_pquery(handle, TextString, "", "");
VAR = 0;
}
}
else
{
VAR = 1;
}
if(VAR == 1)
{
if(BPZeit == -1)
{
ShowPlayerMarkers(400);
SetSpawnInfo(playerid,0,299,0,0,0,0,0,0,0,0,0,0);
LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid);
TogglePlayerControllable(playerid,0);
SetTimerEx("SetConnectBan",200,0,"i",playerid);
return 1;
}
else
{
ShowPlayerMarkers(400);
SetSpawnInfo(playerid,0,299,0,0,0,0,0,0,0,0,0,0);
LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid);
TogglePlayerControllable(playerid,0);
SetTimerEx("SetConnectTimeBan",200,0,"i",playerid);
return 1;
}
}
}
return 1;
}
Alles anzeigen
PUBLIC:SetConnectBan(playerid)
{
new BanHammer[128], BanReason[128];
new string[128], rows;
mysql_format(handle, string, sizeof(string), "SELECT * FROM `bannedplayers` WHERE `Name` = '%e'", SpielerName(playerid));
mysql_pquery(handle, string, "", "");
cache_get_row_count(rows);
for(new i=0;i<rows;i++)
{
cache_get_value_name(i,"Reason", BanReason, MAX_PLAYER_NAME);
cache_get_value_name(i,"Hammer", BanHammer, MAX_PLAYER_NAME);
}
LoginScreen(playerid,0);
LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid);
new string1[256],string2[256],string3[256],string4[700],string5[256],string6[256],string7[256],mstring[1900];
format(string1, sizeof string1, "Dieser Account ist leider gesperrt, mit ihm kann nicht gespielt werden.\n");
format(string2, sizeof string2, "Wenn das nicht dein Account ist,verwende einen anderen Nickname.");
format(string3, sizeof string3, "Wenn es dein Account ist und du der Meinung bist,dass du zu unrecht gesperrt wurdest,wende dich an einen Admin.\n");
format(string4, sizeof string4, "Die Daten des Banns:");
format(string5, sizeof string5, "Dauer:\t\tunbegrenzt");
format(string6, sizeof string6, "Grund:\t\t%s", BanReason, SpielerName(playerid));
format(string7, sizeof string7, "Von:\t\t%s", BanHammer, SpielerName(playerid));
format(mstring, sizeof mstring, "%s\n%s\n%s\n%s\n%s\n%s\n%s",string1,string2,string3,string4,string5,string6,string7);
ShowPlayerDialog(playerid,45,DIALOG_STYLE_MSGBOX,"Westbound-Reallife: Account gesperrt",mstring,"Verlassen","");
SetTimerEx("ConnectKick", 10,0,"i",playerid);
}
Alles anzeigen
Der Cache muss hier - wie bei den anderen Funktionen auch - über das in mysql_pquery angegebene Callback ausgelesen werden.
Gebe in mysql_pquery ein Callback mit Parametern an und füge den darunter stehenden Code in das Callback ein.
Habe das jetzt etwas kleiner gemacht und übersichtlicher.
PUBLIC:SetConnectBan(playerid)
{
new BanHammer[128], BanReason[128], string[256];
mysql_format(handle, string, sizeof(string), "SELECT * FROM `bannedplayers` WHERE `Name` = '%s'", SpielerName(playerid));
mysql_pquery(handle, string);
new rows = cache_get_row_count(rows);
for(new i=0;i<rows;i++)
{
cache_get_value_name(i,"Reason", BanReason, MAX_PLAYER_NAME);
cache_get_value_name(i,"Hammer", BanHammer, MAX_PLAYER_NAME);
}
LoginScreen(playerid,0);
LoginTimer[playerid] = SetTimerEx("ServerTime",20000,0,"i",playerid);
format(string, 256, "Dieser Account ist gesperrt, mit ihm kann nicht gespielt werden.\n\nWenn das nicht dein Account ist Verwende einen anderen Nickname.\nWenn das dein Account ist und du zu unrecht gesperrt wurdest, melde dich im Forum unter www.coming-soon.de\n\nGrund:\t\t%s\nDauer:\t\tPermanent\nAdmin:\t\t%s", BanReason, BanHammer);
ShowPlayerDialog(playerid, 45, DIALOG_STYLE_MSGBOX, "Coming Soon", string, "Abbrechen", "");
SetTimerEx("ConnectKick", 10,0,"i",playerid);
}
Alles anzeigen
Inwiefern ist das gemeint es ist ja mit pquery?
Den Cache musst du in einem separaten Callback auslesen, wie die allen anderen Queries auch.
http://wiki.sa-mp.com/wiki/MySQL/R40#mysql_pquery
Es ist immer das gleiche Prinzip.
mysql_pquery -> Callback angeben
Callback (public) -> Cache auslesen
Die frage ist was ich ihm da geben muss LoadPlayerData? Oder wie soll ich das verstehn