Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Otisao s Foruma! poslato Februar 20, 2012, 16:20:22 POSLE PODNE

Naslov: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: Otisao s Foruma! poslato Februar 20, 2012, 16:20:22 POSLE PODNE
Skripta koju koristim: FG
Detaljan opis problema:ovako napravio sam jedan textdraw u editoru kada neko ima wl da se pojavi taj text i kada istekne da on nestane, e nez kako da ubacim to sve da bi radilo,tako...?eo textdraw
Dio skripte://

new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;

Textdraw0 = TextDrawCreate(235.000000,316.000000,"textic");
Textdraw1 = TextDrawCreate(178.000000,337.000000,"text");
Textdraw2 = TextDrawCreate(299.000000,338.000000,"textina");
TextDrawAlignment(Textdraw0,0);
TextDrawAlignment(Textdraw1,0);
TextDrawAlignment(Textdraw2,0);
TextDrawBackgroundColor(Textdraw0,0x00000099);
TextDrawBackgroundColor(Textdraw1,0x000000ff);
TextDrawBackgroundColor(Textdraw2,0x000000ff);
TextDrawFont(Textdraw0,2);
TextDrawLetterSize(Textdraw0,0.599999,2.299999);
TextDrawFont(Textdraw1,2);
TextDrawLetterSize(Textdraw1,0.599999,1.900000);
TextDrawFont(Textdraw2,2);
TextDrawLetterSize(Textdraw2,0.799999,1.600000);
TextDrawColor(Textdraw0,0xff0000cc);
TextDrawColor(Textdraw1,0xff0000ff);
TextDrawColor(Textdraw2,0x0000ff66);
TextDrawSetOutline(Textdraw0,1);
TextDrawSetOutline(Textdraw1,1);
TextDrawSetOutline(Textdraw2,1);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetProportional(Textdraw1,1);
TextDrawSetProportional(Textdraw2,1);
TextDrawSetShadow(Textdraw0,1);
TextDrawSetShadow(Textdraw1,1);
TextDrawSetShadow(Textdraw2,1);
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: Blaeks poslato Februar 20, 2012, 16:24:16 POSLE PODNE
Ovo stavis gore gde su svi new a ovo ispod OnGameModeInit
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: Otisao s Foruma! poslato Februar 20, 2012, 16:27:07 POSLE PODNE
ali brate kako da napravim kada neko ima wl da se taj textdraw pojavi tO a kada mu nestane wl da text nestane sam. kontas.. ;D
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: Blaeks poslato Februar 20, 2012, 16:30:40 POSLE PODNE
Stavis varijablu za wanted ako igrac ima wanted da mu to pise a stavis kada nema wanted da mu se text Delete
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: Otisao s Foruma! poslato Februar 20, 2012, 16:33:25 POSLE PODNE
kako brate  :'( de napisi  :D :D
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: Blaeks poslato Februar 20, 2012, 17:05:27 POSLE PODNE
Ne znam sta koristis daj mi tvoju komandu /su(Za davanje wanteda) i napravicu ti
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: rloveution poslato Februar 20, 2012, 17:11:54 POSLE PODNE
napravis provjeru u OnPlayerUpdate?

If(WantedPoints[playerid] != 0 )
{
   If(WantedPoints[playerid] == 1)
    {
      //textdraw za 1
     return 1;
    }

   If(WantedPoints[playerid] == 2)
    {
      //textdraw za 2
    }

   If(WantedPoints[playerid] == 3)
    {
      //textdraw za 3
    }

   If(WantedPoints[playerid] == n)
    {
      //textdraw za n broj ... dodajes samo n zamjenjujes brojem
    }

}


pokusaj :/
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: Otisao s Foruma! poslato Februar 20, 2012, 17:24:08 POSLE PODNE
a ovo brt imam vec jedan textdraw koji koristim jel moram promjenit ove?

new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2; 
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: Blaeks poslato Februar 20, 2012, 17:26:18 POSLE PODNE
Pa logicno :D
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: Otisao s Foruma! poslato Februar 20, 2012, 17:41:50 POSLE PODNE
evo komanda xd ne kontam nikako ovo-.-

if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 11 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 11) { }
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (gTeam[playerid] == 2 || IsACop(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
if (gTeam[giveplayerid] != 2)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [crime text]");
return 1;
}
if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
else { WantedPoints[giveplayerid]+= 2; }
SetPlayerCriminalEx(giveplayerid,playerid, result);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Ne mozete optuziti policajca !");
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Niste Policajac / FBI / Swat !");
}
}
return 1;
}
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: Blaeks poslato Februar 20, 2012, 17:46:16 POSLE PODNE
Koristi GetPlayerWanted => 0) da je wanted veci od nule i onda stavis taj textdraw
Naslov: Odg: [Pomoc] textdraw wanted.
Poruka od: Otisao s Foruma! poslato Februar 20, 2012, 18:02:09 POSLE PODNE
Citat: Blaeks poslato Februar 20, 2012, 17:46:16 POSLE PODNE
Koristi GetPlayerWanted => 0) da je wanted veci od nule i onda stavis taj textdraw

