[POMOC] stats

Započeo --Lood--, Septembar 01, 2012, 10:39:35 PRE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

GM koji koristim: od 0
Opis problema: E vako napravio sma textdraw na klik, tacnijeuze iz MW i prilagodio svom GM, ali sada kad igrac kuca /stats, klikne na osnovo, trebalo bi m izbacit npr ako je zaposlen Posa:farmer Ime i prezime itd  al nece nezz sta je
Dio scripte:
Citat
    public OnPlayerClickTextDraw(playerid, Text:clickedid)
    {
    new string[256];
    new statsstring[256];
    if(clickedid == sstats4)
    {
    TextDrawShowForPlayer(playerid, TDstatsCrno[playerid]);
    TextDrawShowForPlayer(playerid, TDstatsLinija[playerid]);
    TextDrawShowForPlayer(playerid, TDStatsOsnovno[playerid]);
    TextDrawShowForPlayer(playerid, TDStatsIme[playerid]);
    TextDrawShowForPlayer(playerid, TDStatsZelenadesno[playerid]);
    TextDrawShowForPlayer(playerid, TDStatsZelenaleveo[playerid]);
    TextDrawShowForPlayer(playerid, TDStatsZelenadole[playerid]);
    TextDrawHideForPlayer(playerid, sstats0); TextDrawHideForPlayer(playerid, sstats5);
    TextDrawHideForPlayer(playerid, sstats1); TextDrawHideForPlayer(playerid, sstats6);
    TextDrawHideForPlayer(playerid, sstats2); TextDrawHideForPlayer(playerid, sstats7);
    TextDrawHideForPlayer(playerid, sstats3); TextDrawHideForPlayer(playerid, sstats8);
    TextDrawHideForPlayer(playerid, sstats4);
    CancelSelectTextDraw(playerid);

    ////////////////Nece ovo da ga jebes :s//////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////////////////
    new text[128];////////////////////////////////////////////////////////////////////////
    if(PlayerInfo[playerid][pPosao] == 1) { text = "Posao: Farmer"; }////////////////////
    else { text = "Nezaposlen"; }///////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////
    TextDrawSetString(TDStatsIme[playerid], statsstring);
    TextDrawSetString(TDStatsOsnovno[playerid],"Osnovno");
    SetPVarInt(playerid,"GledanjeStatsa",1);
    SCM(playerid,ZUTA,"Da ugasite vas stats pritisnite Levi klik");
    }





Slika/Video: evo za one koji nisu skontali nacrtano  xD
http://www.zaslike.com/viewer.php?file=t1v7wq3lsmgfuk5qrb3s.png

Ti nigde nisi stavio textdrawsetstring da ti postavi taj "text" ?

pa ako mislis na ono
new string[256];
i
new text[128];
stavio sam
de mozes mi malo bolje objasnit gde treba da staivim itd ?

Koji textdraw ti sluzi za prikaz tog tvog Posao: Farmer?

Nekontam sacu ti poslat textdraaw vezan za to


CMD:stats(playerid,params[])
{
new sendername[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), " %s gleda svoj stats (/stats).", sendername);
ProxDetector(10.0, playerid, string, SVETLOPLAVA,SVETLOPLAVA,SVETLOPLAVA,SVETLOPLAVA,SVETLOPLAVA);

TDstatsCrno[playerid] = TextDrawCreate(140.000000, 56.000000, "_");
TextDrawBackgroundColor(TDstatsCrno[playerid], 16711935);
TextDrawFont(TDstatsCrno[playerid], 1);
TextDrawLetterSize(TDstatsCrno[playerid], 1.000000, 37.900009);
TextDrawColor(TDstatsCrno[playerid], -16776961);
TextDrawSetOutline(TDstatsCrno[playerid], 1);
TextDrawSetProportional(TDstatsCrno[playerid], 1);
TextDrawUseBox(TDstatsCrno[playerid], 1);
TextDrawBoxColor(TDstatsCrno[playerid], 255);
TextDrawTextSize(TDstatsCrno[playerid], 431.000000, 21.000000);

TDstatsLinija[playerid] = TextDrawCreate(182.000000, 83.000000, "----------");
TextDrawBackgroundColor(TDstatsLinija[playerid], 255);
TextDrawFont(TDstatsLinija[playerid], 1);
TextDrawLetterSize(TDstatsLinija[playerid], 1.390000, 1.000000);
TextDrawColor(TDstatsLinija[playerid], 65535);
TextDrawSetOutline(TDstatsLinija[playerid], 0);
TextDrawSetProportional(TDstatsLinija[playerid], 1);
TextDrawSetShadow(TDstatsLinija[playerid], 1);

TDStatsOsnovno[playerid] = TextDrawCreate(235.000000, 69.000000, "Osnovno");
TextDrawBackgroundColor(TDStatsOsnovno[playerid], 255);
TextDrawFont(TDStatsOsnovno[playerid], 1);
TextDrawLetterSize(TDStatsOsnovno[playerid], 0.500000, 1.000000);
TextDrawColor(TDStatsOsnovno[playerid], 65601513);
TextDrawSetOutline(TDStatsOsnovno[playerid], 0);
TextDrawSetProportional(TDStatsOsnovno[playerid], 1);
TextDrawSetShadow(TDStatsOsnovno[playerid], 1);

TDStatsIme[playerid] = TextDrawCreate(161.000000, 106.000000, "Ime:");
TextDrawBackgroundColor(TDStatsIme[playerid], 255);
TextDrawFont(TDStatsIme[playerid], 1);
TextDrawLetterSize(TDStatsIme[playerid], 0.409999, 1.100000);
TextDrawColor(TDStatsIme[playerid], 16711935);
TextDrawSetOutline(TDStatsIme[playerid], 0);
TextDrawSetProportional(TDStatsIme[playerid], 1);
TextDrawSetShadow(TDStatsIme[playerid], 1);

TDStatsZelenadesno[playerid] = TextDrawCreate(420.000000, 57.000000, "_");
TextDrawBackgroundColor(TDStatsZelenadesno[playerid], 255);
TextDrawFont(TDStatsZelenadesno[playerid], 1);
TextDrawLetterSize(TDStatsZelenadesno[playerid], 0.500000, 36.799999);
TextDrawColor(TDStatsZelenadesno[playerid], -1);
TextDrawSetOutline(TDStatsZelenadesno[playerid], 0);
TextDrawSetProportional(TDStatsZelenadesno[playerid], 1);
TextDrawSetShadow(TDStatsZelenadesno[playerid], 1);
TextDrawUseBox(TDStatsZelenadesno[playerid], 1);
TextDrawBoxColor(TDStatsZelenadesno[playerid], 16711935);
TextDrawTextSize(TDStatsZelenadesno[playerid], 431.000000, 0.000000);

TDStatsZelenaleveo[playerid] = TextDrawCreate(157.000000, 57.000000, "_");
TextDrawBackgroundColor(TDStatsZelenaleveo[playerid], 255);
TextDrawFont(TDStatsZelenaleveo[playerid], 1);
TextDrawLetterSize(TDStatsZelenaleveo[playerid], 0.500000, 35.499977);
TextDrawColor(TDStatsZelenaleveo[playerid], -1);
TextDrawSetOutline(TDStatsZelenaleveo[playerid], 0);
TextDrawSetProportional(TDStatsZelenaleveo[playerid], 1);
TextDrawSetShadow(TDStatsZelenaleveo[playerid], 1);
TextDrawUseBox(TDStatsZelenaleveo[playerid], 1);
TextDrawBoxColor(TDStatsZelenaleveo[playerid], 16711935);
TextDrawTextSize(TDStatsZelenaleveo[playerid], 135.000000, 0.000000);

TDStatsZelenadole[playerid] = TextDrawCreate(140.000000, 400.000000, "_");
TextDrawBackgroundColor(TDStatsZelenadole[playerid], 255);
TextDrawFont(TDStatsZelenadole[playerid], 1);
TextDrawLetterSize(TDStatsZelenadole[playerid], 0.500000, -2.699999);
TextDrawColor(TDStatsZelenadole[playerid], -1);
TextDrawSetOutline(TDStatsZelenadole[playerid], 0);
TextDrawSetProportional(TDStatsZelenadole[playerid], 1);
TextDrawSetShadow(TDStatsZelenadole[playerid], 1);
TextDrawUseBox(TDStatsZelenadole[playerid], 1);
TextDrawBoxColor(TDStatsZelenadole[playerid], 16711935);
TextDrawTextSize(TDStatsZelenadole[playerid], 431.000000, 0.000000);


TextDrawShowForPlayer(playerid, sstats0); TextDrawShowForPlayer(playerid, sstats5);
TextDrawShowForPlayer(playerid, sstats1); TextDrawShowForPlayer(playerid, sstats6);
TextDrawShowForPlayer(playerid, sstats2); TextDrawShowForPlayer(playerid, sstats7);
TextDrawShowForPlayer(playerid, sstats3); TextDrawShowForPlayer(playerid, sstats8);
TextDrawShowForPlayer(playerid, sstats4);
SelectTextDraw(playerid, 0xA3B4C5FF);
return 1;
}


