03.08.2013, 16:09
Try to create a variable
when the player is logged, set the variable on 1.
On the callback OnPlayerCommandText;
pawn Код:
new Logged[playerid];
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;
}
}