a gdje trebam to sve??da bi radilo na srv-.

edit:eo  ovo sam cjelo izmjenio stavio sam druge brojeve  sta trebam sve da uradim i gdje trebam da ubacim too.....???'

new Text:Textdraw5;
new Text:Textdraw6;
new Text:Textdraw7;

Textdraw5 = TextDrawCreate(235.000000,316.000000,"textic");
Textdraw6 = TextDrawCreate(178.000000,337.000000,"text");
Textdraw7 = TextDrawCreate(299.000000,338.000000,"textina");
TextDrawAlignment(Textdraw5,0);
TextDrawAlignment(Textdraw6,0);
TextDrawAlignment(Textdraw7,0);
TextDrawBackgroundColor(Textdraw5,0x00000099);
TextDrawBackgroundColor(Textdraw6,0x000000ff);
TextDrawBackgroundColor(Textdraw7,0x000000ff);
TextDrawFont(Textdraw5,2);
TextDrawLetterSize(Textdraw5,0.599999,2.299999);
TextDrawFont(Textdraw6,2);
TextDrawLetterSize(Textdraw5,0.599999,1.900000);
TextDrawFont(Textdraw6,2);
TextDrawLetterSize(Textdraw6,0.799999,1.600000);
TextDrawColor(Textdraw5,0xff0000cc);
TextDrawColor(Textdraw6,0xff0000ff);
TextDrawColor(Textdraw7,0x0000ff66);
TextDrawSetOutline(Textdraw5,1);
TextDrawSetOutline(Textdraw6,1);
TextDrawSetOutline(Textdraw7,1);
TextDrawSetProportional(Textdraw5,1);
TextDrawSetProportional(Textdraw6,1);
TextDrawSetProportional(Textdraw7,1);
TextDrawSetShadow(Textdraw5,1);
TextDrawSetShadow(Textdraw6,1);
TextDrawSetShadow(Textdraw7,1);
Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: Otisao s Foruma! poslato Februar 20, 2012, 18:55:27 POSLE PODNE
Sry za DP hoc eneko pomoc  :'( :'( :'( :'(
Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: Martinezz poslato Februar 20, 2012, 19:16:03 POSLE PODNE
Vako!!

Skini ovo evo textdraw 1.0 http://forum.sa-mp.com/showthread.php?t=117851&highlight=textdraw+editor

textdraw editor 0.6 http://forum.sa-mp.com/showthread.php?t=12018&highlight=textdraw+editor

Napravis sta ti treba,onda odes u pawno file/find/textdraw i ispod ubacis

Ili file/find i nadjes PD,i napravis

If(WantedPoints[playerid] != 0 )
{
   If(WantedPoints[playerid] == 1)
    {
      //textdraw za 1
     return 1;
    }

   If(WantedPoints[playerid] == 2)
    {
      //textdraw za 2
    }

   If(WantedPoints[playerid] == 3)
    {
      //textdraw za 3 npr
    }

   If(WantedPoints[playerid] == n)
    {
      //textdraw za 3npr
    }

}


Samo pri vrhu postavis new Textdraw!!

Vidim da si pocetnik,probaj vidit u mojem tutu za mod od 0!!

Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: Otisao s Foruma! poslato Februar 20, 2012, 19:26:04 POSLE PODNE
If(WantedPoints[playerid] != 0 )
{
   If(WantedPoints[playerid] == 1)  jeli ovo kad ima wl 1
    {
     Textdraw5 = TextDrawCreate(235.000000,316.000000,"textic"); sve gdje pise 5 da ubacim ovdje tako i dole
     TextDrawAlignment(Textdraw5,0);
     TextDrawBackgroundColor(Textdraw5,0x00000099);
     return 1;
    }
f(WantedPoints[playerid] == 1)  jeli ovo kad ima wl 1
    {
     ovdje za 6 i dole za 7 jeli i gdje trebam ovo tacno?
     TextDrawAlignment(Textdraw5,0);
     TextDrawBackgroundColor(Textdraw5,0x00000099);
     return 1;
    }
Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: [BR]Maki187 poslato Februar 21, 2012, 16:34:46 POSLE PODNE
Daj ovamo /su komandu...

gledaj kako da uradis

Ovo na vrh skripte:
new Text:Textdraw0[MAX_PLAYERS];
new Text:Textdraw1[MAX_PLAYERS];
new Text:Textdraw2[MAX_PLAYERS];


zatim pod public OnPlayerConect stavis ovo:

// td 0
Textdraw0[playerid] = TextDrawCreate(235.000000,316.000000," ");
TextDrawAlignment(Textdraw0,0);
TextDrawBackgroundColor(Textdraw0,0x00000099);
TextDrawFont(Textdraw0,2);
TextDrawLetterSize(Textdraw0,0.599999,2.299999);
TextDrawColor(Textdraw0,0xff0000cc);
TextDrawSetOutline(Textdraw0,1);
TextDrawSetProportional(Textdraw0,1);
TextDrawSetShadow(Textdraw0,1);

// td 1
Textdraw1[playerid] = TextDrawCreate(178.000000,337.000000," ");
TextDrawAlignment(Textdraw1,0);
TextDrawBackgroundColor(Textdraw1,0x000000ff);
TextDrawFont(Textdraw1,2);
TextDrawLetterSize(Textdraw1,0.599999,1.900000);
TextDrawColor(Textdraw1,0xff0000ff);
TextDrawSetOutline(Textdraw1,1);
TextDrawSetProportional(Textdraw1,1);
TextDrawSetShadow(Textdraw1,1);

//td 2
Textdraw2[playerid] = TextDrawCreate(299.000000,338.000000," ");
TextDrawAlignment(Textdraw2,0);
TextDrawBackgroundColor(Textdraw2,0x000000ff);
TextDrawFont(Textdraw2,2);
TextDrawLetterSize(Textdraw2,0.799999,1.600000);
TextDrawColor(Textdraw2,0x0000ff66);
TextDrawSetOutline(Textdraw2,1);
TextDrawSetProportional(Textdraw2,1);
TextDrawSetShadow(Textdraw2,1);



Zatim u komandi SU podesis ovako:

new string[500];
format(string,sizeof(string),"%d",Ovde Varijablu za igracev wanted);// onaj text obavezno zamenis sa onim kako je u tvom modu definisana varijabla za wanted
TextDrawSetString(Textdraw0[id igraca koj ima wanted],string);
TextDrawShowForPlayer(playerid, Textdraw0[id igraca koj ima wanted]);


I ovo ce na td 0 staviti igracev trenutni wanted... zato sam i trazio komandu /su da mogu lepo da ti podesim, posto prema onom sto si mi poslao na pm, ne znas ni varijabla sta je..  ::)
Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: Otisao s Foruma! poslato Februar 21, 2012, 16:41:06 POSLE PODNE
evo komande xd--.

if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 11 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 11) { }
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (gTeam[playerid] == 2 || IsACop(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
if (gTeam[giveplayerid] != 2)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [crime text]");
return 1;
}
if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
else { WantedPoints[giveplayerid]+= 2; }
SetPlayerCriminalEx(giveplayerid,playerid, result);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Ne mozete optuziti policajca !");
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Niste Policajac / FBI / Swat !");
}
}
return 1;
}
Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: [BR]Maki187 poslato Februar 21, 2012, 16:44:51 POSLE PODNE
nije "xD", pod hitno nauci sta je varijabl,a na PM sam ti pokazao, al nisi odgovorio...