to je okmanda stats
ono ka klikne na osnovno prikazo sam ti vec gore nezz sta jos treba, netreba valjda za svaki posao novi textdraw :D

Ne treba ti samo 1 textdraw koji postoji za svakog igraca, ako ga imas koji je? ako ga nemas moras ga napraviti :D


Moras napraviti textdraw koji prikazuje statse... recimo ovakav textdraw:

Ime i prezime: Marko_Markovic\nPosao: Farmer

... i tak odalje sve sta ti treba, pa ga onda pozicioniras

kada sve to uradis sacuvas ga i dobijes 1 textdraw ... kod new dodas [MAX_PLAYERS] da bi za svakog igraca postojao 1 takav textdraw... pod ongamemodeinit kod za stvaranje stavis u:


for(new i = 0; i < MAX_PLAYERS; i++)
{

}


i npr ako ti se textdraw zove TEST dobices sacuvano:

TEST = TextDraw......
............................

ti svugde gde je TEST moras zameniti sa TEST

kada sve to uradis, u komandi STATS napravis jedno formatiranje tipa ovako:

new ime[MAX_PLAYER_NAME]; GetPlayerName(playerid, ime, sizeof(ime));
if(PlayerInfo[playerid][pPosao] == 1) { ptext = "Farmer"; }
new statstr[512];
format(statstr,512,"Ime i prezime: %s\nPosao: %s", ime, ptext);
TextDrawSetString(TEST[playerid], statstr);
TextDrawShowForPlayer(playerid, TEST[playerid]);


