Pomoc oko Click TD

Započeo .ysi, Januar 26, 2022, 18:14:18 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Ubacivao sam register td,i kada kliknem na "Registruj se" mijenja mi skinove umesto da se registruje,inace sve ostalo radi...
Deo skripte: [pawn]RegisterTD[35] = TextDrawCreate(544.000000, 351.437500, "REGISTRUJ_SE");
   TextDrawLetterSize(RegisterTD[35], 0.206000, 0.777501);
   TextDrawAlignment(RegisterTD[35], 2);
   TextDrawColor(RegisterTD[35], -1);
   TextDrawSetShadow(RegisterTD[35], 0);
   TextDrawSetOutline(RegisterTD[35], 0);
   TextDrawBackgroundColor(RegisterTD[35], 255);
   TextDrawFont(RegisterTD[35], 2);
   TextDrawSetProportional(RegisterTD[35], 1);
   TextDrawSetShadow(RegisterTD[35], 0);
   TextDrawSetSelectable(RegisterTD[35], true);

   RegisterTD[36] = TextDrawCreate(486.000000, 312.937500, "<<<");
   TextDrawLetterSize(RegisterTD[36], 0.250500, 0.952500);
   TextDrawAlignment(RegisterTD[36], 2);
   TextDrawColor(RegisterTD[36], -1);
   TextDrawSetShadow(RegisterTD[36], 0);
   TextDrawSetOutline(RegisterTD[36], 0);
   TextDrawBackgroundColor(RegisterTD[36], 255);
   TextDrawFont(RegisterTD[36], 2);
   TextDrawSetProportional(RegisterTD[36], 1);
   TextDrawSetShadow(RegisterTD[36], 0);
   TextDrawSetSelectable(RegisterTD[36], true);

   RegisterTD[37] = TextDrawCreate(588.000000, 313.812500, ">>>");
   TextDrawLetterSize(RegisterTD[37], 0.250500, 0.952500);
   TextDrawAlignment(RegisterTD[37], 2);
   TextDrawColor(RegisterTD[37], -1);
   TextDrawSetShadow(RegisterTD[37], 0);
   TextDrawSetOutline(RegisterTD[37], 0);
   TextDrawBackgroundColor(RegisterTD[37], 255);
   TextDrawFont(RegisterTD[37], 2);
   TextDrawSetProportional(RegisterTD[37], 1);
   TextDrawSetShadow(RegisterTD[37], 0);
   TextDrawSetSelectable(RegisterTD[37], true);[/pawn]
