[Pomoc]TextDraw

Započeo --Lood--, Maj 07, 2013, 18:45:33 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Scripta koju koristim: od 0
Opis problema: E vako pravio sam stats na klik...Medjutim kada kucam /stats izbaci mi textdraw ali kad akliknem na njega nista se ne dogadja...i ono kada nasloonim mis na text osnovno ne promeni boju kao sto je to u drugim systemima ....
Dio scripte:
ongamemodeinit

//stats
TextOsnovno = TextDrawCreate(43.000000, 125.000000, "Osnovno");
TextDrawBackgroundColor(TextOsnovno, 255);
TextDrawFont(TextOsnovno, 1);
TextDrawLetterSize(TextOsnovno, 0.500000, 1.000000);
TextDrawColor(TextOsnovno, -1);
TextDrawSetOutline(TextOsnovno, 0);
TextDrawSetProportional(TextOsnovno, 1);
TextDrawSetShadow(TextOsnovno, 1);
TextDrawUseBox(TextOsnovno, 1);
TextDrawBoxColor(TextOsnovno, 255);
TextDrawTextSize(TextOsnovno, 183.000000, 0.000000);
TextDrawSetSelectable(TextOsnovno, 1);

onplayerconnect

TextIme[playerid] = TextDrawCreate(43.000000, 138.000000, "Ime:");
TextDrawBackgroundColor(TextIme[playerid], 255);
TextDrawFont(TextIme[playerid], 1);
TextDrawLetterSize(TextIme[playerid], 0.430000, 1.000000);
TextDrawColor(TextIme[playerid], -1);
TextDrawSetOutline(TextIme[playerid], 0);
TextDrawSetProportional(TextIme[playerid], 1);
TextDrawSetShadow(TextIme[playerid], 1);
TextDrawUseBox(TextIme[playerid], 1);
TextDrawBoxColor(TextIme[playerid], 255);
TextDrawTextSize(TextIme[playerid], 176.000000, 0.000000);

cmd:stats


CMD:stats(playerid, params[])
{
if(PlayerInfo[playerid][pLogin] < 1) return SendClientMessage(playerid,0xFFFFFFAA,"  Nisi se logovao");
TextDrawShowForPlayer(playerid, TextOsnovno);


SelectTextDraw(playerid, 0xA3B4C5FF);
return 1;
}


onplayerclicttextdraw