Nadam se da si me bar nesto razumeo :D

jesam te razumeo malo, jel to znaci daa moram npr napravit smao jedan textdraw za posao
npr narpavim textdraw za posao farmer, i onda po to textdrawu radim ostale poslove ?



i brt nezz dal je ovo dozvoljeno al de me add na skype ili fb poso sam ti na pm, a i vidis dole PLS :D

Na fb ne ulazim, skajp ne koristim zbog wampa :) ... Jednostavno moras napraviti 1 textdraw koji ti prikazuje sve podatke, zatim njega formatirati kada igrac ukuca statse u njegove podatke :)

Ali brt nekontam napravio sam textdraw za osnovno, i napravio sam textdraw koji se pojavi kad kliknem na osnovno, imas na slici sve :D, ali kako da dodam da da u textdrawu koji se stvori kad klknes na osnovno pise
Posao: Pa gde radi
itd
Dovoljno mi je primer za posao :D

Ma gde ti je taj textdraw to meni nije jasno ti taj textdraw trebas FORMATIRATI a zatim koristiti TextDrawSetString da postavis text koji god zelis razumes?

Ovo je sve sto ja imam


new Text:sstats0;
new Text:sstats1;
new Text:sstats2;
new Text:sstats3;
new Text:sstats4;
new Text:sstats5;
new Text:sstats6;
new Text:sstats7;
new Text:sstats8;

