String

Započeo ᗪ卂乂, Februar 05, 2018, 19:03:16 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Detaljan opis problema: eo mucim se vec neko vreme ovo da napravim
Dio skripte:
new playerid;
	new string[32], iskustvo; iskustvo = (PlayerInfo[playerid][pLevel] * 2) + 2;
	
	DAXSTATS[0][playerid] = CreatePlayerTextDraw(playerid, 501.999969, 108.681480, "EXP:0/4");
	PlayerTextDrawLetterSize(playerid, DAXSTATS[0][playerid], 0.299666, 1.181036);
	PlayerTextDrawAlignment(playerid, DAXSTATS[0][playerid], 1);
	PlayerTextDrawColor(playerid, DAXSTATS[0][playerid], -1);
	PlayerTextDrawSetShadow(playerid, DAXSTATS[0][playerid], 0);
	PlayerTextDrawSetOutline(playerid, DAXSTATS[0][playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DAXSTATS[0][playerid], 51);
	PlayerTextDrawFont(playerid, DAXSTATS[0][playerid], 2);
	PlayerTextDrawSetProportional(playerid, DAXSTATS[0][playerid], 1);
	PlayerTextDrawSetString(playerid,DAXSTATS[0][playerid], string);

	DAXSTATS[1][playerid] = CreatePlayerTextDraw(playerid, 501.333343, 138.548080, "Nick_Denaro");
	PlayerTextDrawLetterSize(playerid, DAXSTATS[1][playerid], 0.146666, 0.882370);
	PlayerTextDrawAlignment(playerid, DAXSTATS[1][playerid], 1);
	PlayerTextDrawColor(playerid, DAXSTATS[1][playerid], -1);
	PlayerTextDrawSetShadow(playerid, DAXSTATS[1][playerid], 0);
	PlayerTextDrawSetOutline(playerid, DAXSTATS[1][playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DAXSTATS[1][playerid], 51);
	PlayerTextDrawFont(playerid, DAXSTATS[1][playerid], 2);
	PlayerTextDrawSetProportional(playerid, DAXSTATS[1][playerid], 1);
	PlayerTextDrawSetString(playerid,DAXSTATS[1][playerid], string);

    //for(new i = 0; i < 38; i++) PlayerTextDrawShow(playerid, DAXSTATS[i][playerid]);
    //new string[32], iskustvo; iskustvo = (PlayerInfo[playerid][pLevel] * 2) + 2;
	format(string, sizeof(string),"EXP: ~w~%d/%d",PlayerInfo[playerid][pExp], iskustvo);
	format(string, sizeof(string),"%s",GetName(playerid));

Neke slike/video za lakse dobivanje pomoci(neobavezno):
C:\Users\Grebovic\Desktop\WRP\gamemodes\WRP.pwn(19664) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Grebovic\Desktop\WRP\gamemodes\WRP.pwn(19686) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Grebovic\Desktop\WRP\gamemodes\WRP.pwn(19715) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Grebovic\Desktop\WRP\gamemodes\WRP.pwn(19737) : warning 219: local variable "string" shadows a variable at a preceding level

credits: Xunder, Ino420, Muma

Citat: Pottus;3903994
SetPlayerPos("dreni1998", 666.666, 666.666, 666.666, 666.666);    ///// GO IN HELL MOTHERFUCKER

https://i.imgur.com/XHLx9oj.gif
https://i.ibb.co/ZJqQKWT/NXRX.gif

Na tim linijama imas definisan string koji je vec definisan negde.
(19664)
(19686)
(19715)
(19737)

Citat: \nLucius poslato Februar 05, 2018, 19:08:57 POSLE PODNE
Na tim linijama imas definisan string koji je vec definisan negde.
(19664)
(19686)
(19715)
(19737)
To sam i ja skontao
Ali koji god broj da stavim ovde u stringu opet isto
new string[32]

credits: Xunder, Ino420, Muma

Citat: Pottus;3903994
SetPlayerPos("dreni1998", 666.666, 666.666, 666.666, 666.666);    ///// GO IN HELL MOTHERFUCKER

https://i.imgur.com/XHLx9oj.gif
https://i.ibb.co/ZJqQKWT/NXRX.gif

Samo promijeni naziv, da nije baš 'string'
Former Developer | COD: Lords Of War - Modern Warfare 3 | Stunt Planet | Global Warfare |

Ne nego uzmesi obrises string jer vec si ga negde definisao.
new playerid, iskustvo;
iskustvo = (PlayerInfo[playerid][pLevel] * 2) + 2;

Citat: \nLucius poslato Februar 05, 2018, 19:13:26 POSLE PODNE
Ne nego uzmesi obrises string jer vec si ga negde definisao.
new playerid, iskustvo;
iskustvo = (PlayerInfo[playerid][pLevel] * 2) + 2;
Citat: Bolex_ poslato Februar 05, 2018, 19:13:18 POSLE PODNE
Samo promijeni naziv, da nije baš 'string'
Oboje sam pokusao, bolex tvoja ideja mi srusi pola skripter i sve se unaguje, a ovaj druga ideja samo napravi jos vise errora da nije definisan string

credits: Xunder, Ino420, Muma

Citat: Pottus;3903994
SetPlayerPos("dreni1998", 666.666, 666.666, 666.666, 666.666);    ///// GO IN HELL MOTHERFUCKER

https://i.imgur.com/XHLx9oj.gif
https://i.ibb.co/ZJqQKWT/NXRX.gif

A pokušaj ovako: 'Varijabla ti mora biti izvan same funkcije'

new playerid, string[ 32 ], iskustvo; iskustvo = (PlayerInfo[playerid][pLevel] * 2) + 2;

    //for(new i = 0; i < 38; i++) PlayerTextDrawShow(playerid, DAXSTATS[i][playerid]);
    //new string[32], iskustvo; iskustvo = (PlayerInfo[playerid][pLevel] * 2) + 2;
	format(string, sizeof(string),"EXP: ~w~%d/%d",PlayerInfo[playerid][pExp], iskustvo);
	format(string, sizeof(string),"%s",GetName(playerid));

	DAXSTATS[0][playerid] = CreatePlayerTextDraw(playerid, 501.999969, 108.681480, "EXP:0/4");
	PlayerTextDrawLetterSize(playerid, DAXSTATS[0][playerid], 0.299666, 1.181036);
	PlayerTextDrawAlignment(playerid, DAXSTATS[0][playerid], 1);
	PlayerTextDrawColor(playerid, DAXSTATS[0][playerid], -1);
	PlayerTextDrawSetShadow(playerid, DAXSTATS[0][playerid], 0);
	PlayerTextDrawSetOutline(playerid, DAXSTATS[0][playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DAXSTATS[0][playerid], 51);
	PlayerTextDrawFont(playerid, DAXSTATS[0][playerid], 2);
	PlayerTextDrawSetProportional(playerid, DAXSTATS[0][playerid], 1);
	PlayerTextDrawSetString(playerid,DAXSTATS[0][playerid], string);

	DAXSTATS[1][playerid] = CreatePlayerTextDraw(playerid, 501.333343, 138.548080, "Nick_Denaro");
	PlayerTextDrawLetterSize(playerid, DAXSTATS[1][playerid], 0.146666, 0.882370);
	PlayerTextDrawAlignment(playerid, DAXSTATS[1][playerid], 1);
	PlayerTextDrawColor(playerid, DAXSTATS[1][playerid], -1);
	PlayerTextDrawSetShadow(playerid, DAXSTATS[1][playerid], 0);
	PlayerTextDrawSetOutline(playerid, DAXSTATS[1][playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DAXSTATS[1][playerid], 51);
	PlayerTextDrawFont(playerid, DAXSTATS[1][playerid], 2);
	PlayerTextDrawSetProportional(playerid, DAXSTATS[1][playerid], 1);
	PlayerTextDrawSetString(playerid,DAXSTATS[1][playerid], string);
Poslednja Izmena: Februar 05, 2018, 19:24:46 POSLE PODNE od Bolex_
Former Developer | COD: Lords Of War - Modern Warfare 3 | Stunt Planet | Global Warfare |

Citat: Bolex_ poslato Februar 05, 2018, 19:22:34 POSLE PODNE
A pokušaj ovako: 'Varijabla ti mora biti izvan same funkcije'

new playerid, string[ 32 ], iskustvo; iskustvo = (PlayerInfo[playerid][pLevel] * 2) + 2;

    //for(new i = 0; i < 38; i++) PlayerTextDrawShow(playerid, DAXSTATS[i][playerid]);
    //new string[32], iskustvo; iskustvo = (PlayerInfo[playerid][pLevel] * 2) + 2;
	format(string, sizeof(string),"EXP: ~w~%d/%d",PlayerInfo[playerid][pExp], iskustvo);
	format(string, sizeof(string),"%s",GetName(playerid));

	DAXSTATS[0][playerid] = CreatePlayerTextDraw(playerid, 501.999969, 108.681480, "EXP:0/4");
	PlayerTextDrawLetterSize(playerid, DAXSTATS[0][playerid], 0.299666, 1.181036);
	PlayerTextDrawAlignment(playerid, DAXSTATS[0][playerid], 1);
	PlayerTextDrawColor(playerid, DAXSTATS[0][playerid], -1);
	PlayerTextDrawSetShadow(playerid, DAXSTATS[0][playerid], 0);
	PlayerTextDrawSetOutline(playerid, DAXSTATS[0][playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DAXSTATS[0][playerid], 51);
	PlayerTextDrawFont(playerid, DAXSTATS[0][playerid], 2);
	PlayerTextDrawSetProportional(playerid, DAXSTATS[0][playerid], 1);
	PlayerTextDrawSetString(playerid,DAXSTATS[0][playerid], string);

	DAXSTATS[1][playerid] = CreatePlayerTextDraw(playerid, 501.333343, 138.548080, "Nick_Denaro");
	PlayerTextDrawLetterSize(playerid, DAXSTATS[1][playerid], 0.146666, 0.882370);
	PlayerTextDrawAlignment(playerid, DAXSTATS[1][playerid], 1);
	PlayerTextDrawColor(playerid, DAXSTATS[1][playerid], -1);
	PlayerTextDrawSetShadow(playerid, DAXSTATS[1][playerid], 0);
	PlayerTextDrawSetOutline(playerid, DAXSTATS[1][playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DAXSTATS[1][playerid], 51);
	PlayerTextDrawFont(playerid, DAXSTATS[1][playerid], 2);
	PlayerTextDrawSetProportional(playerid, DAXSTATS[1][playerid], 1);
	PlayerTextDrawSetString(playerid,DAXSTATS[1][playerid], string);

Nop
C:\Users\Grebovic\Desktop\WRP\gamemodes\WRP.pwn(19693) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Grebovic\Desktop\WRP\gamemodes\WRP.pwn(19715) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Grebovic\Desktop\WRP\gamemodes\WRP.pwn(19744) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Grebovic\Desktop\WRP\gamemodes\WRP.pwn(19766) : warning 219: local variable "string" shadows a variable at a preceding level

credits: Xunder, Ino420, Muma

Citat: Pottus;3903994
SetPlayerPos("dreni1998", 666.666, 666.666, 666.666, 666.666);    ///// GO IN HELL MOTHERFUCKER

https://i.imgur.com/XHLx9oj.gif
https://i.ibb.co/ZJqQKWT/NXRX.gif

Citat: Bolex_ poslato Februar 05, 2018, 19:13:18 POSLE PODNE
Samo promijeni naziv, da nije baš 'string' 'Varijabla ti mora biti izvan same funkcije'

Samo da uradiÅ¡ neÅ¡to od ovoga dvoje rijeÅ¡ilo bi problem, kompliciraÅ¡.  ;)
Former Developer | COD: Lords Of War - Modern Warfare 3 | Stunt Planet | Global Warfare |

Citat: Bolex_ poslato Februar 05, 2018, 19:31:54 POSLE PODNE
Samo da uradiÅ¡ neÅ¡to od ovoga dvoje rijeÅ¡ilo bi problem, kompliciraÅ¡.  ;)
Brate pogledaj gore menjao sam naziv ali se pola skripte ubaguje, nista probacu nesto sam hvala

credits: Xunder, Ino420, Muma

Citat: Pottus;3903994
SetPlayerPos("dreni1998", 666.666, 666.666, 666.666, 666.666);    ///// GO IN HELL MOTHERFUCKER

https://i.imgur.com/XHLx9oj.gif
https://i.ibb.co/ZJqQKWT/NXRX.gif

Ignore warning
MAJ SKVEL BOGOTAC JA SAM MAJ SKVEL MAKAVELI MAJSTOR OH NE JA SAM BOGOTAC JA ZNAM MAJ SKVEL TI KORISTIS .INI OH NE TI SI BOTARA I KANCER SI JER NE KORISTIS MAJ SKVEL MAKAVELI OH NE...

ili
Y_INI ne odredjuje tvoje sposobnosti :D
(Ono gore Joey)

E ovako ja vama nisam objasnio o cemu se radi, uzeo sam exp td i td za nick iz /stats, mrzelo me da trazim po netu, eo sad cu napravit ima tuta na net...

credits: Xunder, Ino420, Muma

Citat: Pottus;3903994
SetPlayerPos("dreni1998", 666.666, 666.666, 666.666, 666.666);    ///// GO IN HELL MOTHERFUCKER

https://i.imgur.com/XHLx9oj.gif
https://i.ibb.co/ZJqQKWT/NXRX.gif

Gle, ako ne znas engleski, tu je google translate, na njemu mozes prevesti sta god pozelis.

http://prntscr.com/iaj6au

Ako i dalje ne razumijes, to ti znaci da ti je varijabla "string" vec prije toga definirana, zato samo uklonis string[array] i kraj price

new iskustvo; iskustvo = (PlayerInfo[playerid][pLevel] * 2) + 2;


A koliko vidim definirao si "new playerid;"

Vjerujem da ti se TD nalazi u OnGameModeInit iako je taj TD PlayerTextDraw, a on ide pod OnPlayerConnect