izvoli:

if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 11 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 11) { }
else
{
    SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (gTeam[playerid] == 2 || IsACop(playerid))
{
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
if (gTeam[giveplayerid] != 2)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [crime text]");
return 1;
}
if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
else { WantedPoints[giveplayerid]+= 2; }
SetPlayerCriminalEx(giveplayerid,playerid, result);
new string55[500];
format(string55,sizeof(string55),"%d",WantedPoints[giveplayerid]);
TextDrawSetString(Textdraw0[giveplayerid],string55);
TextDrawShowForPlayer(playerid, Textdraw0[giveplayerid]);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Ne mozete optuziti policajca !");
}
}
}
else
{
format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "   Niste Policajac / FBI / Swat !");
}
}
return 1;
}



Pogledaj kako sam ja uradio, pa ti uradi za ostatak da zelis, napravi provere i slicno, to vec ti moras da radis...

Ovako ce igracu na TextDraw0 da prikaze koliko ima wanteda... naravno, koristi neki tajmer koji ces igracu sakriti taj textdraw, da mu nebude stalno an ekranu...
Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: Otisao s Foruma! poslato Februar 21, 2012, 16:49:23 POSLE PODNE
Ma nmvz mnmg to da ubacim komplikovano nmg da se zamaram lock!
Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: hudiga poslato Februar 21, 2012, 16:51:15 POSLE PODNE
Brate moras se malo potrudit,ako tako nastavis da odustajes od svega,od tebe nece nista biti :PP :D
Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: Otisao s Foruma! poslato Februar 21, 2012, 16:54:03 POSLE PODNE
Citat: ^HuDiGa.amx ^^. poslato Februar 21, 2012, 16:51:15 POSLE PODNE
Brate moras se malo potrudit,ako tako nastavis da odustajes od svega,od tebe nece nista biti :PP :D
Ne nabijaj postove nisam te nista pitao.
Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: [BR]Maki187 poslato Februar 21, 2012, 16:56:02 POSLE PODNE
Mozes da ubacis i nije komplikovano, od svega odustajes, ako sam mogao da ti objasnim sve, mozes i ti da se potrudis da ubacis nesto... da se niko od nas nije potrudio, nebi ni znali da skriptamo... tebi je sve tesko, tako nikad neces nauciti da skriptas... probaj da ubacis...

za tajmer evo ti tut-a


http://wiki.sa-mp.com/wiki/SetTimerEx
Naslov: Odg: [Pomoc] textdraw wanted. pomocccc plss
Poruka od: Otisao s Foruma! poslato Februar 21, 2012, 17:00:38 POSLE PODNE
Nmvz brate kad nece probavao sam hvala tebi u svakom slucaju.  ;)