new Text:TDstatsCrno[MAX_PLAYERS];
new Text:TDstatsLinija[MAX_PLAYERS];
new Text:TDStatsOsnovno[MAX_PLAYERS];
new Text:TDStatsIme[MAX_PLAYERS];
new Text:TDStatsZelenadesno[MAX_PLAYERS];
new Text:TDStatsZelenaleveo[MAX_PLAYERS];
new Text:TDStatsZelenadole[MAX_PLAYERS];



sstats0 = TextDrawCreate(454.000000, 133.000000, "_");
TextDrawBackgroundColor(sstats0, 255);
TextDrawFont(sstats0, 1);
TextDrawLetterSize(sstats0, 0.500000, 13.499994);
TextDrawColor(sstats0, -1);
TextDrawSetOutline(sstats0, 0);
TextDrawSetProportional(sstats0, 1);
TextDrawSetShadow(sstats0, 1);
TextDrawUseBox(sstats0, 1);
TextDrawBoxColor(sstats0, 842150450);
TextDrawTextSize(sstats0, 185.000000, -12.000000);

sstats1 = TextDrawCreate(454.000000, 130.000000, "_");
TextDrawBackgroundColor(sstats1, 255);
TextDrawFont(sstats1, 1);
TextDrawLetterSize(sstats1, 0.500000, 0.600000);
TextDrawColor(sstats1, -1);
TextDrawSetOutline(sstats1, 0);
TextDrawSetProportional(sstats1, 1);
TextDrawSetShadow(sstats1, 1);
TextDrawUseBox(sstats1, 1);
TextDrawBoxColor(sstats1, 65535);
TextDrawTextSize(sstats1, 185.000000, -10.000000);

sstats2 = TextDrawCreate(454.000000, 259.000000, "_");
TextDrawBackgroundColor(sstats2, 255);
TextDrawFont(sstats2, 1);
TextDrawLetterSize(sstats2, 0.500000, 0.599999);
TextDrawColor(sstats2, -1);
TextDrawSetOutline(sstats2, 0);
TextDrawSetProportional(sstats2, 1);
TextDrawSetShadow(sstats2, 1);
TextDrawUseBox(sstats2, 1);
TextDrawBoxColor(sstats2, 65535);
TextDrawTextSize(sstats2, 185.000000, 0.000000);

sstats3 = TextDrawCreate(273.000000, 127.000000, "Arena STATS");
TextDrawBackgroundColor(sstats3, 255);
TextDrawFont(sstats3, 1);
TextDrawLetterSize(sstats3, 0.500000, 1.000000);
TextDrawColor(sstats3, -1);
TextDrawSetOutline(sstats3, 0);
TextDrawSetProportional(sstats3, 1);
TextDrawSetShadow(sstats3, 1);

sstats4 = TextDrawCreate(256.000000, 150.000000, "< Osnovno >");
TextDrawBackgroundColor(sstats4, 255);
TextDrawFont(sstats4, 2);
TextDrawLetterSize(sstats4, 0.439999, 1.100000);
TextDrawColor(sstats4, -1);
TextDrawSetOutline(sstats4, 0);
TextDrawSetProportional(sstats4, 1);
TextDrawSetShadow(sstats4, 1);

sstats5 = TextDrawCreate(248.000000, 168.000000, "< Licna Karta >");
TextDrawBackgroundColor(sstats5, 255);
TextDrawFont(sstats5, 2);
TextDrawLetterSize(sstats5, 0.439999, 1.100000);
TextDrawColor(sstats5, -1);
TextDrawSetOutline(sstats5, 0);
TextDrawSetProportional(sstats5, 1);
TextDrawSetShadow(sstats5, 1);