if(clickedid == TextOsnovno)
{
TextDrawShowForPlayer(playerid, TextIme[playerid]);
TextDrawHideForPlayer(playerid, TextOsnovno);
TextDrawHideForPlayer(playerid, TextNovac);
TextDrawHideForPlayer(playerid, TextImovina);
TextDrawHideForPlayer(playerid, TextWarFZ);
TextDrawHideForPlayer(playerid, TextTorba);

CancelSelectTextDraw(playerid);

new statsstr[256], statsstr2[256], statsstr3[512];

new nxtlevel = PlayerInfo[playerid][pLevel];
new expamount = nxtlevel*sledecilevel;

new olevel = PlayerInfo[playerid][pLevel];
new arespekti = PlayerInfo[playerid][pRespekta];
new eplate = PlayerInfo[playerid][pKonektovanVremena];
new agodine = PlayerInfo[playerid][pGodine];
new isplatapred = PlayerInfo[playerid][pIsplataZaPlatu];
new inforank = PlayerInfo[playerid][pRank];
new orgkazna = PlayerInfo[playerid][pOrgKazna];
new ICDrzava[20];
if(PlayerInfo[playerid][pICDrzava] == 1) { ICDrzava = "Los Santos"; }
else if(PlayerInfo[playerid][pICDrzava] == 2) { ICDrzava = "San Fierro"; }
else if(PlayerInfo[playerid][pICDrzava] == 3) { ICDrzava = "Las Venturas"; }
new ICSpol[20];
if(PlayerInfo[playerid][pICSpol] == 1) { ICSpol = "Musko"; }
else if(PlayerInfo[playerid][pICSpol] == 2) { ICSpol = "Zensko"; }

new otext[20];
if(PlayerInfo[playerid][pSpol] == 1) { otext = "Musko"; }
else if(PlayerInfo[playerid][pSpol] == 2) { otext = "Zensko"; }

new ttext[30];
if(PlayerInfo[playerid][pPosao] == 0) { ttext = "Nemate posao"; }
else if(PlayerInfo[playerid][pPosao] == 1) { ttext = "Farmer"; }
else if(PlayerInfo[playerid][pPosao] == 2) { ttext = "Diler Droge"; }
else if(PlayerInfo[playerid][pPosao] == 3) { ttext = "Dee Jay"; }
else if(PlayerInfo[playerid][pPosao] == 4) { ttext = "Dzeparos"; }
else if(PlayerInfo[playerid][pPosao] == 5) { ttext = "Cistac ulica"; }
else if(PlayerInfo[playerid][pPosao] == 6) { ttext = "Mehnicar"; }
else if(PlayerInfo[playerid][pPosao] == 7) { ttext = "Vozac autobusa"; }
else if(PlayerInfo[playerid][pPosao] == 8) { ttext = "Diler oruzija"; }
else if(PlayerInfo[playerid][pPosao] == 9) { ttext = "Ilegalni taksista"; }
else if(PlayerInfo[playerid][pPosao] == 10) { ttext = "Dostavljac"; }
else if(PlayerInfo[playerid][pPosao] == 11) { ttext = "Pjevac"; }
else if(PlayerInfo[playerid][pPosao] == 12) { ttext = "Mornar"; }



new ptext[20];
if(PlayerInfo[playerid][pDrzava] == 1) { ptext = "BiH"; }
else if(PlayerInfo[playerid][pDrzava] == 2) { ptext = "Srbija"; }
else if(PlayerInfo[playerid][pDrzava] == 3) { ptext = "Hrvatska"; }
else if(PlayerInfo[playerid][pDrzava] == 4) { ptext = "Crna Gora"; }
else if(PlayerInfo[playerid][pDrzava] == 5) { ptext = "Makedonija"; }
else if(PlayerInfo[playerid][pDrzava] == 6) { ptext = "Slovenija"; }
new pugovor = PlayerInfo[playerid][pSatiPosao];

new orttext[20];
if(PlayerInfo[playerid][pLeader] == 0 || PlayerInfo[playerid][pClan] == 0) { orttext = "Civil"; }
else if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pClan] == 1) { orttext = "LSN"; }
else if(PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pClan] == 2) { orttext = "Yakuza"; }
else if(PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pClan] == 3) { orttext = "Triad Family"; }
else if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pClan] == 4) { orttext = "LSPD"; }
else if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pClan] == 5) { orttext = "GSF"; }
else if(PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pClan] == 6) { orttext = "Ballas"; }
else if(PlayerInfo[playerid][pLeader] == 7 || PlayerInfo[playerid][pClan] == 7) { orttext = "Medicina"; }


format(statsstr, sizeof(statsstr), "~b~Ime: ~w~%s~n~n~\
~b~Prezime: ~w~%s~n~~n~\
~b~OOC Porijeklo: ~w~%s~n~~n~\
~b~OOC Godine: ~w~%d~n~~n~\
~b~OOC Pol: ~w~%s~n~~n~\
~b~Level: ~w~%d~n~~n\
~b~Respekti: ~w~%d/%d~n~~n~\
~b~Sati igre: ~w~%d~n~~n~\
~b~Norma: ~w~%d/30~n~~n~",GetPlayerFirstName(playerid),GetPlayerLastName(playerid), ptext,
agodine, otext, olevel, arespekti, expamount, eplate, isplatapred);

