[Ajuda] Como coloco isso pra funcionar? *.* - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Como coloco isso pra funcionar? *.* (
/showthread.php?tid=596153)
Como coloco isso pra funcionar? *.* -
Fodastiico - 13.12.2015
Bom galera , queria ajuda nesses 'textdraws' , queria saber como por ele para funcionar ex: player comprar casa e mudar de N/A para o id da casa, player comprar vip e mudar de N/A para 'Sim' e assim por diante.
Public:
Код:
public OnPlayerUpdate(playerid)
{
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
new string[128];
format(string, sizeof(string), "~w~Casa: ~r~N/A ~w~Empresa: ~r~N/A ~w~Vip: ~r~N/A ~w~Nick: ~r~~h~%s ~w~Level: ~g~~h~%d", PlayerName(playerid), PlayerInfo[playerid][pLevel]);
TextDrawSetString(Textdraw18 [ playerid ], string);
return 1;
}
Textdraw:
Код:
Textdraw18[i] = TextDrawCreate(26.000000, 433.000000, "~w~Casa: ~r~N/A ~w~Empresa: ~r~N/A ~w~Vip: ~r~N/A ~w~Nick: ~w~Level: ");
TextDrawBackgroundColor(Textdraw18[i], 255);
TextDrawFont(Textdraw18[i], 1);
TextDrawLetterSize(Textdraw18[i], 0.400000, 1.300000);
TextDrawColor(Textdraw18[i], -1);
TextDrawSetOutline(Textdraw18[i], 1);
TextDrawSetProportional(Textdraw18[i], 1);
Agradeзo a quem poder ajudar!
Re: Como coloco isso pra funcionar? *.* -
arakuta - 13.12.2015
Podes utilizar operaзхes ternбrias.
https://sampforum.blast.hk/showthread.php?tid=335491
Exemplo simples:
PHP код:
var temcasa[10] = PlayerInfo[playerid][pCasa] ? ("Sim") : ("Nгo");
Lк-se: Se o valor da variбvel for maior que 0, saнda "Sim", senгo, saнda "Nгo".
Vocк tambйm pode fazer comparaзхes...
PHP код:
var temcasa[10] = PlayerInfo[playerid][pCasa] != 999 ? ("Sim") : ("Nгo");
Lк-se: Se o valor da variбvel for diferente de 999, saнda "Sim", senгo, saнda "Nгo".
A partir de agora, a string
temcasa serб "Sim" ou "Nгo" dependendo do resultado das operaзхes. Podendo ser utilizadas em
formataзгo.
PHP код:
printf("Tenho casa? %s",temcasa);