Commands White Not Logged In
#2

Try to create a variable
pawn Код:
new Logged[playerid];
when the player is logged, set the variable on 1.

pawn Код:
if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COLOR_ALB_EMBED"Success!",""COLOR_VERDE_EMBED"Te-ai logat cu succes!","Ok","");
                    Logged[playerid] = 1;
                }

On the callback OnPlayerCommandText;
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(Logged[playerid] == 1)
  {
    if (strcmp("/stats", cmdtext, true, 10) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new statstring[128];
            format(statstring, sizeof(statstring), "| Stats-urile Tale : | Kills: %d | Deaths: %d | Cash: $%d | Banca: $%d | Casa: %d | Admin: %d |",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pBanca],PlayerInfo[playerid][pCasa],PlayerInfo[playerid][pAdmin]);
            SendClientMessage(playerid,-1, statstring);
        }
        return 1;
    }
    return 0;
  }
}
Reply


Messages In This Thread
Commands White Not Logged In - by alexkillerul - 03.08.2013, 15:56
Re : Commands White Not Logged In - by Garwan50 - 03.08.2013, 16:09
Re: Commands White Not Logged In - by alexkillerul - 03.08.2013, 17:00
Re : Commands White Not Logged In - by Garwan50 - 03.08.2013, 17:33
Re: Commands White Not Logged In - by sarab_singh - 03.08.2013, 18:07
Re : Commands White Not Logged In - by Garwan50 - 03.08.2013, 18:13
Re: Commands White Not Logged In - by alexkillerul - 03.08.2013, 18:21
Re : Commands White Not Logged In - by Garwan50 - 03.08.2013, 18:33
Re: Commands White Not Logged In - by Scenario - 03.08.2013, 18:37
Re: Commands White Not Logged In - by DobbysGamertag - 03.08.2013, 20:44

Forum Jump:


Users browsing this thread: 1 Guest(s)