sstats6 = TextDrawCreate(263.000000, 185.000000, "< Imovina >");
TextDrawBackgroundColor(sstats6, 255);
TextDrawFont(sstats6, 2);
TextDrawLetterSize(sstats6, 0.439999, 1.100000);
TextDrawColor(sstats6, -1);
TextDrawSetOutline(sstats6, 0);
TextDrawSetProportional(sstats6, 1);
TextDrawSetShadow(sstats6, 1);

sstats7 = TextDrawCreate(267.000000, 200.000000, "< Dosije >");
TextDrawBackgroundColor(sstats7, 255);
TextDrawFont(sstats7, 2);
TextDrawLetterSize(sstats7, 0.439999, 1.100000);
TextDrawColor(sstats7, -1);
TextDrawSetOutline(sstats7, 0);
TextDrawSetProportional(sstats7, 1);
TextDrawSetShadow(sstats7, 1);

sstats8 = TextDrawCreate(238.000000, 218.000000, "< Unutrasnjost >");
TextDrawBackgroundColor(sstats8, 255);
TextDrawFont(sstats8, 2);
TextDrawLetterSize(sstats8, 0.439999, 1.100000);
TextDrawColor(sstats8, -1);
TextDrawSetOutline(sstats8, 0);
TextDrawSetProportional(sstats8, 1);
TextDrawSetShadow(sstats8, 1);



TextDrawSetSelectable(sstats4, true);
TextDrawSetSelectable(sstats5, true);
TextDrawSetSelectable(sstats6, true);
TextDrawSetSelectable(sstats7, true);
TextDrawSetSelectable(sstats8, true);


CMD:stats(playerid,params[])
{
new sendername[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), " %s gleda svoj stats (/stats).", sendername);
ProxDetector(10.0, playerid, string, SVETLOPLAVA,SVETLOPLAVA,SVETLOPLAVA,SVETLOPLAVA,SVETLOPLAVA);

TDstatsCrno[playerid] = TextDrawCreate(140.000000, 56.000000, "_");
TextDrawBackgroundColor(TDstatsCrno[playerid], 16711935);
TextDrawFont(TDstatsCrno[playerid], 1);
TextDrawLetterSize(TDstatsCrno[playerid], 1.000000, 37.900009);
TextDrawColor(TDstatsCrno[playerid], -16776961);
TextDrawSetOutline(TDstatsCrno[playerid], 1);
TextDrawSetProportional(TDstatsCrno[playerid], 1);
TextDrawUseBox(TDstatsCrno[playerid], 1);
TextDrawBoxColor(TDstatsCrno[playerid], 255);
TextDrawTextSize(TDstatsCrno[playerid], 431.000000, 21.000000);

TDstatsLinija[playerid] = TextDrawCreate(182.000000, 83.000000, "----------");
TextDrawBackgroundColor(TDstatsLinija[playerid], 255);
TextDrawFont(TDstatsLinija[playerid], 1);
TextDrawLetterSize(TDstatsLinija[playerid], 1.390000, 1.000000);
TextDrawColor(TDstatsLinija[playerid], 65535);
TextDrawSetOutline(TDstatsLinija[playerid], 0);
TextDrawSetProportional(TDstatsLinija[playerid], 1);
TextDrawSetShadow(TDstatsLinija[playerid], 1);

TDStatsOsnovno[playerid] = TextDrawCreate(235.000000, 69.000000, "Osnovno");
TextDrawBackgroundColor(TDStatsOsnovno[playerid], 255);
TextDrawFont(TDStatsOsnovno[playerid], 1);
TextDrawLetterSize(TDStatsOsnovno[playerid], 0.500000, 1.000000);
TextDrawColor(TDStatsOsnovno[playerid], 65601513);
TextDrawSetOutline(TDStatsOsnovno[playerid], 0);
TextDrawSetProportional(TDStatsOsnovno[playerid], 1);
TextDrawSetShadow(TDStatsOsnovno[playerid], 1);