format(statsstr2, sizeof(statsstr2), "~b~Porijeklo: ~w~%s~n~~n~\
~b~Godine: ~w~%d~n~~n~\
~b~Pol: ~w~%s~n~~n~\
~b~Posao: ~w~%s~n~~n~\
~b~Posao ugovor: ~w~%d/5~n~~n~\
~b~Supruznik: ~w~%s~n~~n~\
~b~Org: ~w~%s~n~~n~\
~b~Rank: ~w~%d~n~~n~\
~b~Org kazna: %d",ICDrzava, PlayerInfo[playerid][pICGodine],ICSpol,
ttext, pugovor, PlayerInfo[playerid][pOsoba], orttext, inforank, orgkazna);
format(statsstr3, sizeof(statsstr3), "%s%s", statsstr, statsstr2);
TextDrawSetString(TextIme[playerid], statsstr3);
TextDrawSetString(TextOsnovno, "Osnovno");

}


Slika/video:


jeli ovo


  if(_:clickedid != INVALID_TEXT_DRAW) // If the player clicked a valid textdraw, continue with the coding. (_:var removes the Text: tag, to avoid tag mismatch)
    {

}

EDIT:Nije ni do ovog sad sam testo..Moze malo preciznije gde sam pogresio ?
Poslednja Izmena: Maj 07, 2013, 18:56:05 POSLE PODNE od --Lood--

ne naprotiv to i nije, ti nemas gresaka tu, nego imas falinki, lose je formatirano to, radi po tutorijalu sto sam ti dao gore

pax95

Nisi napravio gde moze da klika to ti je problem primer:
TextDrawTextSize(TextOsnovno, 183.000000, 0.000000);
Tu ti je Y = 0 i onda bukvalno nemas polje za klikanje, tako da napravi box kada kreiras rasiri kako zelis da bude pa mozes da ikljucis box onda ali zapamtice TextSize, za sada povecaj sam to Y i radice


pax95

Citat: --Lood-- poslato Maj 07, 2013, 19:17:59 POSLE PODNE
Tnx, radi sada...Ali kada kliknem crasha me...
Mozete videt sta envalja pod
OnPlayerClickTextDraw :)
Ovde:
format(statsstr, sizeof(statsstr), "~b~Ime: ~w~%s~n~n~\
Tu ti fali ~
Trebalo bi:
format(statsstr, sizeof(statsstr), "~b~Ime: ~w~%s~n~~n~\
Proveri da nemas jos greska takvih jer kada ti fali ~ to dovodi do crasha

EDIT:
Evo i ovde ti fali:
~b~Level: ~w~%d~n~~n\
To sam na brzinu pregledao
Poslednja Izmena: Maj 07, 2013, 19:23:44 POSLE PODNE od [BC:RP] Mr.Gagi



format(statsstr, sizeof(statsstr), "~b~Ime: ~w~%s~n~~n~\
~b~Prezime: ~w~%s~n~~n~\
~b~OOC Porijeklo: ~w~%s~n~~n~\
~b~OOC Godine: ~w~%d~n~~n~\
~b~OOC Pol: ~w~%s~n~~n~\
~b~Level: ~w~%d~n~~n~\
~b~Respekti: ~w~%d/%d~n~~n~\
~b~Sati igre: ~w~%d~n~~n~\
~b~Norma: ~w~%d/30~n~~n~",GetPlayerFirstName(playerid),GetPlayerLastName(playerid), ptext,
agodine, otext, olevel, arespekti, expamount, eplate, isplatapred);

format(statsstr2, sizeof(statsstr2), "~b~Porijeklo: ~w~%s~n~~n~\
~b~Godine: ~w~%d~n~~n~\
~b~Pol: ~w~%s~n~~n~\
~b~Posao: ~w~%s~n~~n~\
~b~Posao ugovor: ~w~%d/5~n~~n~\
~b~Supruznik: ~w~%s~n~~n~\
~b~Org: ~w~%s~n~~n~\
~b~Rank: ~w~%d~n~~n~\
~b~Org kazna: ~w~%d",ICDrzava, PlayerInfo[playerid][pICGodine],ICSpol,
ttext, pugovor, PlayerInfo[playerid][pOsoba], orttext, inforank, orgkazna);
format(statsstr3, sizeof(statsstr3), "%s\%s", statsstr, statsstr2);
TextDrawSetString(TextIme[playerid], statsstr3);
TextDrawSetString(TextOsnovno, "Osnovno");

Evo sredio sam i opet crasha ...