Die globale Variable Tutorial.. ist totaler Müll.
Allgemein alles unter OnPlayerSpawn entfernen, den ganzen Public OnPlayerTutorial entfernen.
Danach mit meiner Hilfestellung davor weiter machen.
So?
C
forward OnPlayerLogin(playerid);
public OnPlayerLogin(playerid)
{
new Rows;
cache_get_row_count(Rows);
if(Rows == 0)
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Rollenspiel - Einloggen", "Bitte gib nun dein Passwort ein:\n{FF0000}Falsches Passwort!", "Einloggen", "Abbrechen");
}
else
{
cache_get_value_name_int(0, "ID", PlayerInfo[playerid][p_ID]);
cache_get_value_name_int(0, "Level", PlayerInfo[playerid][pLevel]);
cache_get_value_name_int(0, "Money", PlayerInfo[playerid][pMoney]);
cache_get_value_name_int(0, "Kills", PlayerInfo[playerid][pKills]);
cache_get_value_name_int(0, "Deaths", PlayerInfo[playerid][pDeaths]);
cache_get_value_name_int(0, "Tutorial", PlayerInfo[playerid][pTutorial]);
PlayerInfo[playerid][pLoggedIn] = true;
SendClientMessage(playerid, COLOR_GREEN, "{2AD400}Rollenspiel:{FFFFFF} Du hast dich eingeloggt.");
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
SpawnPlayer(playerid);
if(PlayerInfo[playerid][pTutorial] != 1)
{
switch(PlayerInfo[playerid][pTutorial])
{
case 1:
{
SendClientMessage(playerid, -1, "Text 1");
}
case 2:
{
SendClientMessage(playerid, -1, "Text 2");
}
case 3:
{
SendClientMessage(playerid, -1, "Text 3");
}
case 4:
{
SendClientMessage(playerid, -1, "Text 4");
}
case 5:
{
SendClientMessage(playerid, -1, "Tutorial absolviert.");
PlayerInfo[playerid][pTutorial] = 1;
OnPlayerSave(playerid);
}
}
}
}
return 1;
}
Alles anzeigen
Es kommt aber dann nur nichts.