Detaljan opis problema: Treba mi nesto za sistem da igrac povis svoje glave moze napisati text koji zeli (povis imena)
Dio skripte: //
Neke slike/video za lakse dobivanje pomoci(neobavezno): //
Radim na modu athlone ako neko moze da sto preciznije uradi tj prilagodi bar nekoliko
Hvala unaprijed
CMD:textiznadvugle(playerid, prm[]) {
if (!isnull(params)) SetPlayerChatBubble (http://wiki.sa-mp.com/wiki/SetPlayerChatBubble)(playerid, prm, -1, 100.0, (1000 * 60) * 60);
return 1;
}
Hahahahahh. Gsje mogu dodati da je crvena boja
Parameters:
(playerid, text[], color, Float:drawdistance, expiretime)
playerid The player which should have the chat bubble.
text[] The text to display.
color The text color
drawdistance The distance from where players are able to see the chat bubble.
expiretime The time in miliseconds the bubble should be displayed for.
Lagani test iz engleskog
Mozes uraditi nesto na ovu foru:
[pawn]CMD:label(playerid, params[]
{
new tekst, boja;
if(sscanf(params, "ud", tekst, boja)) return SendClientMessage(playerid, -1, "Koriscenje: /label [tekst] [boja]");
else
{
SetPlayerChatBubble(playerid, tekst, boja, 100.0, 10000);
}
return 1;
}
[/pawn]
Citat: Raptorâ,,¢ poslato Februar 05, 2018, 21:06:06 POSLE PODNE
Mozes uraditi nesto na ovu foru:
[pawn]CMD:label(playerid, params[]
{
new tekst, boja;
if(sscanf(params, "ud", tekst, boja)) return SendClientMessage(playerid, -1, "Koriscenje: /label [tekst] [boja]");
else
{
SetPlayerChatBubble(playerid, tekst, boja, 100.0, 10000);
}
return 1;
}
[/pawn]
Moli se korisnik da nauci sscanf2 specifiere
Trazis SetPlayerChatBubble
Citat: .кÑундер poslato Februar 05, 2018, 21:09:30 POSLE PODNE
Moli se korisnik da nauci sscanf2 specifiere
Moli se korisnik da se ne kurci. Hvala <3.
Citat: Raptorâ,,¢ poslato Februar 05, 2018, 22:04:56 POSLE PODNE
Moli se korisnik da se ne kurci. Hvala <3.
Mislim da ovo nece raditi korisnice. Eo ti karu .i. i srcak ♥
Citat: Raptorâ,,¢ poslato Februar 05, 2018, 21:06:06 POSLE PODNE
Mozes uraditi nesto na ovu foru:
[pawn]CMD:label(playerid, params[]
{
new tekst, boja;
if(sscanf(params, "ud", tekst, boja)) return SendClientMessage(playerid, -1, "Koriscenje: /label [tekst] [boja]");
else
{
SetPlayerChatBubble(playerid, tekst, boja, 100.0, 10000);
}
return 1;
}
[/pawn]
Zab si zagradu da zatvoris
[pawn]CMD:label(playerid, params[])
{
new tekst, boja;
if(sscanf(params, "ud", tekst, boja)) return SendClientMessage(playerid, -1, "Koriscenje: /label [tekst] [boja]");
else
{
SetPlayerChatBubble(playerid, tekst, boja, 100.0, 10000);
}
return 1;
}
[/pawn]
Mislim da morate da ponovite specifiere
Specifier(s) Name Example values
i, d Integer 1, 42, -10
c Character a, o, *
l Logical true, false
b Binary 01001, 0b1100
h, x Hex 1A, 0x23
o Octal 045 12
n Number 42, 0b010, 0xAC, 045
f Float 0.7, -99.5
g IEEE Float 0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E
u User name/id (bots and players) Y_Less, 0
q Bot name/id ShopBot, 27
r Player name/id Y_Less, 42
Ovo ti je tipa sa crvenom bojom sto si rekao da hoces
[pawn]
CMD:tekstiznadvugle(playerid, params[])
{
if(sscanf(params, "s[30]", params)) return SCM(playerid, -1, "/tekstiznadvugle [tekst]");
new szString[33];
format(szString, 33, "[%s]", params);
SetPlayerChatBubble(playerid, szString, 0xE50209FF, 30.0, 60000);
return 1;
}
[/pawn]
Citat: TerzicY poslato Februar 05, 2018, 22:42:50 POSLE PODNE
Ovo ti je tipa sa crvenom bojom sto si rekao da hoces
[pawn]
CMD:tekstiznadvugle(playerid, params[])
{
if(sscanf(params, "s[30]", params)) return SCM(playerid, -1, "/tekstiznadvugle [tekst]");
new szString[33];
format(szString, 33, "[%s]", params);
SetPlayerChatBubble(playerid, szString, 0xE50209FF, 30.0, 60000);
return 1;
}
[/pawn]
Bolje da ne koristis sscanf jer to je jedna teza provjera vise, napisao sam gore kod, isnull radi posao.
Citat: .кÑундер poslato Februar 05, 2018, 22:49:36 POSLE PODNE
Bolje da ne koristis sscanf jer to je jedna teza provjera vise, napisao sam gore kod, isnull radi posao.
isnull provera samo da li je string 0, neka budala ce naleti i napisati preko 60 karaktera i stavice u SetPlayerChatBubble?
Limit Chat Bubble String 144 characters. Njegova je stvar da li ce dozvoliti i koliko karaktera svakako se moze skratiti.
Ogranicimo ga:
CMD:textiznadvugle(playerid, prm[60]) {
if (!isnull(prm)) {
SetPlayerChatBubble(playerid, prm, -1, 100.0, (1000 * 60) * 60);
}
return 1;
}
na 60 karaktera ili ti ako bas hoces [%s]..
CMD:textiznadvugle(playerid, prm[62]) {
if (!isnull(prm)) {
format(prm, sizeof prm, "[%.60s]", prm);
SetPlayerChatBubble(playerid, prm, -1, 100.0, (1000 * 60) * 60);
}
return 1;
}
Hvala za pomoc !