Jump to content
  • 0

Se scrie mesajul inainte de logare


Question

Posted

Problema intalnita (descriere):Cand gresesc parola imi seteaza locul spawn-ului si imi da mesajul de intampinare care ar trebuii sa apara dupa ce am bagat parola corecta . As vrea ca atunci cand greseste parola sa-i dea un text( il modific eu ) iar cand scrie gresit parola sa-i dea kick. Nu inteleg ce trebuie sa fac....
Ero(area / rile) / warning-(ul / urile): Nu am.
Liniile de cod / sursa / script-ul(obligatoriu): 

public OnLogin(playerid)
{
    new rows, fields,temporar[200], string1[1000], targetid;
    cache_get_data(rows, fields);
    if(rows)
    {
    	cache_get_field_content(0, "Parola", temporar), format( P_Data[playerid][pParola], 25, temporar);
        P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "AdminLevel");
        P_Data[playerid][pCash] = cache_get_field_content_int(0, "Cash");
        P_Data[playerid][pHelper] = cache_get_field_content_int(0, "HelperLevel");
        P_Data[playerid][pLevel] = cache_get_field_content_int(0, "Level");
       
    }
    else
    {
    	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit");
    }
    
    GivePlayerMoney(playerid, P_Data[playerid][pCash]);
    SetPlayerScore(playerid, P_Data[playerid][pLevel]);
    SpawnPlayer(playerid);
	SendClientMessage(playerid, COLOR_YELLOW, "SERVER: Bine ai revenit.");
	format(string1, sizeof(string1), "%s s-a logat pe server cu ID-ul (%d)", GetName(targetid), playerid);
	submitToHelpersAndAdmins(string1, COLOR_STAFF);
    return 1;
}


Imagini / Video (optional): http://imgur.com/uFWBSLj
Ati incercat sa rezolvati singur?: Da, am incercat sa schimb  pozitia textului la case DIALOG_LOGIN

<a href="http://www.game-state.eu/89.33.242.212:7777/"><img src="http://www.game-state.eu/89.33.242.212:7777/350x20_FFFFFF_FFFFFF_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

4 answers to this question

Recommended Posts

  • 0
Posted

public OnLogin(playerid)
{
    new rows, fields,temporar[200], string1[1000], targetid;
    cache_get_data(rows, fields);
    if(rows)
    {
        cache_get_field_content(0, "Parola", temporar), format( P_Data[playerid][pParola], 25, temporar);
        P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "AdminLevel");
        P_Data[playerid][pCash] = cache_get_field_content_int(0, "Cash");
        P_Data[playerid][pHelper] = cache_get_field_content_int(0, "HelperLevel");
        P_Data[playerid][pLevel] = cache_get_field_content_int(0, "Level");
        GivePlayerMoney(playerid, P_Data[playerid][pCash]);
        SetPlayerScore(playerid, P_Data[playerid][pLevel]);
        SpawnPlayer(playerid);
        SendClientMessage(playerid, COLOR_YELLOW, "SERVER: Bine ai revenit.");
        format(string1, sizeof(string1), "%s s-a logat pe server cu ID-ul (%d)", GetName(targetid), playerid);
        submitToHelpersAndAdmins(string1, COLOR_STAFF);
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit");
    }
    return 1;
}


			
		
  • 0
Posted
public OnLogin(playerid)
{
    new rows, fields,temporar[200], string1[1000], targetid;
    cache_get_data(rows, fields);
    if(!rows)
    {
    	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit");
    }
    else
    {
         cache_get_field_content(0, "Parola", temporar), format( P_Data[playerid][pParola], 25, temporar);
         P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "AdminLevel");
         P_Data[playerid][pCash] = cache_get_field_content_int(0, "Cash");
         P_Data[playerid][pHelper] = cache_get_field_content_int(0, "HelperLevel");
         P_Data[playerid][pLevel] = cache_get_field_content_int(0, "Level");
         //-----------------------------------------------------------------
         GivePlayerMoney(playerid, P_Data[playerid][pCash]);
         SetPlayerScore(playerid, P_Data[playerid][pLevel]);
         SpawnPlayer(playerid);
	     SendClientMessage(playerid, COLOR_YELLOW, "SERVER: Bine ai revenit.");
	     format(string1, sizeof(string1), "%s s-a logat pe server cu ID-ul (%d)", GetName(targetid), playerid);
	     submitToHelpersAndAdmins(string1, COLOR_STAFF);
         //------------------------------------------------------
         return 1;
    }
    return 1;
}

 Pune ce ti-am dat eu mai sus!

  • Upvote 1

350x20_FFFFFF_FFFFFF_000000_000000.png

  • 0
Posted
31 minutes ago, Voller. said:

public OnLogin(playerid)
{
    new rows, fields,temporar[200], string1[1000], targetid;
    cache_get_data(rows, fields);
    if(!rows)
    {
    	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit");
    }
    else
    {
         cache_get_field_content(0, "Parola", temporar), format( P_Data[playerid][pParola], 25, temporar);
         P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "AdminLevel");
         P_Data[playerid][pCash] = cache_get_field_content_int(0, "Cash");
         P_Data[playerid][pHelper] = cache_get_field_content_int(0, "HelperLevel");
         P_Data[playerid][pLevel] = cache_get_field_content_int(0, "Level");
         //-----------------------------------------------------------------
         GivePlayerMoney(playerid, P_Data[playerid][pCash]);
         SetPlayerScore(playerid, P_Data[playerid][pLevel]);
         SpawnPlayer(playerid);
	     SendClientMessage(playerid, COLOR_YELLOW, "SERVER: Bine ai revenit.");
	     format(string1, sizeof(string1), "%s s-a logat pe server cu ID-ul (%d)", GetName(targetid), playerid);
	     submitToHelpersAndAdmins(string1, COLOR_STAFF);
         //------------------------------------------------------
         return 1;
    }
    return 1;
}

 Pune ce ti-am dat eu mai sus!

Merci fain !

 

t/c

<a href="http://www.game-state.eu/89.33.242.212:7777/"><img src="http://www.game-state.eu/89.33.242.212:7777/350x20_FFFFFF_FFFFFF_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.