TDStatsIme[playerid] = TextDrawCreate(161.000000, 106.000000, "Ime:");
TextDrawBackgroundColor(TDStatsIme[playerid], 255);
TextDrawFont(TDStatsIme[playerid], 1);
TextDrawLetterSize(TDStatsIme[playerid], 0.409999, 1.100000);
TextDrawColor(TDStatsIme[playerid], 16711935);
TextDrawSetOutline(TDStatsIme[playerid], 0);
TextDrawSetProportional(TDStatsIme[playerid], 1);
TextDrawSetShadow(TDStatsIme[playerid], 1);

TDStatsZelenadesno[playerid] = TextDrawCreate(420.000000, 57.000000, "_");
TextDrawBackgroundColor(TDStatsZelenadesno[playerid], 255);
TextDrawFont(TDStatsZelenadesno[playerid], 1);
TextDrawLetterSize(TDStatsZelenadesno[playerid], 0.500000, 36.799999);
TextDrawColor(TDStatsZelenadesno[playerid], -1);
TextDrawSetOutline(TDStatsZelenadesno[playerid], 0);
TextDrawSetProportional(TDStatsZelenadesno[playerid], 1);
TextDrawSetShadow(TDStatsZelenadesno[playerid], 1);
TextDrawUseBox(TDStatsZelenadesno[playerid], 1);
TextDrawBoxColor(TDStatsZelenadesno[playerid], 16711935);
TextDrawTextSize(TDStatsZelenadesno[playerid], 431.000000, 0.000000);

TDStatsZelenaleveo[playerid] = TextDrawCreate(157.000000, 57.000000, "_");
TextDrawBackgroundColor(TDStatsZelenaleveo[playerid], 255);
TextDrawFont(TDStatsZelenaleveo[playerid], 1);
TextDrawLetterSize(TDStatsZelenaleveo[playerid], 0.500000, 35.499977);
TextDrawColor(TDStatsZelenaleveo[playerid], -1);
TextDrawSetOutline(TDStatsZelenaleveo[playerid], 0);
TextDrawSetProportional(TDStatsZelenaleveo[playerid], 1);
TextDrawSetShadow(TDStatsZelenaleveo[playerid], 1);
TextDrawUseBox(TDStatsZelenaleveo[playerid], 1);
TextDrawBoxColor(TDStatsZelenaleveo[playerid], 16711935);
TextDrawTextSize(TDStatsZelenaleveo[playerid], 135.000000, 0.000000);

TDStatsZelenadole[playerid] = TextDrawCreate(140.000000, 400.000000, "_");
TextDrawBackgroundColor(TDStatsZelenadole[playerid], 255);
TextDrawFont(TDStatsZelenadole[playerid], 1);
TextDrawLetterSize(TDStatsZelenadole[playerid], 0.500000, -2.699999);
TextDrawColor(TDStatsZelenadole[playerid], -1);
TextDrawSetOutline(TDStatsZelenadole[playerid], 0);
TextDrawSetProportional(TDStatsZelenadole[playerid], 1);
TextDrawSetShadow(TDStatsZelenadole[playerid], 1);
TextDrawUseBox(TDStatsZelenadole[playerid], 1);
TextDrawBoxColor(TDStatsZelenadole[playerid], 16711935);
TextDrawTextSize(TDStatsZelenadole[playerid], 431.000000, 0.000000);


TextDrawShowForPlayer(playerid, sstats0); TextDrawShowForPlayer(playerid, sstats5);
TextDrawShowForPlayer(playerid, sstats1); TextDrawShowForPlayer(playerid, sstats6);
TextDrawShowForPlayer(playerid, sstats2); TextDrawShowForPlayer(playerid, sstats7);
TextDrawShowForPlayer(playerid, sstats3); TextDrawShowForPlayer(playerid, sstats8);
TextDrawShowForPlayer(playerid, sstats4);
SelectTextDraw(playerid, 0xA3B4C5FF);
return 1;
}