TextDrawShowForPlayer(playerid, StatsTacke); format(string,sizeof string,"---------------------"); TextDrawSetString(StatsTacke,string); TextDrawShowForPlayer(playerid, StatsLevel); format(string,sizeof string,"LEVEL: %d",PlayerInfo[playerid][pLevel]); TextDrawSetString(StatsLevel,string); TextDrawShowForPlayer(playerid, StatsRespekti); new nxtlevel = PlayerInfo[playerid][pLevel]+1; new expamount = nxtlevel*levelexp; format(string,sizeof string,"RESPEKTI: %d/%d",PlayerInfo[playerid][pExp], expamount); TextDrawSetString(StatsRespekti,string); TextDrawShowForPlayer(playerid, StatsDoRespekta); format(string,sizeof string,"DO RESPEKTA: %d/60", PlayerInfo[playerid][pMinutePayDay]); TextDrawSetString(StatsDoRespekta,string); TextDrawShowForPlayer(playerid, StatsNovac); format(string,sizeof string,"NOVAC: %d$", PlayerInfo[playerid][pCash]); TextDrawSetString(StatsNovac,string); TextDrawShowForPlayer(playerid, StatsBanka); format(string,sizeof string,"BANKA: %d$", PlayerInfo[playerid][pAccount]); TextDrawSetString(StatsBanka,string); TextDrawShowForPlayer(playerid, StatsOrg); format(string,sizeof string,"ORG: %d", PlayerInfo[playerid][pMember]); TextDrawSetString(StatsOrg,string);
if(strcmp(cmd, "/account", true) == 0) { if(IsPlayerConnected(playerid)) { new trolol[256]; trolol = strtok(cmdtext, idx); if(!strlen(trolol)) { SendClientMessage(playerid, COLOR_DGOLD,"KORISTI: /account [profile/password]"); return 1; } if(strcmp(trolol,"profile",true) == 0) { TextDrawShowForPlayer(playerid, StatsTacke); format(string,sizeof string,"---------------------"); TextDrawSetString(StatsTacke,string); TextDrawShowForPlayer(playerid, StatsLevel); format(string,sizeof string,"LEVEL: %d",PlayerInfo[playerid][pLevel]); TextDrawSetString(StatsLevel,string); TextDrawShowForPlayer(playerid, StatsRespekti); new nxtlevel = PlayerInfo[playerid][pLevel]+1; new expamount = nxtlevel*levelexp; format(string,sizeof string,"RESPEKTI: %d/%d",PlayerInfo[playerid][pExp], expamount); TextDrawSetString(StatsRespekti,string); TextDrawShowForPlayer(playerid, StatsDoRespekta); format(string,sizeof string,"DO RESPEKTA: %d/60", PlayerInfo[playerid][pMinutePayDay]); TextDrawSetString(StatsDoRespekta,string); TextDrawShowForPlayer(playerid, StatsNovac); format(string,sizeof string,"NOVAC: %d$", PlayerInfo[playerid][pCash]); TextDrawSetString(StatsNovac,string); TextDrawShowForPlayer(playerid, StatsBanka); format(string,sizeof string,"BANKA: %d$", PlayerInfo[playerid][pAccount]); TextDrawSetString(StatsBanka,string); TextDrawShowForPlayer(playerid, StatsOrg); format(string,sizeof string,"ORG: %d", PlayerInfo[playerid][pMember]); TextDrawSetString(StatsOrg,string); } } return 1; }
if (strcmp (cmdtext, "/account", true) == 0) { if (IsPlayerConnected (playerid)) { TextDrawShowForPlayer(playerid, StatsTacke); format(string,sizeof string,"---------------------"); TextDrawSetString(StatsTacke,string); TextDrawShowForPlayer(playerid, StatsLevel); format(string,sizeof string,"LEVEL: %d",PlayerInfo[playerid][pLevel]); TextDrawSetString(StatsLevel,string); TextDrawShowForPlayer(playerid, StatsRespekti); new nxtlevel = PlayerInfo[playerid][pLevel]+1; new expamount = nxtlevel*levelexp; format(string,sizeof string,"RESPEKTI: %d/%d",PlayerInfo[playerid][pExp], expamount); TextDrawSetString(StatsRespekti,string); TextDrawShowForPlayer(playerid, StatsDoRespekta); format(string,sizeof string,"DO RESPEKTA: %d/60", PlayerInfo[playerid][pMinutePayDay]); TextDrawSetString(StatsDoRespekta,string); TextDrawShowForPlayer(playerid, StatsNovac); format(string,sizeof string,"NOVAC: %d$", PlayerInfo[playerid][pCash]); TextDrawSetString(StatsNovac,string); TextDrawShowForPlayer(playerid, StatsBanka); format(string,sizeof string,"BANKA: %d$", PlayerInfo[playerid][pAccount]); TextDrawSetString(StatsBanka,string); TextDrawShowForPlayer(playerid, StatsOrg); format(string,sizeof string,"ORG: %d", PlayerInfo[playerid][pMember]); TextDrawSetString(StatsOrg,string); } return true; }
dcmd_stats(playerid, params[])
{
new profilepass[6];
if(sscanf(params,"s[6]", profilepass)) {
SendClientMessage(playerid, COLOR_GRAD2, "[{EE5555}USAGE{FFFFFF}]: /stats [profile/password]");
return 1;
}
if(strcmp(params,"profile",true) == 0) {
TextDrawShowForPlayer(playerid, StatsTacke);
format(string,sizeof string,"---------------------");
TextDrawSetString(StatsTacke,string);
TextDrawShowForPlayer(playerid, StatsLevel);
format(string,sizeof string,"LEVEL: %d",PlayerInfo[playerid][pLevel]);
TextDrawSetString(StatsLevel,string);
TextDrawShowForPlayer(playerid, StatsRespekti);
new nxtlevel = PlayerInfo[playerid][pLevel]+1;
new expamount = nxtlevel*levelexp;
format(string,sizeof string,"RESPEKTI: %d/%d",PlayerInfo[playerid][pExp], expamount);
TextDrawSetString(StatsRespekti,string);
TextDrawShowForPlayer(playerid, StatsDoRespekta);
format(string,sizeof string,"DO RESPEKTA: %d/60", PlayerInfo[playerid][pMinutePayDay]);
TextDrawSetString(StatsDoRespekta,string);
TextDrawShowForPlayer(playerid, StatsNovac);
format(string,sizeof string,"NOVAC: %d$", PlayerInfo[playerid][pCash]);
TextDrawSetString(StatsNovac,string);
TextDrawShowForPlayer(playerid, StatsBanka);
format(string,sizeof string,"BANKA: %d$", PlayerInfo[playerid][pAccount]);
TextDrawSetString(StatsBanka,string);
TextDrawShowForPlayer(playerid, StatsOrg);
format(string,sizeof string,"ORG: %d", PlayerInfo[playerid][pMember]);
TextDrawSetString(StatsOrg,string);
}
return 1;
}
new StatsLevel[MAX_PLAYERS];
StatsLevel[playerid] = TextDrawCreate(440.000000,388.000000, " ");
TextDrawAlignment(StatsLevel[playerid], 2);
TextDrawBackgroundColor(StatsLevel[playerid], 255);
TextDrawFont(StatsLevel[playerid], 2);
TextDrawLetterSize(StatsLevel[playerid], 0.160000, 0.599999);
TextDrawColor(StatsLevel[playerid], 0xE81010FF);
TextDrawSetOutline(StatsLevel[playerid], 1);
TextDrawSetProportional(StatsLevel[playerid], 1);
TextDrawShowForPlayer(playerid, StatsLevel[playerid]);
format(string, sizeof string, "LEVEL: %d", PlayerInfo[playerid][pLevel]);
TextDrawSetString(StatsLevel[playerid], string);
new Text:StatsLevel[MAX_PLAYERS]; // my fault
You have to create a textdraw for each player!
For ex: pawn Код:
|
new Text:StatsLevel; TextDrawShowForPlayer(playerid, StatsLevel); format(string,sizeof string,"LEVEL: %d",PlayerInfo[targetid][pLevel]); TextDrawSetString(StatsLevel,string); format(cordsstring, sizeof(cordsstring),"LEVEL: %d", PlayerInfo[playerid][pLevel]); StatsLevel = TextDrawCreate(16 ,205, cordsstring); TextDrawAlignment(StatsLevel,1); TextDrawFont(StatsLevel,2); TextDrawLetterSize(StatsLevel,0.22, 1.0); TextDrawColor(StatsLevel,0xffffffFF); TextDrawSetOutline(StatsLevel,1); TextDrawSetProportional(StatsLevel,1); TextDrawSetShadow(StatsLevel,1); if(PRESSED(KEY_FIRE)) { TextDrawHideForPlayer(playerid, StatsLevel); }
Can you do this for me, just as example:
Here is what I done: Код:
new Text:StatsLevel; TextDrawShowForPlayer(playerid, StatsLevel); format(string,sizeof string,"LEVEL: %d",PlayerInfo[targetid][pLevel]); TextDrawSetString(StatsLevel,string); format(cordsstring, sizeof(cordsstring),"LEVEL: %d", PlayerInfo[playerid][pLevel]); StatsLevel = TextDrawCreate(16 ,205, cordsstring); TextDrawAlignment(StatsLevel,1); TextDrawFont(StatsLevel,2); TextDrawLetterSize(StatsLevel,0.22, 1.0); TextDrawColor(StatsLevel,0xffffffFF); TextDrawSetOutline(StatsLevel,1); TextDrawSetProportional(StatsLevel,1); TextDrawSetShadow(StatsLevel,1); if(PRESSED(KEY_FIRE)) { TextDrawHideForPlayer(playerid, StatsLevel); } |
//top of the script
new PlayerText:StatsTacke[MAX_PLAYERS];
new PlayerText:StatsLevel[MAX_PLAYERS];
new PlayerText:StatsRespekti[MAX_PLAYERS];
new PlayerText:StatsDoRespekta[MAX_PLAYERS];
new PlayerText:StatsNovac[MAX_PLAYERS];
new PlayerText:StatsBanka[MAX_PLAYERS];
new PlayerText:StatsOrg[MAX_PLAYERS];
//OnPlayerCommandText
if(!strcmp(cmd, "/account", true,8))
{
if(!IsPlayerConnected(playerid))return 1;
if(cmd[8]!=' ')SendClientMessage(playerid, COLOR_DGOLD,"KORISTI: /account [profile/password]"),return 1;
new str[20];
strcat(str,cmd[9]);
if(!strlen(str))SendClientMessage(playerid, COLOR_DGOLD,"KORISTI: /account [profile/password]"),return 1;
if(strcmp(str,"profile",true) == 0)
{
PlayerTextDrawSetString(playerid,StatsTacke[playerid],"---------------------");
PlayerTextDrawShow(playerid, StatsTacke[playerid]);
format(string,sizeof string,"LEVEL: %d",PlayerInfo[playerid][pLevel]);
PlayerTextDrawSetString(StatsLevel[playerid],string);
PlayerTextDrawShow(playerid, StatsLevel[playerid]);
new nxtlevel = PlayerInfo[playerid][pLevel]+1;
new expamount = nxtlevel*levelexp;
format(string,sizeof string,"RESPEKTI: %d/%d",PlayerInfo[playerid][pExp], expamount);
PlayerTextDrawSetString(StatsRespekti[playerid],string);
PlayerTextDrawShow(playerid, StatsRespekti[playerid]);
format(string,sizeof string,"DO RESPEKTA: %d/60", PlayerInfo[playerid][pMinutePayDay]);
PlayerTextDrawSetString(StatsDoRespekta[playerid],string);
PlayerTextDrawShow(playerid, StatsDoRespekta[playerid]);
format(string,sizeof string,"NOVAC: %d$", PlayerInfo[playerid][pCash]);
PlayerTextDrawSetString(StatsNovac[playerid],string);
PlayerTextDrawShow(playerid, StatsNovac[playerid]);
format(string,sizeof string,"BANKA: %d$", PlayerInfo[playerid][pAccount]);
PlayerTextDrawSetString(StatsBanka[playerid],string);
PlayerTextDrawShow(playerid, StatsBanka[playerid]);
format(string,sizeof string,"ORG: %d", PlayerInfo[playerid][pMember]);
PlayerTextDrawSetString(StatsOrg[playerid],string);
PlayerTextDrawShow(playerid, StatsOrg[playerid]);
}
return 1;
}