Evo sada click:
[pawn]
if(clickedid == RegisterTD[36]) { // STRELICA LEVO
      if(PlayerInfo[playerid][xPol] == 0) return SendClientMessageEx(playerid,-1,"{FF0000}(GRESKA): {FFFFFF}Prvo izaberite pol.");
      new currenttime = gettime();
      if(currenttime < (ActorSkinCooldown[playerid] + 1)) return SendClientMessageEx(playerid,-1,"{FF0000}(GRESKA): {FFFFFF}Menjanje skina mozete koristiti svaki sekund.");
      ActorSkinCooldown[playerid] = gettime();
      if(RegisterTDSkin[playerid] == 26) { RegisterTDSkin[playerid] = 59; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(59,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],59); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 28) { RegisterTDSkin[playerid] = 26; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(26,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],26); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 29) { RegisterTDSkin[playerid] = 28; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(28,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],28); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 30) { RegisterTDSkin[playerid] = 29; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(29,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],29); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 59) { RegisterTDSkin[playerid] = 30; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(30,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],30); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 12) { RegisterTDSkin[playerid] = 91; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(91,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],91); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 93) { RegisterTDSkin[playerid] = 12; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(12,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],12); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 91) { RegisterTDSkin[playerid] = 93; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(93,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],93); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
   }
   if(clickedid == RegisterTD[37]) { // STRELICA DESNO
      if(PlayerInfo[playerid][xPol] == 0) return SendClientMessageEx(playerid,-1,"{FF0000}(GRESKA): {FFFFFF}Prvo izaberite pol.");
      new currenttime = gettime();
      if(currenttime < (ActorSkinCooldown[playerid] + 1)) return SendClientMessageEx(playerid,-1,"{FF0000}(GRESKA): {FFFFFF}Menjanje skina mozete koristiti svaki sekund.");
      ActorSkinCooldown[playerid] = gettime();
      if(RegisterTDSkin[playerid] == 26) { RegisterTDSkin[playerid] = 28; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(28,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],28); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 28) { RegisterTDSkin[playerid] = 29; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(29,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],29); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 29) { RegisterTDSkin[playerid] = 30; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(30,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],30); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 30) { RegisterTDSkin[playerid] = 59; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(59,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],59); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 59) { RegisterTDSkin[playerid] = 26; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(26,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],26); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 12) { RegisterTDSkin[playerid] = 93; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(93,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],93); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 93) { RegisterTDSkin[playerid] = 91; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(91,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],91); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
      else if(RegisterTDSkin[playerid] == 91) { RegisterTDSkin[playerid] = 12; DestroyDynamicActor(RegisterActor[playerid]); RegisterActor[playerid] = CreateDynamicActor(12,1676.4891,199.1903,1276.4888,91.2301,0,100.0,0,0); PlayerTextDrawHide(playerid,RegisterSkin[playerid]); PlayerTextDrawSetPreviewModel(playerid,RegisterSkin[playerid],12); PlayerTextDrawShow(playerid,RegisterSkin[playerid]); SetDynamicActorVirtualWorld(RegisterActor[playerid],playerid); }
   }
   if(clickedid == RegisterTD[35]) { //Registracija;
      if(RegSex[playerid] == 0) return SendClientMessageEx(playerid,-1,"{FF0000}(GRESKA): {FFFFFF}Prvo moras popuniti gornji dio registracije.");
      if(!UneoLozinku[playerid] || !UneoEmail[playerid]  || !UneoGodine[playerid] || !UneoPol[playerid]) return SendClientMessageEx(playerid,-1,"{FF0000}(GRESKA): {FFFFFF}Prvo moras popuniti sva polja.");

      CancelSelectTextDraw(playerid);
      IgracSeRegistruje[playerid] = false;
      RegisterTDControlMain(playerid,false);
      PlayerInfo[playerid][xRegistrovan] = 1;
      PlayerInfo[playerid][xPocetniTut] = 0;
      PlayerInfo[playerid][xSpawn] = SetRandomSpawn(playerid);
      PlayerInfo[playerid][xLevel] = ServerInfo[PocetniLevel];
      PlayerInfo[playerid][xIGResursi] = 0;
      PlayerInfo[playerid][xTestAIG] = false;
      PlayerInfo[playerid][xLiderFamilije] = false;
      DestroyDynamicActor(RegisterActor[playerid]);
      new datum[64]; new year,month,day;
      getdate(year,month,day);
      new tmphour,tmpminute,tmpsecond;
      gettime(tmphour,tmpminute,tmpsecond);
      FixHour(tmphour);
      tmphour = shifthour;
      format(datum,sizeof(datum),"%02d/%02d/%d - %d/%d/%d",day,month,year,tmphour,tmpminute,tmpsecond);
      strmid(PlayerInfo[playerid][xLastLogin],datum,0,strlen(datum),64);
      SetPlayerScore(playerid,PlayerInfo[playerid][xLevel]);
      AC_GiveMoney(playerid,ServerInfo[PocetniNovaca]);
      SavePlayer(playerid);
      ac_SetPlayerSkin(playerid,RegisterTDSkin[playerid]);
      PlayerInfo[playerid][xSkin] = RegisterTDSkin[playerid];
      SendClientMessageEx(playerid,0x0077C7FF,"((DRUG)) {FFFFFF}Cao! Dobrodosao u Beograd. Pokazacu ti grad.");
      SendClientMessageEx(playerid,0x0077C7FF,"((DRUG)) {FFFFFF}Sta zelis prvo da ti pokazem»");
      TogglePlayerSpectating(playerid,true);

      TutActor1[playerid] = CreateActor(187,1444.5289,-850.0397,52.1987,168.1021);
      SetActorVirtualWorld(TutActor1[playerid],playerid);
      ApplyActorAnimation(TutActor1[playerid],"MISC","SEAT_LR",4.1,0,0,0,1,1);
      ApplyActorAnimation(TutActor1[playerid],"MISC","SEAT_LR",4.1,0,0,0,1,1);
      TutActor2[playerid] = CreateActor(RegisterTDSkin[playerid],1445.5303,-850.5431,52.3623,163.4021);
      ApplyActorAnimation(TutActor2[playerid],"MISC","SEAT_LR",4.1,0,0,0,1,1);
      ApplyActorAnimation(TutActor2[playerid],"MISC","SEAT_LR",4.1,0,0,0,1,1);
      SetActorVirtualWorld(TutActor2[playerid],playerid);
      SetPlayerInterior(playerid,0);
      SetPlayerVirtualWorld(playerid,playerid);
      AC_SetPlayerPos(playerid,1418.4156,-800.2801,71.5028);
      SetTimerEx("TutCamTimer",500,false,"i",playerid);

      TimerTutorial[playerid] = SetTimerEx("PocetniTut",4000,false,"ii",playerid,1);
      PocetniTutorialStartovan[playerid] = true;
      RandomLoginMuzika(playerid);
   }
   return (1);
}
[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [pawn]//[/pawn]
Slika/video ingame problema(obavezno ako je ingame problem): https://imgur.com/a/FeBBDv6
Kao sto vidite na "<<<" i ">>>" se trebaju mijenjati skinovi,al se mijenjaju i tako i sa "Registruj se"
Poslednja Izmena: Februar 04, 2022, 22:22:53 POSLE PODNE od 'xza
e

Vjerovatno ti je clickable box na textu prevelik.
Najbolje bi ti bilo (da se ne bi mucio napamet), otvori td-ove u editoru, postavi im opciju box i resize-uj.

Posto ti je alignment center, samo postavi otprilike 15.0, 15.0 text size na sva tri td-a

[pawn]RegisterTD[36] = TextDrawCreate(486.000000, 312.937500, "<<<");
TextDrawLetterSize(RegisterTD[36], 0.250500, 0.952500);
TextDrawTextSize(RegisterTD[36], 15.0, 15.0); //Ovu liniju smo dodali
TextDrawAlignment(RegisterTD[36], 2);
TextDrawColor(RegisterTD[36], -1);
TextDrawSetShadow(RegisterTD[36], 0);
TextDrawSetOutline(RegisterTD[36], 0);
TextDrawBackgroundColor(RegisterTD[36], 255);
TextDrawFont(RegisterTD[36], 2);
TextDrawSetProportional(RegisterTD[36], 1);
TextDrawSetShadow(RegisterTD[36], 0);
TextDrawSetSelectable(RegisterTD[36], true);[/pawn]

Otrpilike se igraj sa vrednostima posto nisam siguran kako drugacije da ti pojasnim kako funkcionise sve to

Takodje, ovo moras dodati na svaki textdraw koji je selectable i koji je text ( Registruj se, <<, >>, Lozinka, email, ili sta vec imas )

Citat: V01D poslato Januar 26, 2022, 19:48:27 POSLE PODNE
Posto ti je alignment center, samo postavi otprilike 15.0, 15.0 text size na sva tri td-a

[pawn]RegisterTD[36] = TextDrawCreate(486.000000, 312.937500, "<<<");
TextDrawLetterSize(RegisterTD[36], 0.250500, 0.952500);
TextDrawTextSize(RegisterTD[36], 15.0, 15.0); //Ovu liniju smo dodali
TextDrawAlignment(RegisterTD[36], 2);
TextDrawColor(RegisterTD[36], -1);
TextDrawSetShadow(RegisterTD[36], 0);
TextDrawSetOutline(RegisterTD[36], 0);
TextDrawBackgroundColor(RegisterTD[36], 255);
TextDrawFont(RegisterTD[36], 2);
TextDrawSetProportional(RegisterTD[36], 1);
TextDrawSetShadow(RegisterTD[36], 0);
TextDrawSetSelectable(RegisterTD[36], true);[/pawn]

Otrpilike se igraj sa vrednostima posto nisam siguran kako drugacije da ti pojasnim kako funkcionise sve to

Takodje, ovo moras dodati na svaki textdraw koji je selectable i koji je text ( Registruj se, <<, >>, Lozinka, email, ili sta vec imas )
Hvala ti brate...Lock
e